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

## Pull Request: Add Initial Backend Features (API v1) for Vecs School #26

Merged
merged 99 commits into from
Aug 31, 2023

Conversation

christianonoh
Copy link
Owner

@christianonoh christianonoh commented Aug 30, 2023

Description:

This pull request introduces the first version (v1) of the Vecs School backend API, encompassing fundamental features for managing courses, reservations, user registration, authentication, and user-specific operations.

Link to frontend application - VECS School Frontend

Features Added:

  1. Endpoints for Courses (API v1):

    • CRUD operations for courses.
    • API routes for course listing and retrieval by ID.
  2. Endpoints for Reservations (API v1):

    • CRUD operations for reservations associated with courses.
    • API routes for reservation creation, listing, update, and deletion.
  3. User Authentication and Authorization:

    • Implemented user authentication utilizing Devise and Devise JWT for secure registration, login, and logout processes.
    • Integrated JSON Web Tokens (JWT) for token-based authentication and security.
  4. Endpoint for Current Logged-In User:

    • Added an API endpoint to fetch details about the currently logged-in user.
    • Permits authenticated users to access their personalized user information.
  5. Testing and Documentation:

    • Wrote comprehensive RSpec tests for models and controllers.
    • Created API documentation using Swagger for clear and interactive endpoint documentation.

Changes Made:

  • Developed controllers, models, and migrations for courses and reservations.
  • Implemented user registration, login, and logout using Devise.
  • Integrated Devise JWT for token-based authentication.
  • Created versioned API endpoints for CRUD operations on courses and reservations.
  • Added API routes for user authentication and user-specific operations.
  • Enforced proper error handling and consistent response messages.
  • Accompanied with comprehensive unit tests and API documentation.

API Routes (API v1):

  1. POST /signup - Register a new user.
  2. POST /login - Authenticate and receive an access token.
  3. DELETE /logout - Log out the current user.
  4. GET /api/v1/courses - Retrieve a list of all courses.
  5. GET /api/v1/courses/:id - Retrieve details of a specific course.
  6. POST /api/v1/courses - Create a new course.
  7. PUT /api/v1/courses/:id - Update details of a course.
  8. DELETE /api/v1/courses/:id - Delete a course.
  9. GET /api/v1/reservations - Retrieve a list of all reservations.
  10. GET /api/v1/reservations/:id - Retrieve details of a specific reservation.
  11. POST /api/v1/reservations - Create a new reservation.
  12. GET /api/v1/current_user - Retrieve details of the current logged-in user.

Reviewer:

Kindly review this pull request to ensure adherence to coding standards, security practices, and overall code quality.

Thank you for your time and consideration.

Best regards,
@christianonoh, @smunoz1988, @Ellyboi and @vvoo21

Copy link

@Meltrust Meltrust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @christianonoh,

Good job so far!
There are some issues that you still need to work on to prepare your project for the final evaluation, but you are almost there!

To highlight:

  • Nice code organization ✔️
  • App is working well✔️
  • Good readme ✔️

You are really close to finishing the Microverse program!! Keep it up! 👍👍👍

You can do it

After implementing the requested changes, please submit another review request. ♻️

Check the comments under the review.

Cheers and Happy coding!👏👏👏

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the previous reviews unless it is requested otherwise.


README.md Outdated
Comment on lines 132 to 135
```sh
rails db:create
rails db:migrate
```
Copy link

@Meltrust Meltrust Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You have a very functional seeds.rb. Kindly add to your db commands rails db:seed.

That way, your users will enjoy a pre-seeded database. 👍

README.md Outdated
Comment on lines 150 to 153
- **Run Tests:** Use the following command to run the tests.
```sh
rspec
```
Copy link

@Meltrust Meltrust Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • When I run your tests according to your instructions, this happens:

image

This is because all your request tests are swagger tests. Rspec won't run them properly.

Therefore, kindly be more specific in your instructions so your users never get a failing test:

rspec ./spec/models
rspec ./spec/controllers

Result:

image

That way, your users will never get a failing test 👍

README.md Outdated

- **Run Tests:** Use the following command to run the tests.
```sh
rspec
Copy link

@Meltrust Meltrust Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You are using Rspec, but the "test" folder still exists, which is used by another test framework. Kindly consider deleting that folder if you are not using it. 👍

@Ellyboi
Copy link
Collaborator

Ellyboi commented Aug 30, 2023

Thank you taking your time to give this acceptable criticism......The corrections will immediately be implemented

Copy link

@Meltrust Meltrust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @christianonoh,

Wow, you did it 🎉

Brilliant

Thank you for the changes implemented 💪 🥇 ㊗️

Unless you want to add more features, go ahead to your final presentation ⏩ ⏩ ⏩

You are about to finish the Microverse program. You have come a long way!!!

Good luck in the software industry!! I'll see you there. ✨

Congratulations!!!!!! 🎉

applause

To highlight

  • Superfluous test folder has been removed✔️
  • db seeding instructions have been included✔️
  • Tests instructions have been improved ✔️
  • Great job✔️

Cheers and Happy coding!👏👏👏


@Ellyboi Ellyboi merged commit 6de1fd9 into main Aug 31, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants