A rest API built with Express.
Deployed at https://ourstory-api.herokuapp.com/api/
You will use your skills to be responsible for the back-end architecture of this project. You will work closely with your Front End Architect and your Scrum Master in order to discover project needs and deliver working Endpoints for your application.
- Visitors can view a list of stories, organized by country
- Coordinators can create an account
- Coordinators can login and view their stories
- Coordinators can create, update, and delete stories
- RESTful web APIs built with JavaScript, Express, and Node
- Middleware for security, logging, request parsing, and authentication
- Server-side routing with protected routes
- Authentication via JSON web tokens
- Data modeling and relational databases
- Database migrations and seeding
- SQL queries for accessing, inserting, and modifying data with Knex
- Request validation with Joi
- Separate environments for development, testing, and production
- Test-driven development and automated testing with Jest
- Secrets management with environment variables
- Git flow for organizations
- Automatic continuous deployment
- API documentation
- Using TDD has been a boon for me this build week. I love the security of being able to make a change to my code and have the tests run automatically and then see immediately that the changes didn't cause any regressions. Writing tests first takes some getting used to, and I frequently had to go back and fix the test code after implementing the functionality that I was testing, but the additional time and effort up front makes development relatively breezy. No need to poke around in the browser or a REST client after every code change. Testing the back-end is much more straight-forward than UI testing.
- As usual, it's been great to see all the things we've learned over the past month being used together to build a complete solution. I've been able to eliminate some blind spots in my mind about how exactly an app gets staged, tested, and deployed.
- Writing documentation is a lot of work! Even for something as simple as this app, with a handful of endpoints, it takes time to put everything down in a easy-to-digest format. It's also absolutely essential for an API since the consumer has no UI to provide clues on how to use the app. No one can use what you've built without the docs.
- I found back-end development to be a vacation compared to building the client app. The volume of code lines written is probably a third of the what I wrote for the client SPA during last build week, with the two projects being comparable in complexity.
- Continuous automatic deployment is a dream. Just push to
master
and call it a day. I'll be using this whenever I can in the future. - There is so much that can be done with middleware. I was able to find a library that handles async errors globally in Express and makes try/catch blocks in every route redundant. I defined a custom error type and used that to throw errors in lieu of nested if/else blocks. The global error handling and custom error types allowed me to prune about 25% of my routes code. It's much more readable and easier to maintain as well.