All projects
Programming coursework · Durham University

SmartCase: full-stack online shop

2023Full-stackNode.jsExpressREST APIJavaScriptBootstrapMochaChai

A phone, case and charger shop built from scratch: an Express REST API over JSON data stores, a customer front end with cascading product filters and a cart, and an admin panel for adding and removing stock. Delivered with API documentation, automated tests and a demo video.

API documentation (Postman)

The brief

The summative brief asked for a single-page web app backed by a RESTful API with at least two entity types, GET and POST endpoints, documented endpoints, linting, automated tests and a short demo video. My idea was a phone-accessories shop: pick a phone, then find a matching case and charger.

What I built

  • REST API in Express. Every JSON store in the databases/ folder is exposed automatically as GET /api/<name> (phones, cases, chargers and the cart), alongside GET /api/databaseNames.
  • Cart. POST /api/cart adds an item and DELETE /api/cart/clear empties it.
  • Admin endpoints. POST /admin/api/{phones|cases|chargers} adds stock and DELETE /admin/api/{type}/:id removes it.
  • Customer front end. Vanilla JavaScript with Bootstrap 5: a cascading phone finder (manufacturer → model → storage → colour), tables of cases and chargers, and an add-to-cart flow.
  • Admin panel. Lists all stock, generates the add forms dynamically from the shape of the data, and deletes rows in place.
SmartCase phone finder with cascading manufacturer, model, storage and colour selectors
The phone finder: choosing a manufacturer narrows the model, storage and colour options. Screenshot of the app running locally; the retailer-hosted product photos are omitted.
SmartCase admin page listing phones from the REST API with delete buttons
The admin panel listing stock served by the REST API, with a delete action on every row.

Quality

The API is covered by a Mocha and Chai test suite that runs against the live server with axios, and every endpoint is documented in Postman. I re-ran the suite for this write-up and all four tests pass.

13
REST API endpoints
4 / 4
API tests passing (re-run in 2026)
45
Products in the seed data (30 phones, 9 cases, 6 chargers)
~2 min
Recorded demo video

Source: app.js, app.test.js and databases/*.json in the project repository

Looking back

Keeping the data in JSON files made the project dependency-free, but it wouldn't survive concurrent writes, and the admin endpoints have no authentication. A real database and authenticated admin routes are the first two things I'd add today.

← Back to all projects