Coursework for the University of London, CM2040: Database networks and the Web — a small event app where organisers manage events and tickets, and attendees browse, filter, and book.
- Watch: youtu.be/zPPKdScBB04
- Organisers — Register / login (bcrypt,
express-validator), sessions, site settings, draft & publish events, categories & tags, full + concession tickets and quotas, bookings and remaining counts on the dashboard. - Attendees — List published events, filter by category, search titles & tags, book tickets; small JS helpers in
public/js/(timezone, forms, copy link, confirmations). - Database — SQLite (
database.dbfromdb_schema.sql): organisers, events, bookings, pluscategories/tags/event_tagsfor the discoverability work.
- Presentation — EJS views, Tailwind (CDN), static assets in
public/. - Application — Express,
routes/auth.js,organiser.js,attendee.js,middleware/requireLogin.js. - Data —
sqlite3, queries mostly viautil/dbHelpers.js.
The submitted report’s architecture diagram marks table-heavy flows (events, tags, event_tags, categories) vs search/filter (GET query params → dynamic SQL → EJS).
- Also built — organiser auth, bookings on organiser home, remaining tickets for organiser and attendee views.
- Report focus — Discoverability on
/attendee/home: category dropdown + keyword search (title or tag), combinable, filtered in SQL with bound parameters (routes/attendee.js). - How search works — Optional
GET ?search=&category=; SQL addsLIKEon title and/or a subquery on tags; optionalAND c.category_name = ?; template getsselectedCategoryandsearchQueryso the form doesn’t reset. - Extra tables —
categories(pre-seeded),tags(unique names),event_tags(many-to-many,ON DELETE CASCADEon both FKs).
- Needs — Node ≥ 16, npm ≥ 8,
sqlite3CLI on PATH forbuild-db.
npm install
npm run build-db # macOS/Linux → creates database.db
npm start # http://localhost:3000- Windows —
npm run build-db-wininstead ofbuild-db. - Reset DB —
npm run clean-db(orclean-db-win), thenbuild-dbagain.
index.js— app, session, DB handle, route mountingroutes/—auth,organiser,attendeeutil/dbHelpers.js— shared queriesviews/— EJS +layout.ejspublic/— CSS + client JSdb_schema.sql— schema + category seeds
This project is coursework for the University of London module CM2040: Database networks and the Web and is intended for educational purposes.
