Attendance and workforce management platform with Next.js frontend, Express TypeScript backend, Prisma, and PostgreSQL/Supabase.
frontend: Next.js app (port 3000 in local dev)backend: Express API + Prisma (port 3001 in local dev)test-apis.sh: one-click core API smoke tests (attendance, shift, audit)
- Node.js 22.x
- npm
- PostgreSQL or Supabase project
- Optional: Docker + Docker Compose
- Install dependencies.
npm install cd backend && npm install cd ../frontend && npm install
- Configure environment variables.
- Create
backend/.envwith database and Supabase values - Create
frontend/.env.localwithNEXT_PUBLIC_API_URL=http://localhost:3001
- Generate Prisma client and run migrations.
cd backend
npx prisma generate
npx prisma migrate dev- Start apps in separate terminals.
cd backend && npm run dev cd frontend && npm run dev
docker-compose up -d --build docker-compose logs -f
Typical access:
- Frontend:
http://localhost - API:
http://localhost:3000 - Swagger:
http://localhost:3000/api-docs
From repository root:
npm run test:core-apis
Backend:
cd backend npm test npm run test:coverage
Frontend:
cd frontend npm test npm run test:coverage
Format all files:
npm run format
Backend lint/type-check:
cd backend
npm run lintReset and reseed backend DB:
cd backend
npx prisma migrate reset --force
npm run seedSchema sync (team-safe path after recent destructive schema updates):
cd backend ./scripts/db-sync-for-team.sh local
Docker stack sync (API on port 3001):
cd backend ./scripts/db-sync-for-team.sh docker cd .. BASE=http://localhost:3001/api bash ./test-apis.sh
- Backend guide:
backend/README.md - Frontend guide:
frontend/README.md - API docs (runtime):
/api-docs
cd backend npm test # Run all tests npm run test:watch # Watch mode npm run test:coverage # Coverage report
cd frontend npm test # Run all tests npm run test:watch # Watch mode npm run test:coverage # Coverage report
**In Docker:**
```bash
docker exec -it easycheck-backend npm test
docker exec -it easycheck-frontend npm test
docker-compose restart backend docker-compose restart frontend
# หา process ที่ใช้ port lsof -i :3000 lsof -i :80 # Kill process kill -9 <PID>
# Restart postgres docker-compose restart postgres # Check postgres logs docker-compose logs postgres # Reset database (⚠️ ลบข้อมูล) docker-compose down -v docker-compose up -d
docker exec -it easycheck-backend npx prisma generate
docker-compose restart backend- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'feat: add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License.
Made with ❤️ by EasyCheck Team
มีปัญหาหรือข้อสงสัย?
- 📖 อ่าน Backend README หรือ Frontend README
- 💬 ถาม ใน Discord server
- 🐛 สร้าง Issue บน GitHub