Let's build something together

Dogs Shelter

Full-Stack Application (REST API)

Project

Overview

In this project, I created a full-stack website using the MERN stack. Specifically, I used Mongoose, Express, React, and Node to build the website. The main goal of the website is to allow users to browse dogs and filter them by location, availability, and breed. Additionally, I added a search functionality to the website to make it easier for users to find specific dogs.
One of the key features of the website is the login functionality. This allows users to save their favourite dogs and message employees of the shelter with any enquiries they may have. To make the login process secure, I used JSON Web Tokens (JWT) which are stored in cookies. This allows users to remain authenticated across multiple pages of the website. In addition to implementing user authentication for the website, I also incorporated access control to restrict certain functionalities based on user roles. Specifically, I implemented two different access levels: one for regular users and one for employees.
Regular users are only able to browse dogs, filter them, and search for specific dogs. They are also able to log in and save their favourite dogs for later viewing. However, they do not have access to any of the CRUD functionalities that are available to employees.
On the other hand, employees have full CRUD access to the dog database. This means they can add new dogs, delete existing dogs, and update dog information as needed. Employees are also able to view and respond to user messages.
To implement access control, I used JWT tokens to verify the user's role and permissions. When a user logs in, the server verifies their credentials and returns a JWT token that includes their role. This token is then stored in a cookie and sent with each subsequent request. The server reads the token and checks the user's role before allowing them to access certain functionalities.
By implementing access control, I was able to ensure that users only have access to the functionalities they are authorized to use. This helps to prevent unauthorized access and maintain the security and integrity of the website.
To build the server-side of the website, I used Node.js and Express.js. This allowed me to handle requests from the front-end and perform CRUD operations on the database. I chose to use Mongoose as my Object Data Modeling (ODM) library as it integrates well with MongoDB, which I used to store user credentials, dog information, and messages.
To ensure the API endpoints were working as expected, I used Jest to perform testing. I also used JSDoc to document my code, which makes it easier for others to understand and maintain. Overall, I am pleased with how the website turned out. It is a great example of a full-stack MERN application and features several useful functionalities.

Tech/Techniques

React

NodeJS

Express

Mongoose

Jest

Jsdocs