SmartCase: full-stack online shop
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 asGET /api/<name>(phones, cases, chargers and the cart), alongsideGET /api/databaseNames. - Cart.
POST /api/cartadds an item andDELETE /api/cart/clearempties it. - Admin endpoints.
POST /admin/api/{phones|cases|chargers}adds stock andDELETE /admin/api/{type}/:idremoves 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.


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.
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.