Clone the repository:
git clone https://github.com/wajeht/close-powerlifting.git
cd close-powerliftingCopy environment variables:
cp .env.example .envInstall dependencies:
npm install| Variable | Description | Required |
|---|---|---|
APP_PORT |
Server port (default: 80) | Yes |
APP_ENV |
Environment: development, production, testing |
Yes |
APP_DOMAIN |
Public domain URL | Yes |
APP_ADMIN_EMAIL |
Admin user email | Yes |
APP_JWT_SECRET |
Secret for JWT signing | Yes |
SESSION_SECRET |
Secret for session encryption | Yes |
SESSION_NAME |
Session cookie name | Yes |
SESSION_DOMAIN |
Cookie domain (without protocol) | Yes |
GOOGLE_CLIENT_ID |
Google OAuth client ID | No |
GOOGLE_CLIENT_SECRET |
Google OAuth secret | No |
EMAIL_HOST |
SMTP host | Yes |
EMAIL_PORT |
SMTP port | Yes |
EMAIL_FROM |
From address for emails | Yes |
Run the development server with Tailwind watch:
npm run devRun only the API server (no Tailwind rebuild):
npm run dev:onlyFor email testing locally, run Mailpit in a separate terminal:
docker run -p 8025:8025 -p 1025:1025 axllent/mailpitThen access the Mailpit UI at http://localhost:8025
Run everything in containers (app + Mailpit):
docker compose -f docker-compose.dev.yml upAccess:
- App: http://localhost:80
- Mailpit UI: http://localhost:8025
The app uses SQLite. The database file is auto-created on first run.
Prepare database (migrate + seed):
npm run db:prepare:devRun migrations only:
npm run db:migrate:latestRollback migrations:
npm run db:migrate:rollbackCreate a new migration:
npm run db:migrate:make -- <migration-name>Run seeds:
npm run db:seed:runRun all tests:
npm testRun tests in watch mode:
npm run test:watchRun a single test file:
APP_ENV=testing NODE_ENV=testing NODE_NO_WARNINGS=1 npx vitest --run src/path/to/test.tsRun tests with coverage:
npm run test:coverageUpdate test fixtures from live API:
npm run update:fixturesFormat code (oxfmt):
npm run formatCheck formatting:
npm run format:checkLint code (oxlint):
npm run lintCheck linting:
npm run lint:checkBuild for production (compiles TypeScript + minifies Tailwind):
npm run buildStart production server:
npm run startPort 80 permission denied: Use a higher port like 3000 in .env, or run with sudo.
Node version mismatch: Use fnm or nvm to switch to Node 24+:
fnm use 24
# or
nvm use 24Database locked errors: Stop all running instances and try again.
Email not sending: Ensure Mailpit is running (Docker or standalone) and EMAIL_HOST=localhost in .env for local dev.