A comprehensive web application for managing educational classes, students, attendance, assignments, and grades. Built with Next.js, React, Node.js, and MongoDB.
- Class Management: Create, edit, and remove classes
- Teacher Assignment: Assign teachers to classes
- Student Management: Add, edit, and remove students from classes
- Attendance Tracking: Track student attendance for each class session
- Content Management: Describe class content and attach files
- Assignment System: Create and manage homework, tests, and projects
- Grade Tracking: Track and calculate student grades
- User Authentication: Secure login and registration system
- Next.js 15 - React framework with App Router
- React 18 - UI library
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible UI components
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Authentication tokens
- bcryptjs - Password hashing
# Start both frontend and backend
./start-dev.sh# Install all dependencies
npm run install:all
# Start backend (in one terminal)
npm run backend
# Start frontend (in another terminal)
npm run dev# Deploy to Vercel + Railway + MongoDB Atlas
./deploy.sh- Node.js 18+
- MongoDB (local or cloud instance)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd class-management-app
-
Install frontend dependencies
npm install
-
Install backend dependencies
cd backend npm install cd ..
-
Set up environment variables
cd backend cp .env.example .env # Edit .env with your MongoDB connection string and JWT secret cd ..
-
Start MongoDB
- Local:
mongod - Cloud: Use MongoDB Atlas or similar service
- Local:
-
Start the development servers
npm run dev:full
- Automatically deploys from GitHub
- Configured for Next.js
- Custom domain support
- Free tier available
- Automatic deployments
- Environment variable management
- Free tier available
- Automatic backups
- Global distribution
π See DEPLOYMENT.md for complete deployment guide
class-management-app/
βββ src/ # Frontend source code
β βββ app/ # Next.js app directory
β β βββ page.tsx # Main dashboard
β β βββ layout.tsx # Root layout
β β βββ globals.css # Global styles
β βββ lib/ # Utility libraries
β β βββ api.ts # API client configuration
β βββ components/ # React components
βββ backend/ # Backend API
β βββ src/
β β βββ models/ # MongoDB models
β β βββ routes/ # API routes
β β βββ config/ # Configuration files
β β βββ server.js # Express server
β βββ package.json # Backend dependencies
β βββ .env.example # Environment variables template
βββ package.json # Frontend dependencies
βββ start-dev.sh # Development startup script
βββ deploy.sh # Deployment script
βββ DEPLOYMENT.md # Complete deployment guide
βββ README.md # This file
POST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/users- Get all usersGET /api/users/:id- Get user by IDPUT /api/users/:id- Update userGET /api/users/role/:role- Get users by role
GET /api/classes- Get all classesGET /api/classes/:id- Get class by IDPOST /api/classes- Create new classPUT /api/classes/:id- Update classDELETE /api/classes/:id- Delete classPOST /api/classes/:id/enroll- Enroll studentDELETE /api/classes/:id/enroll/:studentId- Remove student
GET /api/sessions- Get all sessionsGET /api/sessions/:id- Get session by IDPOST /api/sessions- Create new sessionPUT /api/sessions/:id- Update sessionDELETE /api/sessions/:id- Delete sessionPOST /api/sessions/:id/attendance- Record attendanceGET /api/sessions/class/:classId/attendance-summary- Get attendance summary
GET /api/assignments- Get all assignmentsGET /api/assignments/:id- Get assignment by IDPOST /api/assignments- Create new assignmentPUT /api/assignments/:id- Update assignmentDELETE /api/assignments/:id- Delete assignmentPOST /api/assignments/:id/submit- Submit assignmentPUT /api/assignments/:id/grade/:submissionId- Grade submissionGET /api/assignments/class/:classId/grades- Get grades summary
- Basic info (name, email, password)
- Role (teacher, student, admin)
- Authentication fields
- Class details (name, description, subject)
- Teacher assignment
- Student enrollment
- Schedule and academic info
- Individual class meetings
- Attendance records
- Content and materials
- Session notes
- Assignment details (title, description, type)
- Due dates and scoring
- Student submissions
- Grades and feedback
# Development
npm run dev # Start frontend only
npm run backend # Start backend only
npm run dev:full # Start both frontend and backend
npm run install:all # Install all dependencies
# Production
npm run build # Build frontend
npm run start # Start production frontend
npm run lint # Lint code
# Deployment
./deploy.sh # Deploy to production
./start-dev.sh # Start development environmentNEXT_PUBLIC_API_URL=http://localhost:5000MONGODB_URI=mongodb://localhost:27017/class-management
JWT_SECRET=your-secret-key
NODE_ENV=development
FRONTEND_URL=http://localhost:3000- Push to GitHub - triggers Vercel deployment
- Deploy backend to Railway
- Set up MongoDB Atlas database
- Configure environment variables
See DEPLOYMENT.md for step-by-step instructions.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
For questions or issues, please open a GitHub issue or contact the development team.
π― Ready to deploy? Run ./deploy.sh to get started!