Skip to content
/ RMPL Public

RMPL is an internal application to rate Langara College professors, it was made using express and an EJS view engine. It aims to be easy to understand, use and contribute to.

Notifications You must be signed in to change notification settings

LMSAIH/RMPL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RMPL

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.

Features

  • Server-rendered UI (EJS)
  • User accounts (username/password)
  • JWT-based authentication (stored in an HTTP-only cookie)
  • Add professors, subjects and reviews

Tech stack

  • Node.js, Express
  • MongoDB, Mongoose
  • EJS templates
  • bcrypt, jsonwebtoken

Quick start

  1. Install dependencies
npm install
  1. Create .env in the project root:
MONGODB_URI=<your mongodb connection string>
JWT_SECRET=<strong random secret>
PORT=5000
  1. Run (development)
npm run dev

Or run production

node app.js

Configuration

  • MONGODB_URI (required) — MongoDB connection string.
  • JWT_SECRET (required) — secret used to sign authentication tokens.
  • PORT (optional) — server listening port (default 5000).

Scripts

  • npm run dev — starts app with nodemon.
  • npm start — production start (runs node app.js).

API / Routes

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, sets token cookie (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)

Data models

  • Professor — { name, department, ratings, overall, quality, difficulty, workload, subjects: [], comments: [{author, subject, date, content}], createdAt, updatedAt }
  • User — { username (unique), password (hashed) }

Project structure

  • app.js — server entrypoint
  • controllers/controller.js — route handlers and middleware
  • server/config/db.js — DB connection
  • server/routes/main.js — router
  • server/models/Professor.js, server/models/User.js — Mongoose models
  • views/ — EJS templates
  • public/ — static assets (css, js, images)

Contributing

  • Fork the repo, create a feature branch, run tests (if added), submit a pull request with a concise description.

About

RMPL is an internal application to rate Langara College professors, it was made using express and an EJS view engine. It aims to be easy to understand, use and contribute to.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published