Giter Club home page Giter Club logo

ranking-api's Introduction

Laravel Logo

Ranking athletes performance API

About The API

The Athlete Performance Tracking API is a RESTful service built with Laravel to manage and track athletes' performance records in various movements. The API allows CRUD operations for athletes, movements, and personal records, providing an efficient way to record and retrieve performance data. Additionally, it includes endpoints with a ranking system, retrieving ranking of athletes based on their performance in specific movements. It was built as a test case.

Technologies and Tools

This api was built using Docker compose running a nginx image and a mysql image for development enviroment and Laravel sail, a command-line interface for interacting with laravel's default docker development environment. Postman was used for testing the endpoint.
Read more about Laravel Sail here: https://laravel.com/docs/11.x/sail

API complete Documentation: Wiki

Access Here the complete documentation on Wiki
For detailed information about how to use the Endpoints, access this page of the project wiki
For examples of use, access here

Steps to use

You can simply run the project on your machine, if you have docker environment:

1- Installation : Clone this repository:

git clone https://github.com/juliazschwartz/ranking-api.git
cd ranking-api

2 - Setup:
If you are in Linux OS, and docker compose is already installed, execute this command:

docker context use default

Since none of the application's Composer dependencies, including Sail, will be installed after you clone the application's repository to your local computer, run the following command to install application's dependencies.
This command uses a small Docker container containing PHP and Composer to install the application's dependencies:

docker run --rm \
-u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php82-composer:latest \
    composer install --ignore-platform-reqs

Now, Paste the content of .env.example file, present in the root directory to .env to have the correct database configuration (command for Linux OS, replace with equivalent if you are using another OS).

cp .env.example .env

3 - Run it:

Now, lets execute the container with sail up command (equivalent to compose up)

./vendor/bin/sail up -d

it should look like this:

4 - Migrations and Seeders:
Laravel sail already manages volumes to store data, but there are stored in local machine, and are not presented here in this repository, so you should run the migration and seeders presented in this repository to populate the database.
For that, just execute:

./vendor/bin/sail artisan migrate

./vendor/bin/sail artisan db:seed --class=AthleteSeeder
./vendor/bin/sail artisan db:seed --class=MovementSeeder
./vendor/bin/sail artisan db:seed --class=PersonalRecordSeeder

should look like this:


5 - Test it

To test it, you can just run :

./vendor/bin/sail artisan test

should appear like this (all tests passing):


6- Use it
For detailed information about how to use the endpoints of this project, access here

Now you are ready to make the CRUD operations in API. I recommend using Postman for it (link for download in the references section).

For that, type "http://localhost/api/" in the URL field ("localhost" can be replaced by your local IP ), followed by the URL parameters for your request.
It will look like this:

7- External References

ranking-api's People

Contributors

juliazschwartz avatar

Stargazers

Rennan Felipe avatar

Watchers

Rennan Felipe avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.