Prerequisites
Before you begin, make sure you have the following installed:- Node.js 20 or higher
- PostgreSQL 16
- npm (comes with Node.js)
- Git
Setup steps
Configure environment variables
Copy the example environment file and fill in your values:Open
.env and set the following variables:.env
Create the database and run migrations
First, create the PostgreSQL database:Then run the migrations to create all tables:This runs all migration files in the
src/database/migrations/ directory, creating the users, tasks, challenges, and related tables.Start the development server
http://localhost:3000. You should see output indicating the server is listening.Available npm scripts
| Script | Command | Description |
|---|---|---|
dev | npm run dev | Start development server with nodemon + ts-node |
build | npm run build | Compile TypeScript to dist/ |
start | npm start | Run compiled server from dist/ |
migrate:dev | npm run migrate:dev | Run migrations using ts-node (development) |
migrate | npm run migrate | Run migrations from compiled dist/ (production) |
Next steps
Authentication
Learn how to use your JWT token to access protected endpoints.
API Reference
Explore the full API documentation for all endpoints.
Gamification
Understand how points and streaks work.
Configuration
Full reference for all environment variables.