Skip to content

Shahidrox/TopScoreRanking

Repository files navigation

Basic Ruby on Rails: Top Score Ranking

This README would normally document whatever steps are necessary to get the application up and running. Things you may want to cover:

Languages Version
image ruby '3.0.1'
image rails '6.1.4.1'
image (PostgreSQL) '13.3'
image node (-> 'v14.17.1')
image Docker '20.10.7'
Big Sur '11.4 (20F71)'

Getting Started

git clone git@github.com:Shahidrox/TopScoreRanking.git
cd TopScoreRanking
bundle exec rails db:create -e test
bundle exec rails db:migrate -e test
bundle exec rspec
File: TopScoreRanking/spec/requests/api/v1/score_spec.rb
Docker - setup
Image rebuild: $ docker-compose build
Container launch: $ docker-compose up -d
DB create: $ docker-compose run web rails db:create
DB migrate: $ docker-compose run web rails db:migrate
Test: $ curl 0.0.0.0:3000
CONTAINER LIST: $ docker container ls
CONTAINER STOP: $ docker stop <container-name>
Removing All Unused Docker Objects: $ docker system prune

API Document

Swagger Doc -
http://localhost:3000/api-docs/v1/index.html image

API

Type method API Params
Create Score /api/v1/scores) { player: name, score: 11, time: 2021-09-04T08:07:13.161Z }
Get Score /api/v1/scores/{id} -
Delete Score /api/v1/scores/{id} -
Get all scores by playerX /api/v1/scores { player: playerX }
Get all score after 1st November 2020 /api/v1/scores { after: 1st November 2020 }
Get all score before 1st December 2020 /api/v1/scores { before: 1st December 2020}
Get all scores by playerX, playerY before 1st december 2020 /api/v1/scores { player: playerX, playerY, before: 1st December 2020}
Get all scores after 1 Jan 2020 and before 1 Jan 2021 /api/v1/scores { before: '1 Jan 2021', after: '1 Jan 2020' }
Get all scores by playerX after 1 Jan 2020 and before 1 Jan 2021 /api/v1/scores { player: playerY, before: 1 Jan 2021, after: 1 Jan 2020 }
list of top score /api/v1//scores/playerscorehistory/{playerX}/Top -
list of low score /api/v1//scores/playerscorehistory/{playerX}/Low -
list of average score /api/v1//scores/playerscorehistory/{playerX}/Average -
list of all the scores of this player /api/v1//scores/playerscorehistory/{playerX}/All -

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published