Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create User Service Microservice #223

Open
BrosG opened this issue May 26, 2023 · 0 comments
Open

Create User Service Microservice #223

BrosG opened this issue May 26, 2023 · 0 comments

Comments

@BrosG
Copy link
Contributor

BrosG commented May 26, 2023

Description
The User Service is responsible for handling all user-related operations. This includes user registration, login, profile management, and possibly authentication and authorization. The service will be a self-contained application with its own database and will communicate with other services through well-defined APIs.

Proposed Functionality
User Registration: The service should provide an API for user registration. This will include validation of the user's data, ensuring unique usernames or email addresses, and storing the new user's data in the database.

User Login: The service should provide an API for user login. This will involve checking the submitted credentials against the stored user data.

Profile Management: The service should provide APIs for retrieving and updating a user's profile. This includes operations like changing the user's name, email address, or password.

Authentication and Authorization: Depending on how we choose to handle authentication and authorization, these features may also be part of the User Service. If so, the service will need to provide APIs for checking a user's authentication status and their permissions for various operations.

Implementation Steps

Extract User-Related Code: Identify and separate all the user-related code from the current monolith into the new User Service. This includes relevant parts from the user.model.js, login.controller.js, profile.controller.js, and any other relevant parts.

Create User Service APIs: Design and implement the APIs for user registration, login, and profile management. If we're handling authentication and authorization in the User Service, create APIs for these features as well.

Setup Database for User Service: As part of the microservice architecture, the User Service should have its own separate database. We need to set this up and migrate any existing user data to it.

Update Other Services to Use User Service APIs: Any other service that needs to perform user-related operations should do so by calling the User Service's APIs. Update the code in these services to replace direct database accesses with API calls.

Deploy User Service: Deploy the User Service as a standalone application. This could involve setting up a new server or using a service like AWS Lambda.

Test User Service: Thoroughly test the User Service to ensure it works correctly. This should include both functional testing of the APIs and load testing to ensure it can handle the expected number of requests.

Please discuss this proposal and let me know of any adjustments or additions that should be made. Once we've finalized the specifications, we can break this down into smaller tasks and start the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant