Skip to content

KorynLA/GuineaPigFactsBackend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Guinea Pig Facts

An API that allows users to create an account, add a guinea pig fact, and opt in to receive weekly facts.
Build Status

Table of Contents

Getting Started

Prerequisites

Installing

  1. Clone repository: git@github.com:KorynLA/GuineaPigFactsBackend.git
  2. Update the mongoDB that will be used by the application.
    • If using MongoDB Atlas:
      • cd /<pwd>/guineaPigFacts/src/main/resources
      • Remove all text from application.properties
      • Add spring.data.mongodb.uri=<YOUR_URI>
  • If using MongoDB local
    • cd /<pwd>/guineaPigFacts/src/main/resources
    • Update application.properties with database name you want to save the data in line 7: spring.data.mongodb.database=<YOUR_DATABASE>

Local Deployment

  1. Have mongoDB instance running
  • Locally
    • Open a new shell and run the command: mongo
  • MongoDB Atlas
    • Should already be running. The system status can be checked here
  1. cd /guineapigfacts
  2. Run ./mvnw spring-boot:run

Endpoints

/user

  • /user/{id}
    • GET
    • Retrieves user with the ID passed in the URL path
  • /user/
    • POST
    • Adds a user to the User collection
  • /user/{id}
    • PUT
    • Updates a document in the User collection with the ID passed in the URL path
  • /user/{id}
    • DELETE
    • Deletes a document with the ID passed in the URL path

/fact

  • /fact/
    • GET
    • Retrieves all facts in the Fact collection
  • /fact/{id}
    • GET
    • Retrieves fact with the ID passed in the URL path
  • /fact/
    • POST
    • Adds a fact to the Fact collection
  • /fact/{id}
    • DELETE
    • Deletes a document with the ID passed in the URL path

Tools Used

Spring Boot with the data loaded to and from a MongoDB Atlas database.

About

Daily guinea pig facts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages