Skip to content

carlosbelchior/galaxy-federation

Repository files navigation

Galaxy Federation

Minimum system requirements:

NGINX or APACHE (Remember to configure your virtualhost)

PHP version 8.1 or higher

MySQL 8.0.29 or higher

I recommend using Docker and the laradock library

Data flow:

1 - pilot registration

2 - ship registration

The route above is the primary route of registration, after these registrations, the other routes can be used without problems as long as they respect the dependencies.


After install use composer install and create the .env in project

Create your database and set in .env, after run command php artisan migrate --seed for create your database and populate yourdatabase.



Routers API:

Add pilot:

URL: /api/add/pilot
Method: POST

Data: pilot_certification, name, age, credits, location_planet

Add ship:

URL: /api/add/ship
Method: POST

Data: fuel_capacity, fuel_level, weight_capacity (double format 0.00), location_planet

Add contract:

URL: /api/add/contract
Method: POST

Data:
pilot_certification,
ship (Identification code),
payload (json with the products and the transported weight),
origin_planet, destination_planet, value

Accept contract:

URL: /api/contracts/accept/id_contract
Method: GET

No additional information is needed

Finish contract:

URL: /api/contracts/finish/id_contract
Method: GET

At the end of the contract, all costs and credits are automatically debited.

No additional information is needed

List open contract:

URL: /api/contracts/all
Method: GET

No additional information is needed

New travel:

URL: /api/travels/new
Method: POST

Data: pilot_certification, ship (Identification code), origin_planet, destination_planet

All costs are automatically debited.

Buy fuel:

URL: /api/fuel/buy
Method: POST

Data: pilot_certification, ship (Identification code), refill (number of refills you want)

All costs are automatically debited.

Report transactions:

URL: /api/reports/transactions
Method: GET

No additional information is needed

Report pilots:

URL: /api/reports/pilots
Method: GET

No additional information is needed

Report ships:

URL: /api/reports/ships
Method: GET

No additional information is needed

Report travels:

URL: /api/reports/travels
Method: GET

No additional information is needed

Report routers:

URL: /api/reports/routers
Method: GET

No additional information is needed

Report contracts:

URL: /api/reports/contracts
Method: GET

No additional information is needed

Report finish contracts by pilot:

URL: /api/reports/contracts-pilot/{pilot_certification}
Method: GET

Data: pilot_certification (use in url after /contracts-pilot/

REMOVE{ } in URL before use.

Report percentage of resource type transported by each pilot:

URL: /api/reports/resource-pilot
Method: GET

No additional information is needed

Report total weight in tons of each resource sent and received by each planet.

URL: /api/reports/resource-planet
Method: GET

No additional information is needed



To perform the tests populate the database, you can use all the seeds available in the project or enter the data manually. After that use the command php artisan test

REMEMBER THAT YOUR ACTION ARE MONITORED BY THE INTERGALACTIC AGENCY, BE CAREFUL.

MAY THE FORCE BE WITH YOU!

About

Back-end galaxy-federation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages