Skip to content

API-only Rails 7 app managing tea data for the Spilled frontend application

Notifications You must be signed in to change notification settings

tednaphil/spilled-api

Repository files navigation

spilled logo

This API Rails app manages tea and user data for the Spilled web application.

Background

This API was built retroactively to replace a deprecated API used during development. The API originally used provided two GET endpoints. This API includes additional endpoints to allow the client-side to be refactored to manage data generated by user interactions differently.

Project Links

Repo Deployment Description
FE Repo Spilled Browse teas and blends
BE Repo📍 Spilled API Tea and user data API

|

Local Setup Instructions:

  • Run the following on the command line to clone the repo and navigate into the project directory
    git clone https://github.com/tednaphil/spilled-api.git
    cd spilled-api
    
  • Install gems
    bundle install
    
  • Setup the database
    rails db:{drop,create,migrate}
    
  • Start the server locally - server will run at http://localhost:3000
    rails server
    
  • To stop the server, use Ctrl + C in the open terminal

Schema

Screenshot 2024-07-16 at 12 30 25 PM

Endpoints

URL: https://spilled-api.onrender.com

Method Endpoint Request Body Sample Response
GET /teas n/a [{id: 2, name: "Assam Tea", slug: "assam", style: "black",...}, ...]
GET /teas/:id n/a {id: 2, name: "Assam Tea", slug: "assam", style: "black",...}
POST /users {user: {username: "Tony"}} {id: 1, username: "Tony"}
GET /users/:id n/a {id: 1, username: "Tony"}
DELETE /users/:id n/a n/a
GET /user_favs/:user_id n/a [{id: 1, user_id: 1, tea_id: 2}, ...]
POST /user_favs {fav: {user_id: 1, tea_id: 5}} {id: 2, user_id: 1, tea_id: 5}
DELETE /user_favs/:fav_id n/a n/a

About

API-only Rails 7 app managing tea data for the Spilled frontend application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published