A simple RFID + manual attendance system with a Node.js backend, Next.js frontend, and Neon PostgreSQL.
- backend/ - Express API + Neon connection
- frontend/ - Next.js web app (App Router)
- esp8266/ - RFID firmware for NodeMCU + RC522
This project is configured for Neon project empty-block-57591024 (org org-silent-darkness-01000100).
- Open the SQL editor in Neon and run the schema file:
- backend/src/db/schema.sql
- Keep credentials out of Git and rotate passwords when needed.
- Install dependencies:
- npm install
- Update backend/.env with your own values:
- DATABASE_URL
- JWT_SECRET
- PORT
- Start the API:
- npm run dev
Endpoints:
- POST /auth/register
- POST /auth/login
- POST /classes
- GET /classes
- GET /classes/:id
- POST /classes/:id/students
- GET /classes/:id/students
- PUT /students/:id
- DELETE /students/:id
- POST /attendance/rfid
- POST /attendance/manual
- GET /attendance?class_id=&date=
- Install dependencies:
- npm install
- Create frontend/.env.local with:
- NEXT_PUBLIC_API_BASE_URL=http://localhost:4000
- Start the web app:
- npm run dev
- Open esp8266/config.h and set:
- WIFI_SSID
- WIFI_PASSWORD
- BACKEND_URL
- CLASS_ID
- Flash esp8266/rfid_attendance.ino
- RFID endpoint is open by design. No device auth or API keys.
- Manual attendance uses authenticated API calls.
- Duplicate taps are ignored.