Local Development & Developer Environment Setup
Local Development & Developer Environment Setup
This guide details how software engineers and school technical teams can run YeneSchool in a local development environment with instant hot-reloading and debug tooling.
1. Quick Start with Docker Dev Stack
The fastest path to a running development environment is docker-compose.dev.yml. It boots isolated dev volumes so you never mix dev and production databases:
# Clone the repository
git clone https://github.com/your-org/YeneSchool-School-Management-System.git
cd YeneSchool-School-Management-System
# Start dev stack with live file mounting and hot reload
docker compose -f docker-compose.dev.yml up --build
Once booting completes:
- Frontend App: Accessible at
http://localhost:8000(live hot reload on edit). - Backend API: Accessible at
http://localhost:8001(NestJS watcher). - Swagger API Docs: Accessible at
http://localhost:8001/api/docs. - PostgreSQL: Bound to host port
5433(username:lemari, database:lemarisms).
2. Manual Setup (Without Docker for Node Services)
If you prefer running Node services directly on your host machine while running PostgreSQL and Redis in Docker:
Step 1: Start Database & Redis
docker compose -f docker-compose.dev.yml up -d postgres redis
Step 2: Configure & Start Backend
cd backend
npm install
# Copy development environment config
cp .env.example .env
# Run Prisma database migrations
npx prisma migrate dev
# Seed test schools, demo students, and staff accounts
npx prisma db seed
# Start NestJS development server with watch mode
npm run start:dev
The backend API is now running at http://localhost:8001.
Step 3: Configure & Start Frontend
cd ../frontend
npm install
# Copy local frontend environment config
cp .env.local.example .env.local
# Start Next.js development server
npm run dev
The frontend is now running at http://localhost:8000.
3. Useful Developer Commands
| Task | Command | Directory |
|---|---|---|
| Prisma Visual GUI | npx prisma studio | backend/ |
| Create DB Migration | npx prisma migrate dev --name <migration_name> | backend/ |
| Re-seed Database | npx prisma db seed | backend/ |
| Run Backend Unit Tests | npm run test | backend/ |
| Run E2E Security Tests | bash test/security/run-all.sh | backend/ |
| Format & Lint Code | npm run lint | frontend/ & backend/ |
Production Docker Runbook
Step-by-step runbook for deploying YeneSchool in production using Docker Compose — secrets setup, database migrations, and Nginx SSL configuration.
Backups & Disaster Recovery
Automated PostgreSQL snapshot backups, Docker persistent volume preservation, disaster recovery procedures, and database restoration verification.