This is the FocusPlan's API.
- Node.js
- Docker & Docker Compose
WARNING: If you are using Windows, some of these commands won't work.
- Install all dependencies
npm i- Configure environment variables
The backend requires environment variables to run. There are two types:
- Local development: Use
.env.localbased on.env.local.example.
cp .env.local.example .env.localFill in the values for your local environment, for example:
FRONTEND_URL=http://localhost:3000
DATABASE_URL=postgresql://usuario:senha@localhost:5432/focusplan_local
JWT_SECRET=uma_chave_jwt_forte
REFRESH_SECRET=uma_chave_refresh_forte
MAILTRAP_USER=usuario_mailtrap
MAILTRAP_PASS=senha_mailtrap
SENDER_EMAIL=no-reply@focusplan.comNotes:
.env.local is for development only and does not affect production.
.env (production) contains real credentials and should never be pushed to a public repository.
Production: The .env file should be set in the deployment environment (Render, Railway, etc.) and not included in the GitHub repository.
- Start Docker containers
docker compose up -d- Run database migrations
npx prisma migrate dev- Start the development server
npm run devThe project includes Docker configuration for easy deployment:
# Build and run containers
docker compose up --build
# Run in background
docker compose up -d
# Stop containers
docker compose down