How webdev4001/slc-web works
Project type and purpose
• This is a full-stack web application for the Student Learning Centre (SLC) at MMMUT.
• Frontend: Static HTML/CSS/JS pages (responsive UI built with Tailwind CSS and vanilla JS).
• Backend: Node.js/Express service with authentication & admin routes (currently minimal, ready for API integration).
• Future: A data store (e.g., MongoDB) and AI chatbot integration.
File structure
• Public/
• HTML files (index.html, library.html, engage.html, council.html, path.html)
• CSS folder (“style.css” compiled by Tailwind)
• JS folder (main.js, forms.js, chatbot.js, chat-logic)
• Images
• backend/
• server.js (Express app entry point)
• middleware (verifyToken.js, checkRole.js)
• routes (auth.js, admin.js)
• models (User.js)
• src/input.css (Tailwind directives)
• Config files: tailwind.config.js, postcss.config.js, package.json
README for additional insights
• Frontend built for responsive, interactive pages and forms
• Chatbot front-end stub pending real AI integration
• Backend scaffolding for token verification, role-based access
• Future enhancements: DB integration, full CRUD APIs, real chatbot service
Main components & interactions
a. Frontend (Browser)
• Static assets served: HTML, Tailwind CSS, JS modules
• User interaction flows:
• Navigation & page rendering
• Form submissions (book suggestion, join, feedback)
• Chat interface (PATH chatbot)
b. Static File Server / CDN
• Serves Public/ assets (could be Express static or external CDN)
c. Backend API (Express)
• Endpoints:
• /auth → login/signup, JWT issuance
• /admin → protected routes (middleware: verifyToken, checkRole)
• Business logic and model interactions
d. Data Layer (future)
• MongoDB (or SQL) storing users, suggestions, applications, feedback, event data
e. External Services
• Google Fonts
• AI Chatbot Service (Dialogflow, custom LLM API)
Architectural patterns & design principles
• MVC-ish separation:
• Models in backend/models
• Controllers in backend/routes
• Views = static HTML + JS on client
• Middleware pipeline for auth and role checks
• Client-Server separation with a RESTful API boundary
• Utility-first CSS (Tailwind) for styling consistency