RMPL is a small Node.js + Express application for listing professors and collecting student ratings and reviews. Views are rendered with EJS and data is stored in MongoDB via Mongoose.
- Server-rendered UI (EJS)
- User accounts (username/password)
- JWT-based authentication (stored in an HTTP-only cookie)
- Add professors, subjects and reviews
- Node.js, Express
- MongoDB, Mongoose
- EJS templates
- bcrypt, jsonwebtoken
- Install dependencies
npm install- Create
.envin the project root:
MONGODB_URI=<your mongodb connection string>
JWT_SECRET=<strong random secret>
PORT=5000
- Run (development)
npm run devOr run production
node app.jsMONGODB_URI(required) — MongoDB connection string.JWT_SECRET(required) — secret used to sign authentication tokens.PORT(optional) — server listening port (default 5000).
npm run dev— starts app withnodemon.npm start— production start (runsnode app.js).
All routes use checkAuth to populate req.isAuthenticated and req.username. authMiddleWare enforces authentication where used.
- GET
/— home (controllers.getIndex) - POST
/search— search professors (controllers.search) - GET
/about— about page (controllers.getAbout) - GET
/list— add instructor form (controllers.getList) - GET
/login— login page (controllers.getLogin) - POST
/authenticate— login, setstokencookie (controllers.authenticate) - POST
/createAccount— new user (controllers.createAccount) - GET
/logout— logout (controllers.logOut) - POST
/newInstructor— add professor (controllers.newInstructor) - GET
/search/:id— professor details (controllers.searchProf) - GET
/rate/:id— rate page (controllers.rateProf) - POST
/addSubject— add subject to professor (controllers.addSubject) - POST
/addReview— submit review and update aggregates (controllers.addReview) - GET
/admin— admin page (protected) (controllers.admin)
Professor— { name, department, ratings, overall, quality, difficulty, workload, subjects: [], comments: [{author, subject, date, content}], createdAt, updatedAt }User— { username (unique), password (hashed) }
app.js— server entrypointcontrollers/controller.js— route handlers and middlewareserver/config/db.js— DB connectionserver/routes/main.js— routerserver/models/Professor.js,server/models/User.js— Mongoose modelsviews/— EJS templatespublic/— static assets (css, js, images)
- Fork the repo, create a feature branch, run tests (if added), submit a pull request with a concise description.