Skip to content

FocusPlan-dsw/API-FocusPlan

Repository files navigation

API-FocusPlan

This is the FocusPlan's API.

Prerequisites

  • Node.js
  • Docker & Docker Compose

WARNING: If you are using Windows, some of these commands won't work.

How to start the project

  1. Install all dependencies
npm i
  1. Configure environment variables

The backend requires environment variables to run. There are two types:

  1. Local development: Use .env.local based on .env.local.example.
cp .env.local.example .env.local

Fill 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.com

Notes:

.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.

  1. Start Docker containers
docker compose up -d
  1. Run database migrations
npx prisma migrate dev
  1. Start the development server
npm run dev

Docker

The 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •