Run Kinora locally
Install and start each app with Node.js and Yarn, one terminal per app.
For the Full Stack package
Before you start: install Node.js 22.9 or newer (22 for the Backend package alone) and run corepack enable once. No database server is needed.
Open every terminal where the commands below expect it: inside kinora-fitness-full-stack for the full stack, or next to the app's folder for a single-app package.
| App | Folder | Address |
|---|---|---|
| API | back-end | localhost:8000Local |
| Dashboard | dashboard | localhost:3030Local |
Start the API first: with the steps below the dashboard reads all of its data from it.
Start the API
Install and configure
.env.exampleworks as it is for local development.Having trouble?Terminalcorepack enable cd back-end yarn install cp .env.example .envCreate the database
yarn seedcreatesdatabase.sqlite, its tables and the demo data. Running it again adds only what is missing.Terminalinback-endyarn seedStart the server
Terminalinback-endyarn devExpected result: localhost:8000/api/healthLocal answers
Having trouble?{"status":"ok"}.
Start the API
Install and configure
.env.exampleworks as it is for local development.Having trouble?Terminalcorepack enable cd kinora-fitness-backend yarn install cp .env.example .envCreate the database
yarn seedcreatesdatabase.sqlite, its tables and the demo data. Running it again adds only what is missing.Terminalinkinora-fitness-backendyarn seedStart the server
Terminalinkinora-fitness-backendyarn devExpected result: localhost:8000/api/healthLocal answers
Having trouble?{"status":"ok"}. The seed printed the accounts to sign in with.
Start the dashboard
In a second terminal:
Install and configure
Terminalcd dashboard yarn install cp .env.example .envPoint it at the API
Open
dashboard/.envand fill in the two API lines, which are empty in the example. Left empty, the dashboard runs on its built-in sample data instead of the API.dashboard/.envNEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api NEXT_PUBLIC_WEBSOCKET_BASE_URL=http://localhost:8000Start it and sign in
Terminalindashboardyarn devExpected result: localhost:3030Local opens the sign-in form, filled in with the Head Coach:
Having trouble?headcoach@example.comwith the passwordCoach@123./en/auth/login?as=clientfills in the member,member@example.comwithMember@123. Arabic is at/ar.
Start the dashboard
The API is not part of this package. Do not create a .env file yet: without one, the dashboard runs on its built-in sample data.
Start it and sign in
Terminalinkinora-fitness-dashboardyarn devExpected result: localhost:3030Local opens the sign-in form with a "Sample data" notice. The password is not checked (the form still asks for at least 6 characters), and what you change is kept in the browser.
When you have the template's API running, create .env from .env.example and set NEXT_PUBLIC_API_BASE_URL to its address. That is what switches the sample data off.
Production build
The same folders, built once and then started. First set back-end/.env for production. With NODE_ENV=production the API never rewrites the schema on its own: it runs the migrations as it starts. It refuses to start while JWT_SECRET is empty or still the example value, or while CORS_ORIGIN is empty.
NODE_ENV=production
JWT_SECRET=<a long random string>
CORS_ORIGIN=http://localhost:3030
FRONTEND_URL=http://localhost:3030Generate the secret with node -e "console.log(require('crypto').randomBytes(48).toString('hex'))". Then build the API, create its tables once, and start it. yarn db:sync:prod creates empty tables; yarn seed:prod in its place, or after it, adds the demo data and its accounts.
back-endyarn build
yarn db:sync:prod
yarn start:prodThen the dashboard, on 3030:
dashboardyarn build
yarn startThe dashboard compiles its .env in at build time, so run yarn build again after changing it. Before you deploy anywhere public, read the production checklist.
Production build
Built once, then started. First set .env for production. With NODE_ENV=production the API never rewrites the schema on its own: it runs the migrations as it starts. It refuses to start while JWT_SECRET is empty or still the example value, or while CORS_ORIGIN is empty.
NODE_ENV=production
JWT_SECRET=<a long random string>
CORS_ORIGIN=https://app.your-domain.comGenerate the secret with node -e "console.log(require('crypto').randomBytes(48).toString('hex'))". CORS_ORIGIN lists the addresses of the dashboards that call the API, comma separated. Then build, create the tables once, and start. yarn db:sync:prod creates empty tables; yarn seed:prod in its place, or after it, adds the demo data and its accounts.
kinora-fitness-backendyarn build
yarn db:sync:prod
yarn start:prodProduction build
Built once, then started on 3030. With no .env the production build runs on the sample data exactly as yarn dev does.
kinora-fitness-dashboardyarn build
yarn startThe dashboard compiles its .env in at build time, so run yarn build again after changing it.
Start over with fresh demo data
Stop the API, then delete the database file and seed it again, in the API's folder. This deletes everything you created.
rm -f database.sqlite* && yarn seedIn PowerShell:
Remove-Item database.sqlite*; yarn seed