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

Feature: Add user routes #1

Open
14 tasks done
nani-samireddy opened this issue Jun 21, 2024 · 0 comments · Fixed by #15
Open
14 tasks done

Feature: Add user routes #1

nani-samireddy opened this issue Jun 21, 2024 · 0 comments · Fixed by #15
Assignees

Comments

@nani-samireddy
Copy link
Member

nani-samireddy commented Jun 21, 2024

Description:

We need to create a user management system for our API. The tasks include creating a user model, implementing necessary routes, and adding authentication middleware. This will enable the API to handle user-related operations such as creation, retrieval, updating, deletion, login, logout, and password recovery.

Tasks:

  1. Create User Model

    • Fields:
      • id (unique identifier)
      • name
      • email
      • password
      • phone number
      • cart (array or object to store cart items)
      • wishlist (array or object to store wishlist items)
      • addresses (array of address objects)
      • createdAt (timestamp)
      • updatedAt (timestamp)

    NOTE: This schema might go through some modifications in the future. This is not the final schema.

  2. Add Routes

    Functionality Route Method
    Get All Users /api/user/ GET
    Get User by ID /api/user/:id GET
    Create User /api/user/ POST
    Update User by ID /api/user/:id PUT
    Delete User by ID /api/user/:id DELETE
    Login /api/user/login POST
    Logout /api/user/logout POST
    Forgot Password /api/user/forgot-password POST
  3. Add Authentication Middleware

    • Use cookie and JWT for authentication.
    • Apply middleware to the following routes:
      • updateByID
      • deleteByID
      • logout

Steps to Follow Before Starting the Work:

  1. Clone the repository:
    git clone [email protected]:The-Software-Squad/mvep-api.git
  2. If you already have the repository, checkout to the dev branch:
    git checkout dev
  3. Pull the latest changes:
    git pull origin dev
  4. Create a new branch for this feature:
    git checkout -b feature/add-user-routes

Checklist:

  • Use proper comments and naming conventions.
  • Create User Model with specified fields
  • Implement GET /api/user/ route
  • Implement GET /api/user/:id route
  • Implement POST /api/user/ route
  • Implement PUT /api/user/:id route
  • Implement DELETE /api/user/:id route
  • Implement POST /api/user/login route
  • Implement POST /api/user/logout route
  • Implement POST /api/user/forgot-password route
  • Add authentication middleware using cookie and JWT
  • Apply middleware to updateByID, deleteByID, and logout routes
  • Test all routes and functionalities
  • Update the .env.sample file if you have updated any env variables

Instructions to Raise a Pull Request:

  1. Once all tasks are completed and the code is thoroughly tested, Push your branch to the remote repository:
    git push origin feature/add-user-routes
  2. Go to the repository on GitHub and create a new Pull Request against the dev branch.
  3. Provide a descriptive title and summary for your PR, and request a review from your team members.
  4. Ensure all checks pass and address any feedback given during the review process.
@nani-samireddy nani-samireddy linked a pull request Jun 22, 2024 that will close this issue
Vamsi-Praveen added a commit that referenced this issue Jun 22, 2024
@nani-samireddy nani-samireddy linked a pull request Jul 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants