TurboVets is a monorepo project built with NestJS, TypeORM, Postgres, Redis, and an Angular dashboard.
This guide will help you set up the development environment quickly.
Make sure you have the following installed:
- Docker (>= 20.10)
- Docker Compose (v2 recommended)
- Node.js (>= 20.x) and npm (>= 10.x) β required only if you want to run commands outside Docker
psqlclient (optional, for inspecting the DB directly)
git clone <your-repo-url>
cd TurboVetscp .env.example .envYou can tweak DATABASE_URL, REDIS_URL, and secrets inside .env.
Start all services (API, DB, Redis, Dashboard):
docker compose -f docker-compose.yml up -d --buildStop all services:
docker compose -f docker-compose.yml down -vCheck logs for the API:
docker compose -f docker-compose.yml logs -f api-devCheck logs for the Dashboard:
docker compose -f docker-compose.yml logs -f dashboard-devYou can run the backend with hot-reload outside Docker while keeping Postgres + Redis in containers.
.env.dev
# DEV
NODE_ENV=development
PORT=3000
JWT_SECRET=change-me-dev
# Postgres
POSTGRES_DB=turbovets
POSTGRES_USER=turbovets
POSTGRES_PASSWORD=turbovets
# Local DB + Redis (via Docker Compose)
DATABASE_URL=postgres://turbovets:turbovets@localhost:5433/turbovets
REDIS_URL=redis://localhost:6380docker compose -f docker-compose.yml up db redis -dnpm installnpx ts-node-dev -r tsconfig-paths/register -P tsconfig.dev.json apps/api/src/main.ts The API will be available at http://localhost:3000.
npm run startThe Angular dev server will be available at http://localhost:4200.
On startup, the api-dev container will automatically run pending migrations.
Generate a new migration after changing entities:
docker compose -f docker-compose.yml exec api-dev \
npx ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js \
migration:generate -d apps/api/src/typeorm.config.ts apps/api/src/migrations/<migration-name>Run migrations:
docker compose -f docker-compose.yml run --rm api-dev \
npx ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js \
migration:run -d apps/api/src/typeorm.config.tsInspect migrations applied:
docker exec -it turbovets_db_dev psql -U turbovets -d turbovets -c "SELECT * FROM migrations;"- API β http://localhost:3001 (Docker) or http://localhost:3000 (Local run)
- Postgres β
localhost:5433(user:turbovets, password:turbovets, db:turbovets) - Redis β
localhost:6380 - Dashboard β http://localhost:4200
From the project root:
npm run test-
Admin
- Email:
[email protected] - Password:
Password123!
- Email:
-
Viewer
- Email:
[email protected] - Password:
Password123!
- Email:
-
Owner
- Email:
[email protected] - Password:
Password123!
- Email:
curl -X POST http://localhost:3001/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "Password123!"}'Expected response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5c..."
}curl http://localhost:3001/tasks \
-H "Authorization: Bearer <access_token_here>"-
Cannot connect to DB? Make sure the container
turbovets_db_devis healthy:docker ps --filter "name=turbovets_db_dev" -
Dashboard shows βCannot GET /β? This usually means the Angular build didnβt complete. Try rebuilding:
docker compose -f docker-compose.yml up -d --build
-
Stuck container? Kill containers with these commands
chmod +x cleanup-containers.sh ./cleanup-containers.sh