A comprehensive Enterprise Resource Planning (ERP) system for educational institutions, built with PostgreSQL, Node.js/Express, and React.
- Student enrollment and profile management
- Course offerings and semester management
- Assignment submission with late detection
- Exam marks and grading system
- Attendance tracking
- Screen Time Tracking: Monitor daily app usage
- Read Mode: Track time spent reading course materials
- Student engagement analytics
- Performance metrics and GPA calculation
- Students: View marks, submit assignments, track progress
- Faculty: Grade assignments, view course analytics
- Admin: Full system access
USERS (Supertype)
├── STUDENTS (Subtype)
├── FACULTY (Subtype)
└── ROLES
ACADEMIC STRUCTURE
├── DEPARTMENTS
├── COURSES
├── SEMESTERS
└── COURSE_OFFERINGS (Junction with Faculty assignment)
ENROLLMENT & EVALUATION
├── ENROLLMENTS (Student ↔ Course Offering)
├── ASSIGNMENTS
├── SUBMISSIONS
├── EXAMS
└── EXAM_RESULTS
ANALYTICS
├── ATTENDANCE
├── SCREEN_TIME_DAILY
├── READ_MODE_SESSIONS
└── LOGIN_SESSIONS
- Primary Keys: All tables have unique identifiers
- Foreign Keys: Referential integrity maintained
- Candidate Keys:
users.email,students.enrollment_no - Composite Keys:
(course_id, semester_id, faculty_id)in course_offerings - Check Constraints: Marks validation, date ranges, status enums
- Unique Constraints: Prevent duplicate enrollments, submissions
The schema follows 3NF (Third Normal Form):
- No partial dependencies
- No transitive dependencies
- Separate tables for distinct entities
- PostgreSQL 12+ (Running on port 5432)
- Node.js 16+
- npm or yarn
# Create database
psql -U postgres
CREATE DATABASE student_erp;
\q
# Run schema
psql -U postgres -d student_erp -f database/schema.sql
# Seed data (~5000+ records)
psql -U postgres -d student_erp -f database/seeds.sqlcd backend
# Install dependencies
npm install
# Configure environment (update .env if needed)
# DB_PASSWORD should match your PostgreSQL password
# Start server
npm startServer runs on http://localhost:5000
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend runs on http://localhost:5173
After seeding the database, you can login with:
- Email:
student1@univ.edu(or any student2, student3, etc.) - Password:
pass123
POST /api/auth/register- Register new userPOST /api/auth/login- Login
GET /api/students- Get all students (Faculty/Admin only)GET /api/students/:id- Get student detailsGET /api/students/:id/analytics- Get student analytics
GET /api/courses- Get all coursesGET /api/courses/offerings- Get current semester offeringsGET /api/courses/offerings/:id/assignments- Get assignmentsPOST /api/courses/assignments/submit- Submit assignment
Minor_project_student/
├── database/
│ ├── schema.sql # Database schema with constraints
│ ├── seeds.sql # Data generation script
│ └── queries.sql # Complex analytical queries
├── backend/
│ ├── controllers/ # Business logic
│ ├── routes/ # API routes
│ ├── middleware/ # Auth & validation
│ ├── server.js # Express app
│ └── .env # Environment config
└── frontend/
├── src/
│ ├── components/ # Reusable components
│ ├── pages/ # Login, Dashboard
│ ├── services/ # API calls
│ └── context/ # Auth context
└── package.json
The database/queries.sql file includes:
- GPA Calculation using CASE statements
- Student Ranking with Window Functions (RANK, DENSE_RANK)
- Late Submission Detection with date arithmetic
- Engagement Analytics using CTEs
- Read Mode Statistics with aggregations
- Keys: Primary, Foreign, Candidate, Composite, Super
- Constraints: CHECK, UNIQUE, NOT NULL, DEFAULT
- Normalization: 3NF schema design
- Joins: INNER, LEFT, complex multi-table joins
- Aggregations: SUM, AVG, COUNT with GROUP BY
- Window Functions: RANK, ROW_NUMBER, PARTITION BY
- CTEs: Common Table Expressions for readability
- Transactions: ACID properties in submissions
- Indexing: On foreign keys and frequently queried columns
- Database: PostgreSQL 14+
- Backend: Node.js, Express, pg (node-postgres), JWT, bcrypt
- Frontend: React 18, Vite, React Router, Recharts, Axios
This project is for educational purposes.