NC News API
- Project Type
- Bootcamp Project
- Year Month
- Oct 2024
Skills used
- Javascript
- Express.js
- PostgreSQL
- RESTful APIs
- MVC
- Data Seeding
- Jest
Summary
This project is an Express.js API backend for a dummy news site, as part of a bootcamp. It features a variety of available endpoints for GET, POST, PATCH and DELETE actions by a user, as well as support for ordering and sorting by functionality. The project setup includes seeding a PostgreSQL database with development and production data.
What Went Well
- Organised the codebase using the Model-Controller design pattern, making it straightforward to follow and simple to add additional functionality.
- Documentation is thorough, showing the reader endpoint parameters and example outputs.
- Functionality fully supported the data needs of the frontend.
- API endpoints were tested extensively with a Jest test suite and a CI/CD pipeline was established to test code as it was added into production.
What I Learned
- Practiced MVC design patterns for file structures and functionality architecture decisions.
- When to use different REST methods and the assumptions of what each request would represent, for example PATCH for a partial item update.
- Security considerations, such as input sanitisation, when querying a database with user input.
- Writing complex SQL queries to access, filter and join multiple tables for a request.