Skip to content

roch25/pl406-doggo-adoption

 
 

Repository files navigation

Dog Adoption and Care

Application where users can view dogs up for adoption/fostering, adopt/foster a dog, post about a dog available for adoption/fostering or write a post (maybe asking for help or really just anything related to dogs). Users can also choose to donate (monetarily/pet products) or volunteer for the adoption home. The application will post details about events like adoption camps. Users can also view the help section regarding locations of pet food stores, vet clinics and other doggo related information.

Build Status Deployed on Heroku

versionjava versionspringboot versionnodejs versionsvelte mongodb versionaxios versionrollup versionmoment versionmapbox versionsvelterouting jwt thymeleaf

Getting Started

  • Clone this repository.

    git clone https://github.com/rochelle-m/pl406-doggo-adoption
    
  • Create a new database in MongoDB Atlas.

    MongoDB Atlas is a hosted MongoDB service option in the cloud which requires no installation overhead and offers a free tier to get started.

  • Open the project in IntelliJ IDEA or Eclipse IDE.

    Note that you will need to have Java installed.

    Local development

  • Configure App properties: Create a file to store your application properties and environment variables src/main/resources/application-dev.properties

  • Set up Atlas Connectivity and paste in your connection string.

    spring.data.mongodb.uri=
  • Payment processing using Stripe: Create an account on Stripe and place your public and secret key pair in application-dev.properties.

    stripe.public.key=
    
    stripe.secret.key=
  • Your application-dev.properties would look something like this (Fill in the other properties).

    spring.data.mongodb.uri=
    
    spring.servlet.multipart.max-file-size=
    
    spring.servlet.multipart.max-request-size=
    
    app.jwtSecret=
    
    app.jwtExpirationMs=
    
    stripe.public.key=
    
    stripe.secret.key=
    
  • In client/ create a file .env and in it, enter your Mapbox Access Token

    API_MAPBOX_ACCESS_TOKEN=
    
  • First run

    mvn clean install
    
  • Then, run the application

    mvn spring-boot:run
    
  • Visit localhost:8080.

Deployment

  • Set the active profile to prod in src/main/resources/application.properties
    spring.profiles.active=prod
  • Set up Config vars in Heroku

APIs

Method Endpoint Description Authentication
GET /api/doggos/ Retrieves all dogs
POST /api/doggos/ Creates a new dog resource
GET /api/doggos/{id} Retrieves a dog with matching id
POST /api/auth/signup Creates a new user, returns JWT
POST /api/auth/signin Authenticates the user, returns JWT
POST /api/auth/logout Logs the user out
PUT /api/auth/update/{id}/{role} Updates the user to the VOLUNTEER role
GET /api/checkout/{amount} Redirects to the payment page
POST /api/posts/new Creates a new post
POST /api/posts/comment Creates a new comment to a post
DELETE /api/posts/{id} Deletes post by id
GET /api/products/[category-name] Retrieves products by category
POST /api/applicant/ Creates a new adoption applicant
GET /api/applicant/ Retrieves all applicants ✓*
DELETE /api/applicant/{id} Deletes an applicant by id

About

PL406 Project Dog Adoption and Care improvements

Resources

Stars

Watchers

Forks

Languages

  • Svelte 46.0%
  • Java 39.8%
  • JavaScript 10.4%
  • HTML 3.0%
  • CSS 0.8%