4D-Coder / animal-crossing-fish-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


🍵 Animal Crossing Fish API

An application to serve as the backend service for Animal Crossing.

Built as a service that makes API calls to Animal Crossing: New Horizons API

Table of Contents
  1. About The Project
  2. Getting Started
  3. Available Endpoints
  4. Goals

About The Project


(back to top)

Built With:

3.1.1

7.0.4

Postgres 14

(back to top)

Getting Started

To run the application locally, this repository will need to be cloned and set up fully with required gems.


Installation

  1. Clone the repo:

    git@github.com:4D-Coder/amimal-crossing-fish-api.git
  2. Install gems:

    bundle install
  3. To establish the database, run:

    rails db:create

    If you do not see Created database 'animal_crossing_fish_api_development' Run:

    RAILS_ENV=development rails db:create
  4. To migrate the database configurations into your local development and test environment, run:

    rails db:migrate
  5. To boot up localhost [default port: 3000], run:

    rails s

Inspect the /db/schema.rb and compare to the 'Schema' section below to ensure this migration has been done successfully.

(back to top)


Available Endpoints

  • This API can be called locally using a program like Postman.

  • Note: Necessary parameters marked with {}


Update Homepage's Song (Happy Path)

Request URI:

PUT /api/v1/music

Body:

{
  "weather":"Sunny"
}

Response:

{
  "data": {
    "id": "45",
    "type": "song",
    "attributes": {
      "file_name": "BGM_24Hour_14_Sunny",
      "hour": 14,
      "id": 45,
      "music_uri": "https://acnhapi.com/v1/hourly/45",
      "weather": "Sunny"
    }
  }
}
Code Description
200 OK

Notes:

  • Will match the song's hour attribute based on the Time.now API's current hour

(back to top)

About


Languages

Language:Ruby 98.9%Language:HTML 1.1%