This workspace is composed of multiple interconnected projects:
api
: The beating heart of our operation. This project defines the Trakt API interactions usingts-rest
andzod
for type-safe communication and validation. Think of it as our precinct's meticulously organized evidence board.playground
: Our detective's sandbox. This CLI project allows for effortless exploration and experimentation with the Trakt API. It's where we test our hunches and follow the leads.swagger
: The public notice board. A simplehono
server that exposes the API contract as an OpenAPI/Swagger definition, providing clear documentation for those who wish to understand our methods.client
: The gleaming chrome of our pursuit. This project houses the Trakt Lite client, a sleek and efficient machine built with Deno and SvelteKit. It's the polished facade, the fast car we use to chase down those elusive media insights. (Just try not to crash it into a dumpster fire like last time.)
The following environment variables are required for the workspace to function properly:
TRAKT_CLIENT_ID
: The client ID for the Trakt API.TRAKT_CLIENT_SECRET
: The client secret for the Trakt API.- Required for the
playground
project.
- Required for the
TRAKT_SESSION_SECRET
: The session encryption secret for the Trakt API.deno task insecurity:generate
This is a Deno project, so you need to have Deno installed on your machine please refer to the Deno installation guide.
- Clone the repository
- Install dependencies:
deno task install
- Run tasks:
-
Workspace:
- Format & Lint:
deno task format
- Format & Lint:
-
Playground:
- Development:
deno task playground:dev
- Development:
-
Swagger:
- Serve:
deno task swagger
- Development:
deno task swagger:dev
- Serve:
-
Client:
- Development:
deno task client:dev
- Development:
To embark on your web development journey, simply utter the incantation
deno task dev
within the hallowed halls of the projects/client
directory.
Then, summon forth the browser of your choice, and behold the fruits of your
labor.
Should you seek to venture into the untamed wilds of Android development, this guide shall illuminate your path, granting you the power to:
- Install Development PWA: Summon forth a development version of the Progressive Web App, and bind it to your Android device. (Fear not, for the arcane art of remote debugging shall be at your disposal.)
- Debug Website Version: Should you prefer the familiar comforts of the Chrome browser, you may also conjure forth the website version and subject it to your debugging scrutiny.
To embark on this mobile odyssey, consult the Chrome Remote Debugging grimoire. Within its pages lies the knowledge to establish a connection between your development environment and the Android realm.
The device management portal, accessible via the incantation
chrome://inspect/#devices
, shall serve as your gateway to the Android domain.
It functions with both:
- Option 1: Android Studio Emulated Device: A simulated realm, where digital phantoms mimic the behavior of physical devices.
- Option 2: Physical Device (USB Connection): A tangible device, tethered to your development machine via the umbilical cord of USB.
Once you have established a connection, invoke the following command to establish a reverse proxy:
adb reverse tcp:5173 tcp:5173
Coming Soon!
To build the Trakt Lite client, run the following command:
cd projects/client/
[deno|npm|bun] run build
Simply run the following command:
[deno|npm|bun] run build:preview && [deno|npm|bun] run preview
deno install -g --allow-all -n ncu npm:npm-check-updates
NOTE: For the client project add the -p npm
since we're using a package.json
definition for the svelte project.
- Check:
ncu --dep prod -t minor
- Update:
ncu --dep prod -t minor -u
- Check:
ncu --dep dev -t minor
- Update:
ncu --dep dev -t minor -u
Verify that the above steps run smoothly and revert any changes that break the build (this should generally not be the case).
- Production:
ncu --dep prod -t latest
- Development:
ncu --dep dev -t latest
For each entry listed as a result:
ncu <ENTRY> -u -t latest
- Build
- Update any breaks
- Test
- Commit
Should the chaotic forces of rebasing leave your client/i18n/messages
folder
in a state of disarray, fear not, intrepid developer. For within this document
lies the knowledge to restore harmony to the realm of translations.
When merging your linguistic endeavors with the main
branch, conflicts may
arise within the client/i18n/messages
domain. This is to be expected, for the
path of internationalization is fraught with peril and unexpected detours.
To navigate this linguistic labyrinth and emerge victorious, follow these steps:
-
Ensure the presence of the
deno
CLI: This digital incantation, a key to unlocking the secrets of conflict resolution, must be present within your development arsenal. -
Invoke the resolution ritual: From the heart of the project, intone the following command:
deno task client:i18n:resolve
Alternatively, should you find yourself within the
projects/client
domain, utter this incantation:deno task i18n:resolve
These commands, like ancient spells whispered in the dead of night, shall
resolve the conflicts and restore order to the i18n/messages/*.json
files. The
translations, once fragmented and disjointed, shall merge into a harmonious
symphony of multilingual understanding.
With these tools at your disposal, you shall emerge from the chaos of rebasing with your sanity intact and your translations unified. Go forth, and conquer the linguistic challenges that lie before you.
For more details about infrastructure, see: INFRASTRUCTURE.md.