Installation
ASAP can be deployed in multiple ways depending on your needs. Choose the method that works best for you.
Prerequisites
- Docker & Docker Compose (recommended)
- Node.js 18+ and PostgreSQL 14+ (for manual installation)
Method 1: Docker Compose (Recommended)
All deployment files live in the deploy/ directory. Two compose files are provided — one that spins up a PostgreSQL container for you, and one for connecting to a database you already have running.
TIP
Generate a secure JWT secret with: openssl rand -base64 32
Step 1: Create a directory on your homelab and enter it
mkdir asap && cd asapStep 2: Download the compose file and its matching env file
Option A — let Docker manage the database:
curl -O https://raw.githubusercontent.com/asap-open/ASAP/refs/heads/main/deploy/compose.with-db.yaml
curl -O https://raw.githubusercontent.com/asap-open/ASAP/refs/heads/main/deploy/.env.with-dbOption B — bring your own database:
curl -O https://raw.githubusercontent.com/asap-open/ASAP/refs/heads/main/deploy/compose.external-db.yaml
curl -O https://raw.githubusercontent.com/asap-open/ASAP/refs/heads/main/deploy/.env.external-dbStep 3: Copy the env file to .env and fill in your values
# Option A
cp .env.with-db .env
# Option B
cp .env.external-db .envOpen .env in your editor and update at minimum JWT_SECRET, DOMAIN_NAME, and (for Option B) DATABASE_URL.
Step 4: Start the stack
# Option A
docker compose -f compose.with-db.yaml up -d
# Option B
docker compose -f compose.external-db.yaml up -dStep 5: Access ASAP
Open your browser and navigate to:
- Frontend: http://localhost
- Backend API: http://localhost:3000
Step 6: Create Your Account
- Click "Sign Up" on the homepage
- Enter your details (username, email, password, full name)
- Start tracking your workouts!
Method 2: Docker (Separate Containers)
Run PostgreSQL
docker run -d \
--name asap-db \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=asap \
-p 5432:5432 \
postgres:16-alpineRun Backend
docker run -d \
--name asap-server \
--link asap-db:db \
-e DATABASE_URL="postgresql://postgres:postgres@db:5432/asap" \
-e JWT_SECRET="your-jwt-secret" \
-e PORT=3000 \
-p 3000:3000 \
sarthakg0yal/asap-serverRun Frontend
docker run -d \
--name asap-client \
-e BACKEND_SERVER_URL="<BACKEND_URL>"
-p 80:80 \
sarthakg0yal/asap-clientMethod 3: Manual Installation (Development)
For development or if you prefer not to use Docker:
Step 1: Clone and Install Dependencies
# Clone repository
git clone https://github.com/yourusername/asap.git
cd asap
# Install server dependencies (also runs prisma generate via postinstall)
cd server
yarn install
# Install client dependencies
cd ../client
yarn installStep 2: Setup PostgreSQL
Install PostgreSQL and create a database:
createdb asapStep 3: Configure Server Environment
Create server/.env:
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/asap"
JWT_SECRET="your-jwt-secret"
TOKEN_EXP="7d"
PORT=3000
NODE_ENV=development
FRONTEND_DOMAIN="http://localhost:5173"| Variable | Required | Description |
|---|---|---|
DATABASE_URL | ✅ | PostgreSQL connection string |
JWT_SECRET | ✅ | Secret for signing JWTs — use a long random string |
TOKEN_EXP | ✅ | Token lifetime (e.g. 7d, 24h, 60m) |
PORT | ✅ | Port the API server listens on |
NODE_ENV | ✅ | Set to development |
FRONTEND_DOMAIN | ✅ | Client origin allowed by CORS (Vite dev = :5173) |
TIP
Generate a secure JWT secret with: openssl rand -base64 32
Step 4: Configure Client Environment
Create client/.env:
BACKEND_SERVER_URL="http://localhost:3000"
DOMAIN_NAME="localhost"| Variable | Required | Description |
|---|---|---|
BACKEND_SERVER_URL | ✅ | URL of the API server — used by Vite's dev proxy |
DOMAIN_NAME | Public hostname — used for HMR and allowedHosts, optional locally |
Step 5: Run Database Migrations
cd server
npx prisma migrate devNote:
prisma generateruns automatically as part ofyarn install(via thepostinstallhook). If you ever update the schema manually, re-runnpx prisma generateto rebuild the client.
Step 6: Seed Initial Data (Optional)
cd server
npx prisma db seedStep 7: Start Development Servers
In one terminal (backend):
cd server
yarn run devIn another terminal (frontend):
cd client
yarn run devAccess the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000/api
Troubleshooting
Database Connection Issues
If you see database connection errors:
# Check if PostgreSQL is running
docker ps | grep postgres
# View database logs
docker logs asap-dbPort Already in Use
If ports 3000 or 5173 are already in use:
# Change ports in docker-compose.yaml or .env files
# Backend port: modify PORT in .env
# Frontend port: modify docker-compose.yaml ports sectionMigration Failures
If database migrations fail:
# Reset database (warning: deletes all data)
cd server
npx prisma migrate reset
# Or manually run migrations
npx prisma migrate deployNext Steps
Need Help?
Open an issue on GitHub or check the troubleshooting guide.
