This repository is organized for easy deployment:
client/→ React + Vite frontendserver/→ Node.js + Express API
Backend API is modular and beginner-friendly:
server/controllers/for business logicserver/routes/for endpoint mappingserver/middelware/for auth and error handlingserver/model/for Mongoose models
Copy from server/.env.example:
PORT=5000
DB_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:5173Copy from client/.env.example:
VITE_API_URL=http://localhost:5000Only frontend API base URL is required on client side.
cd server
npm install
npm run devBackend runs on PORT from env.
cd client
npm install
npm run devVite proxy is enabled for /api during local development.
cd client
npm run build- Create a new Web Service from this GitHub repo.
- Root directory:
server - Build command:
npm install - Start command:
npm start - Add env vars from
server/.env.example. - Deploy and copy the Render backend URL.
- Import this repo into Vercel.
- Keep root deploy config from
vercel.json. - Add env var:
VITE_API_URL=https://your-render-backend-url
- Redeploy frontend.
After setting VITE_API_URL, frontend API calls will use deployed backend.
A Full-Stack Student Attendance Management System built with the MERN stack.
It enables teachers to manage students, track attendance, and enforce role-based access control with a modern, responsive UI.
Use the following credentials to explore the application:
- ID:
t001 - Password:
abc@123
- ID:
std_1 - Password:
linus@123
These demo accounts are provided only for testing purposes.
- Built with MERN Stack (MongoDB, Express.js, React, Node.js)
- Secured with bcrypt for password hashing & JWT for authentication
- Input validation handled using express-validator
- Styled with Tailwind CSS for responsive and modern UI design
- Version controlled with Git & GitHub for collaboration and source management
This project follows a professional-grade CI/CD pipeline:
flowchart LR
A[Commit to GitHub] --> B[GitHub Actions]
B --> C[Build Docker Image]
C --> D[Push to Docker Hub]
D --> E[Render Webhook]
E --> F[Render Backend Deploy]
A --> G[Netlify Build & Deploy]
G --> H[Frontend Live]
Flow
- Commit pushed → GitHub Actions runs
- Backend: Docker image built → pushed to Docker Hub → Render auto-deploys via webhook
- Frontend: Netlify auto-builds & deploys React app
Environment Variables
Both frontend (Netlify) and backend (Render) use environment variables for sensitive data (MongoDB URI, JWT secrets, API keys).
➡️ No secrets are exposed in the codebase.
Tech Stack
- Frontend: React, Tailwind CSS, React Router DOM
- Backend: Node.js, Express.js
- Database: MongoDB + Mongoose
- Authentication: JWT, bcrypt
- Validation & Security: express-validator, sanitization
- Deployment: GitHub Actions, Docker, Docker Hub, Render, Netlify
Features
Teacher
- Add / delete students
- Mark and update attendance
- View student records in a dynamic table
Student
- Secure login
- View personal attendance records
- Track attendance percentage
This project documents my journey of building a Full-Stack Student Management Application step by step, commit by commit.
The app enables teachers to manage attendance and students to view their records securely.
- Bootstrapped the project using Vite for fast frontend development.
- Added
.gitignoreto exclude unnecessary project files.
- Installed @tailwindcss/vite.
- Imported Tailwind into
index.css. - Configured
vite.config.jswith Tailwind plugin.
- Created Login component with role toggle (student/teacher), input fields, and submit button.
- Built Teacher component to display students’ attendance in a table format.
- Faced a challenge: dates were stored in an array, attendance as
{date: status}. - Solved it by mapping dates and matching keys.
- Designed a scrollable table with fixed student info + scrollable attendance.
- Made attendance editable using
<input>. - Used immutable state updates for data consistency.
- Added AddStudent page for teachers.
- Created Student page to view attendance percentage and details.
- Installed React Router DOM.
- Setup navigation routes.
- Implemented attendance percentage calculation.
- Added logout functionality.
- Initialized Express.js server.
- Configured to listen on port 5000.
- Installed CORS for client-server communication.
- Created login API route.
- Used
FormData+ Fetch API for requests.
- Implemented GET API to fetch student data as JSON.
- Displayed attendance in Teacher Dashboard using
useEffect. - Added PUT API for updating attendance immutably.
- Implemented POST API for adding students.
- Converted
FormDatainto objects usingObject.entries().
- Connected Express server to MongoDB (Mongoose).
- Secured DB credentials using
.env.
- Defined Mongoose schema with validation.
- Created Student model.
- Added students to DB using
.save(). - Fetched using
.find().
- Implemented auth for teacher/student.
- Compared entered password with DB.
- Auto-generated IDs (
std_001,std_002). - Used MongoDB
$inccounter.
- Popup after student creation (Add another OR Back).
- Teacher Dashboard fetches live data.
- Updates synced with DB via
findOneAndUpdate().
- Displayed total student count.
- Error alerts for wrong passwords.
- Enabled multi-delete via checkboxes.
- Used
Promise.all()to handle DB deletions.
- Verified student login using DB check.
- Passed student ID via
useNavigate. - Fetched correct student data with
useLocation.
- Integrated bcrypt for password hashing.
- Verified login with hash comparison.
- Implemented JWT tokens.
- Middleware to verify tokens before accessing routes.
- Restricted teacher dashboard to teacher role only.
- Used express-validator (
escape(),trim()). - Sanitized all inputs before DB save.
- Added dark mode.
- Attendance styling:
- ✅ Present → Green
- ❌ Absent → Red
Final Thoughts
This project evolved from a simple CRUD app into a secure, scalable, production-ready MERN application.
It demonstrates:
- Building & securing full-stack apps
- Real-world CI/CD with Docker + GitHub Actions + Render + Netlify
- Strong focus on security, scalability, and clean UI/UX
This project showcases both my technical expertise (MERN stack, DevOps, security) and my ability to deliver a professional-grade deployment pipeline.