Description
Co.Blog is a blog site where multiple authors can contribute posts. Separate clients for authors and non-authors consume a RESTFUL API which exposes CRUD methods to users.


Objective
For this project I wanted to create a blog site that had a client for authors to create, edit and delete blog posts, as well as a client for the general public to view posts, and signed-up users to post comments.
The two front end clients needed to interact with my own API to collect blog posts and comments to display, as well as enable users to edit and delete their own comments.
The API needed to be robust and securely handle different kinds of users and HTTP requests.

Tech used
- React
- Styled-Components
- Express
- PostgreSQL
- Prisma
- Node
- Passport
Both front end clients were created using React which meant updating the DOM was a breeze. React's state management and handling of side-effects made retrieving blog posts and user comments into an app-like experience. React Router allowed sharing of post URLs and access to specific posts
Utilizing Styled-Components meant I could keep CSS styling scoped locally and within the same file.
Prisma ORM allowed me to work with the PostgreSQL database without having to flesh-out verbose, error-prone SQL queries. This meant my focus could stay on architecting my API end points rather than wrestling my database!

Challenges
The first challenge of this project was deciding which end points and resources needed to be accessible, and by who.
I spent a great deal of time testing end points using Postman to ensure they were only accessible to the right users. In the end, not all of the end points were consumed by the front end.
End points exist to update user details, which could prove useful in the future should a user want to change their password or email address.
Secondly, deciding how my front ends would consume the API was also quite challenging. Originally I went down the path of creating a single page application, which looked to be working out well until it came down to
implementing a way for users to share specifc blog posts...
This meant going back and implementing React Router so that I could create shareable URLs to each post, as well as cleaning up no-longer-required state.
Lastly, my API was exposed! This meant implementing a proxy server to abstract the main server's address.
Let's Keep in Touch
If you're after a developer for your next project, have something you'd like to ask or just want to stay in touch, feel free to reach out.
ruuksine@gmail.com