How s4tvik/attendance-management-system works
Project type and purpose
• This is a full-stack web application (“Attendance-Management-System”) for educational institutions to track student attendance.
• Frontend: static assets and EJS templates for login, teacher pages, student pages, error pages.
• Backend: Node.js/Express (app.js, server.js) serving routes, rendering views, handling form submissions.
• Database: MongoDB (or JSON files in db/) storing collections: attendance, login, student, teacher.
File structure
├─ server.js / app.js
│ • Express server setup, route definitions, middleware.
├─ *.ejs (calendar.ejs, student_home.ejs, teacher_home.ejs, teacher_class.ejs, teacher_form.ejs, etc.)
│ • View templates rendered on server side.
├─ public/
│ ├ css/ (Bootstrap5-based styles)
│ ├ js/ (app logic, Particle.js)
│ └ images/ (static assets)
├─ db/
│ └ *.json (mock data or seed files for MongoDB collections)
├─ login.html, login1.html, 404notfound.html, notloggedin.html
│ • Static fallback or initial pages
└─ node_modules, package.json, package-lock.json
• Dependencies: Express, MongoDB driver or ODM, Bootstrap5, Particle.js
Key insights from README
• Two user roles: Teacher and Student, each with dedicated views and workflows.
• Core pages: login, teacher-home, teacher-class (attendance marking), student-home (attendance viewing), error/404.
• Tech stack: Node.js/Express, EJS, Bootstrap5, Particle.js, MongoDB.
a. Client browser
• User interface: HTML/EJS pages + CSS (Bootstrap5 + custom) + JS (app_1.js + Particle.js).
• User roles: Teacher UI vs Student UI.
b. Web server
• Node.js/Express application (server.js, app.js).
• Route handlers/controllers for login, attendance operations, data retrieval.
c. Database
• MongoDB instance (or JSON files simulating collections).
• Collections: users (teacher/student), attendance records, login sessions.
d. External services
• Particle.js CDN (or local) for UI effects.
• (Optional) Authentication middleware or session store if any.
Relationships and data flow
• Browser → HTTP(S) → Express routes (POST /login, GET /teacher/home, POST /teacher/attendance, GET /student/home).
• Express → Database driver → MongoDB (CRUD operations on collections).
• Express ← Rendered EJS views + JSON data sent back to client.
• Static asset requests routed to public/ folder.
Architectural patterns and design principles
• MVC-like separation:
• Model = MongoDB collections (db/*.json or actual DB).
• View = EJS templates + static HTML.
• Controller = Express route handlers in server.js/app.js.
• Single Express monolith (no microservices); simple layered architecture.
• Client-server separation: browser UI vs server logic.
• Secure routes (login gating teacher/student pages).
3. Inside Server, show modules: Routing, Controllers, Middleware.
4. Inside Database, list collections.
• Client → Server (HTTP)
• Server → Database (CRUD)
• Server → Client (Rendered HTML/JSON)