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

MongoDB database connection and first APIs for user data #79

Merged
merged 4 commits into from
Apr 7, 2024

Conversation

dusek2
Copy link
Contributor

@dusek2 dusek2 commented Apr 5, 2024

Overview

Creating MongoDB connection and an API to add, retrieve and delete user from database

Related Issue(s)

Closes #76

Changes

Created mongo connection in app.js of backend.
Created users.js routing for database APIs
Implemented usage of .env to hide database access URI
Changed login.js to remove database connection and move to app.js instead

Added

  • backend/.env
  • backend/README.md
  • backend/tests/users.test.js

Changed

  • backend/routes/users.js
  • backend/routes/login.js

Screenshots

Mongo DB record
image

Test coverage over 80%
image

Instructions for Testing

After cloning repo

  • add database URI string from MongoDB into .env file
  • create API
  • create API uni test
  • npm test

Checklist before Merging

  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate).
  • I have ensured the changes adhere to the project's coding standards and guidelines.

@dusek2 dusek2 marked this pull request as ready for review April 5, 2024 18:12
@dusek2
Copy link
Contributor Author

dusek2 commented Apr 5, 2024

ChatGPT assistance used on Unit tests on user data API
https://chat.openai.com/share/351f7b76-3924-48ba-8891-4c8e4336d408

@dusek2
Copy link
Contributor Author

dusek2 commented Apr 5, 2024

Test coverage is over 80% but not yet implemented into Github Actions, I have to look into how to use APIs in Github Actions. It means we need the backend running and connected to database with secret URI and also the tests running simultaneously

Copy link
Contributor

@FernFinder FernFinder left a comment

Choose a reason for hiding this comment

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

Pull Request Review:

Readability:
The code does as is stated in the PR. The current code implemented is logical and makes sense and is easy to follow.

Code Quality:
Comments are included and the code fits the current structure of our project.

Testing:
Test coverage is over 80% but is yet to implemented in GitHub actions. I have created issue #81 for this.

Functionality:
Changes are backward compatible and solve #75.

Housekeeping:
All AI use has been documented.

Additional Comments:

Huge job on creating basic API requests for user schemas in our database. Good job also including testing and adding a .env file for our connection code. Approved.

Copy link
Contributor

@barkangel barkangel left a comment

Choose a reason for hiding this comment

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

Pull Request Review:

Readability:
Code is easy to follow and easy to read, files have respective changes listed in PR.

Code Quality:
Code is written well, no overflow, and documentation is present.

Functionality:
Solves issue #75. and code is necessary for testing and backend connections.

Housekeeping:
Documentation is very good. ChatGPT4 is used, and documented where used.

Additional Comments:

Great work with testing percentage as well as backend connection. Great work, and a huge help bringing all aspects of the project together. A good transition into the backend stage of our webapp development.

Comments are very helpful and appreciated when connecting to backend.

PR approved and merging good to go!

@dusek2 dusek2 merged commit 5498a97 into UNLV-CS472-672:main Apr 7, 2024
1 check 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.

Mongo DB connection and user records API needed
3 participants