Lightweight school management backend and frontend built with Node.js (Express + TypeScript) and React (Vite). This repository includes Dockerfiles and convenience scripts for local development and production deployments (Render for backend, Vercel for frontend).
Contents
- Backend: backend — Express + TypeScript API, MongoDB client, seeds
- Frontend: frontend — React + Vite SPA
- Deployment docs: DEPLOYMENT.md
Features
- User authentication (JWT)
- Student/teacher/class management
- Attendance, grades, schedules, announcements, events
- Seed data for quick local development
Prerequisites:
- Node.js (>=18 recommended)
- npm
- MongoDB (local or Atlas)
Backend (local):
- Install and build
cd backend
npm install
npm run build- Configure environment variables
Copy the example and edit secrets (do NOT commit real secrets):
cp backend/.env.production.example backend/.env
# Edit backend/.env and set MONGO_URI, MONGO_DB_NAME, JWT_SECRET, CORS_ORIGIN- Run
npm run start:prod
# or: node dist/index.jsFrontend (local):
cd frontend
npm install
npm run devThe frontend reads VITE_API_BASE for the API base URL. See frontend/.env and set VITE_API_BASE for production to the deployed backend URL.
This project contains Dockerfiles for backend and frontend and a docker-compose.yml for local multi-container runs.
docker compose build
docker compose up -dBackend seed (optional):
docker compose run --rm backend npm run seedBackend (Render)
- Root directory:
backend - Build command:
npm install && npm run build - Start command:
npm run start:prod - Environment variables (set in Render service settings):
MONGO_URI,MONGO_DB_NAME,JWT_SECRET,CORS_ORIGIN - Use
backend/scripts/test-mongo.jsfor connectivity testing on the host environment.
Frontend (Vercel)
- Project root:
frontend - Build command:
npm install && npm run build - Output directory:
dist - Set
VITE_API_BASEin Vercel Environment tohttps://<your-backend>/api(example:https://school-management-systems-18w4.onrender.com/api). - A
frontend/vercel.jsonfile is included to ensure static-build output and client-side routing fallback.
Demo access
- Live demo frontend: https://school-management-systems-ebon.vercel.app
- Live demo backend: https://school-management-systems-18w4.onrender.com
- To use the demo accounts from the frontend landing page, open the login page and use the Autofill buttons. Demo names are localized to Ethiopian names for presentation; underlying credentials (seeded emails/passwords) are:
- Admin (Bekele Tesfaye):
bekele.tesfaye@school.et/admin123 - Teacher (Almaz Kebede):
almaz.kebede@school.et/teacher123 - Student (Amanuel Bekele):
amanuel.bekele@student.school.et/student123
- Admin (Bekele Tesfaye):
See the full deployment guide: DEPLOYMENT.md
- The backend supports configuring allowed origins via
CORS_ORIGIN(comma-separated). Ensure your deployed frontend origin (e.g.,https://school-management-systems-ebon.vercel.app) is listed. - If using MongoDB Atlas, ensure the cluster IP access list allows connections from Render (or configure private networking / VPC peering). Temporary 0.0.0.0/0 is for short testing only.
- Never commit real credentials to the repo. Use
.env.production.exampleas a template and set real secrets in the host environment (Render/Vercel). - Rotate any credentials accidentally committed to a public repo.
- Connectivity test:
node backend/scripts/test-mongo.js(useful in deploy shell) - Seed data:
npm run seed(backend)
- Bug reports and PRs welcome — fork the repo and open a PR.
- MIT