client/public/logo.png
A modern, full-stack web application for managing teachers, students, and educational records with role-based access control and comprehensive administrative features.
- Multi-Role Authentication: Users, Teachers, and Admins
- Email Verification: Secure account creation with email verification
- Password Reset: OTP-based password reset system (15 min expiry)
- Session Management: Auto-logout after inactivity (30 min for users, 15 min for admins)
- Profile Settings: Update profile information and change passwords
- CSV Upload: Bulk import student data via CSV files
- Record Management: View, edit, and delete student records
- Search & Filter: Advanced filtering and search capabilities
- Data Export: Export records in various formats
- Form Submission: Submit and manage educational forms
- Form Data Management: Track and edit submitted forms
- Teacher Logs: Activity tracking and logging system
- Dashboard: Personalized teacher dashboard
- Admin Dashboard: Comprehensive overview of system metrics
- User Management: Manage teachers and user accounts
- Records Overview: Access to all system records
- Teacher Log Monitoring: Track teacher activities
- Admin Settings: System configuration and management
- Separate Admin Authentication: Dedicated admin login system
- Gradient Theme: Beautiful indigo β purple β pink gradient design
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Smooth Animations: Framer Motion animations throughout
- Toast Notifications: Real-time user feedback with react-hot-toast
- Header Navigation: Clean, intuitive navigation system
- React 18 - Modern UI library
- Vite - Fast build tool and dev server
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Animation library
- Zustand - State management
- Axios - HTTP client
- React Hot Toast - Notifications
- Lucide React - Icon library
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB ODM
- JWT - Authentication tokens
- bcryptjs - Password hashing
- Nodemailer - Email sending
- Cookie Parser - Cookie handling
- CORS - Cross-origin resource sharing
TMS/
βββ client/ # Frontend React application
β βββ public/ # Static assets
β βββ src/
β β βββ assets/ # Images, icons
β β βββ components/ # React components
β β β βββ admin/ # Admin-specific components
β β β βββ common/ # Shared components (Header, etc.)
β β β βββ editing/ # Edit functionality components
β β β βββ form/ # Form components
β β β βββ landing/ # Landing page components
β β β βββ login/ # Authentication components
β β β βββ records/ # Record management components
β β β βββ settings/ # Settings components
β β β βββ student/ # Student-related components
β β β βββ teacher/ # Teacher-specific components
β β β βββ teacherlog/ # Teacher log components
β β βββ hooks/ # Custom React hooks
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ store/ # Zustand state stores
β β β βββ authStore.js # User authentication
β β β βββ adminAuthStore.js # Admin authentication
β β β βββ studentStore.js # Student data
β β βββ styles/ # Global styles
β β βββ utils/ # Utility functions
β β βββ App.jsx # Main App component
β β βββ main.jsx # Entry point
β βββ index.html
β βββ package.json
β βββ postcss.config.js
β βββ tailwind.config.js
β βββ vite.config.js
β
βββ server/ # Backend Node.js application
β βββ config/ # Configuration files
β βββ controllers/ # Route controllers
β β βββ auth.controller.js
β β βββ EditingStudentController.js
β β βββ from.controller.js
β β βββ student.controller.js
β β βββ user.controller.js
β β βββ userActivity.controller.js
β βββ db/ # Database connection
β β βββ connectDB.js
β βββ email/ # Email templates and configuration
β β βββ email.config.js
β β βββ emails.js
β β βββ emailTemplates.js
β β βββ testEmail.js
β βββ middleware/ # Express middleware
β β βββ authMiddleware.js
β β βββ uploadMiddleware.js
β β βββ verifyToken.js
β βββ models/ # Mongoose models
β β βββ EditingStudent.model.js
β β βββ form.models.js
β β βββ Student.model.js
β β βββ user.model.js
β β βββ userActivity.model.js
β βββ routes/ # API routes
β β βββ admin.auth.route.js
β β βββ auth.route.js
β β βββ EditingStudentRoutes.js
β β βββ formRoutes.js
β β βββ passwordReset.js
β β βββ studentRoutes.js
β β βββ user.route.js
β β βββ user.routes.js
β β βββ userActivity.routes.js
β βββ scripts/ # Utility scripts
β β βββ createAdmin.js
β β βββ findAdmins.js
β β βββ makeAdmin.js
β β βββ resetAdminPassword.js
β β βββ setupBackupAdmin.js
β βββ services/ # Business logic services
β βββ Student/ # Student-related utilities
β βββ uploads/ # File upload directory
β βββ utils/ # Utility functions
β β βββ generateTokenAndSetCookie.js
β βββ index.js # Server entry point
β βββ package.json
β
βββ student_data.csv # Sample CSV data
βββ docker-compose.yaml # Docker Compose configuration
βββ .gitignore
βββ package.json
βββ README.md
- Ensure Docker and Docker Compose are installed.
- Run the application:
docker-compose up --build
- Access the application:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5000 - MongoDB:
mongodb://localhost:27017
- Frontend:
- Node.js (v18 or higher) or Bun
- MongoDB (local or MongoDB Atlas)
- npm, yarn, or bun
git clone https://github.com/your-username/TMS.git
cd TMS# Navigate to server directory
cd server
# Install dependencies
bun install
# or
npm install
# Create .env file
cp .env.example .env
# Edit .env file with your configuration
# For Docker, this is handled automaticallyRequired Environment Variables:
# MongoDB
MONGODB_URI=mongodb://127.0.0.1:27017/TMS
# Server
PORT=5000
NODE_ENV=development
# JWT Secret
JWT_SECRET=your_super_secret_jwt_key_here
# Frontend URL
FRONTEND_URL=http://localhost:5173
# Email Configuration (Gmail SMTP)
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-app-specific-password
EMAIL_FROM=TMS <your-email@gmail.com>
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_SECURE=true# Navigate to client directory
cd ../client
# Install dependencies
bun install
# or
npm install
# Start development server
bun run dev
# or
npm run devTerminal 1 - Backend:
cd server
bun run devTerminal 2 - Frontend:
cd client
bun run devcd server
node scripts/setupBackupAdmin.jsDefault Admin Credentials:
- Email:
backupid849@gmail.com - Password:
BackupAdmin@123
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /signup |
Register new user | Public |
| POST | /login |
User login | Public |
| POST | /logout |
User logout | Private |
| POST | /verify-email |
Verify email with code | Public |
| POST | /forgot-password |
Request password reset OTP | Public |
| POST | /reset-password |
Reset password with OTP | Public |
| POST | /change-password |
Change password | Private |
| GET | /check-auth |
Verify authentication | Private |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /login |
Admin login | Public |
| POST | /logout |
Admin logout | Private |
| GET | /check-auth |
Verify admin authentication | Private |
| POST | /admin/forgot-password |
Admin password reset OTP | Public |
| POST | /admin/reset-password-otp |
Reset admin password | Public |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | / |
Get all students | Private |
| POST | / |
Create new student | Private |
| PUT | /:id |
Update student | Private |
| DELETE | /:id |
Delete student | Private |
| POST | /upload |
Upload CSV file | Private |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | / |
Get all forms | Private |
| POST | / |
Create new form | Private |
| PUT | /:id |
Update form | Private |
| DELETE | /:id |
Delete form | Private |
| Method | Endpoint | Description | Access |
|---|---|---|---|
| GET | / |
Get user activities | Admin |
| POST | / |
Log user activity | Private |
/* Primary Gradient */
--gradient-primary: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #ec4899 100%);
/* Background Gradient */
--gradient-bg: linear-gradient(to bottom right,
rgb(238 242 255), rgb(243 232 255), rgb(252 231 243));
/* Text Colors */
--text-primary: #111827;
--text-secondary: #6b7280;
--text-light: #9ca3af;
/* Status Colors */
--success: #10b981;
--error: #ef4444;
--warning: #f59e0b;
--info: #3b82f6;- Font Family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif
- Headings: Bold, gradient text
- Body: Regular, dark gray
- Buttons: Gradient background with hover effects
- Inputs: Bordered with icons
- Cards: White background with shadow
- Modals: Centered with backdrop
- Toast: Top-right notifications
1. User submits email, password, name
2. Server validates input
3. Password hashed with bcryptjs
4. Verification code generated (6-digit)
5. Verification email sent
6. User record created (isVerified: false)
7. JWT token set in cookie
8. Redirect to verification page
1. User receives 6-digit code via email
2. User enters code on verification page
3. Server validates code
4. User.isVerified set to true
5. Welcome email sent
6. Redirect to dashboard
1. User enters email on forgot password page
2. Server generates 6-digit OTP
3. OTP saved with 15-minute expiry
4. OTP sent via email
5. User enters OTP and new password
6. Server validates OTP and expiry
7. Password updated
8. Success email sent
9. Redirect to login
1. JWT token stored in httpOnly cookie
2. Token verified on protected routes
3. Auto-logout after inactivity:
- Regular users: 30 minutes
- Admin users: 15 minutes
4. Activity tracking resets timeout
5. Manual logout clears cookie and session
- Verification Email - Account email verification
- Welcome Email - Sent after successful verification
- Password Reset OTP - Password reset with OTP code
- Admin Password Reset OTP - Admin-specific password reset
- Reset Success - Password reset confirmation
- Provider: Gmail SMTP
- Port: 465 (SSL)
- Host: smtp.gmail.com
- From: TMS System
- Beautiful gradient-themed HTML templates
- Responsive design
- Security warnings
- Expiration notices
- Support contact information
- β JWT-based authentication
- β httpOnly cookies (prevents XSS)
- β Password hashing (bcryptjs)
- β Email verification required
- β OTP-based password reset (15 min expiry)
- β Separate admin authentication
- β Role-based access control (User, Teacher, Admin)
- β Protected routes with middleware
- β Admin-only endpoints
- β Token verification on each request
- β Auto-logout on inactivity
- β Session timeout (30 min users, 15 min admins)
- β Activity tracking
- β Secure cookie settings
- β Input validation
- β SQL injection prevention (Mongoose)
- β XSS protection
- β CORS configuration
- β Environment variables for secrets
/- Landing Page/login- User Login/signup- User Registration/verify-email- Email Verification/forgot-password- Request Password Reset/reset-password- Reset Password with OTP/admin-login- Admin Login/admin/forgot-password- Admin Password Reset Request/admin/reset-password-otp- Admin Password Reset with OTP
/settings- User Settings & Profile/upload- Upload Student Data (CSV)/form-data- View Form Submissions/from- Submit New Form/records- View Student Records
/admin/dashboard- Admin Dashboard/admin/records- All Student Records/admin/teacher-log- Teacher Activity Logs/admin/settings- Admin Settings
# Backend tests
cd server
npm test
# Frontend tests
cd client
npm test- User registration with email verification
- User login with valid credentials
- Password reset with OTP
- Admin login
- Session timeout (30 min for users, 15 min for admins)
- Auto-logout on inactivity
- Upload CSV file
- View student records
- Edit student record
- Delete student record
- Search and filter students
- Submit new form
- View submitted forms
- Edit form data
- Delete form
- Access admin dashboard
- View all records
- Monitor teacher logs
- Admin settings management
Option 1: Heroku
# Login to Heroku
heroku login
# Create app
heroku create tms-backend
# Set environment variables
heroku config:set MONGODB_URI=your_mongodb_uri
heroku config:set JWT_SECRET=your_jwt_secret
# ... set other env variables
# Deploy
git push heroku mainOption 2: DigitalOcean/AWS/Azure
- Set up Node.js server
- Install PM2 for process management
- Configure Nginx reverse proxy
- Set up SSL certificate
- Deploy code and run with PM2
Option 1: Vercel
# Install Vercel CLI
npm i -g vercel
# Deploy
cd client
vercelOption 2: Netlify
- Build the project:
npm run build - Drag and drop
distfolder to Netlify - Configure environment variables
- Use MongoDB Atlas for cloud database
- Or set up MongoDB on your server
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Use ES6+ syntax
- Follow Airbnb style guide
- Write meaningful commit messages
- Add comments for complex logic
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work - GitHub Profile
- React team for the amazing framework
- Tailwind CSS for the utility-first CSS
- Framer Motion for smooth animations
- MongoDB for the flexible database
- Express.js for the robust backend framework
- All contributors and testers
For support, email backupid849@gmail.com or open an issue in the GitHub repository.
Current Version: 1.0.0
Status: β Production Ready
- β Header navigation system implemented
- β Email templates with gradient theme
- β OTP-based password reset (users & admins)
- β Session timeout feature (30 min users, 15 min admins)
- β Activity tracking for session management
- β Admin authentication system
- β Admin settings page
- β Separate admin and user flows
- Two-factor authentication
- Advanced analytics dashboard
- Export to PDF functionality
- Bulk user management
- Email notification preferences
- Dark mode support
- Mobile app (React Native)