Welcome to the fifth homework assignment in the Fullstack Bootcamp, where we continue to build upon the foundation laid by our previous projects, especially those emphasizing HTTP requests. This module signifies a shift in focus towards more advanced features. In this stage, we explore the integration of sophisticated functionalities, such as the ability to add avatars for users upon creation. This enhancement not only adds a personalized touch to user profiles but also enriches the overall user experience. Additionally, we delve into the world of Jest unit testing, ensuring the reliability and robustness of our application. This step reflects our commitment to delivering high-quality Fullstack solutions. As we integrate these innovations, we look forward to the unfolding possibilities on our journey of continuous skill development.
The fifth homework assignment builds upon the solid foundation of previous projects, expanding the capabilities of the application to include external REST API integration, avatar management, and Jest testing for enhanced functionality and reliability.
- (GET)
/api/contacts
: Retrieve a list of all contacts. - (GET)
/api/contacts/
:contactId: Retrieve a specific contact by ID. - (POST)
/api/contacts
: Add a new contact to the list. - (PUT)
/api/contacts/
:contactId: Update an existing contact's information. - (PATCH)
/api/contacts/
:contactId/favorite: Partially update an existing contact's information. - (DELETE)
/api/contacts/
:contactId: Delete an existing contact from the list.
- (POST)
/api/users/signup
: Register a new user. - (POST)
/api/users/signin
: Login and obtain a JWT. - (POST)
/api/users/logout
: Logout the user. - (GET)
/api/users/current
: Retrieve information about the currently logged-in user. - (PATCH)
/api/users/avatars
: Change the user's avatar.
- (GET)
/api/contacts?page=<page_number>&limit=<page_size>
: Retrieve paginated contacts. - (GET)
/api/contacts?favorite=true
: Retrieve contacts marked as favorites. - (PATCH)
/api/users
: Update the user's subscription level.
- Avatars are automatically generated for new users using the
package.
- Introduces a new endpoint
(PATCH) /api/users/avatars
for users to change their avatars. - Jimp package is utilized for image processing related to avatars.
- Implements
testing to ensure the robustness of the login functionality.
- Unit tests are created to validate the authentication system, enhancing the overall reliability of the application.
- Run tests using
npm run test
script defined in the package.json file.
: The runtime environment for executing the application.
: A NoSQL database for data persistence.
: An ODM (Object Data Modeling) library for MongoDB and Node.js.
: Used for user authentication.
: A web application framework for building RESTful APIs.
: Data interchange format used in the project.
:JavaScript testing framework ensuring code reliability and simplicity.
: Global avatar service for user profile images linked to email addresses.
If you encounter any issues or have suggestions, please open an issue.
I welcome feedback and suggestions from users to improve the application's functionality and user experience.