Skip to content

VictorAugDB/Intergalactic-Federation

Repository files navigation

Intergalactic-Federation

A complete system to manage your intergalatic travels

Requirements

  1. AcceptTransportContract
  2. AddPilot
  3. AddShip
  4. ListOpenContract
  5. PublishContracts
  6. RefuelShip
  7. SettleContract
  8. TravelBetweenPlanets

Step by step to run application on your machine

Prerequisite:

  • Have installed on your machine the Docker: Link and instructions to install an configure Docker for Windows
  • Have yarn installed npm install --global yarn
  • Beekeeper, or another database manager (Optional, only if you need to see the data and application reports) Beekeeper

Run the following commands in sequence in the terminal

OBS: it is necessary to wait for the previous one to finish executing (All the commands must be runned on application folder)

  yarn
  
  docker-compose up

or

  npm i
  
  docker-compose up

OBS: (I didn't test if the npm commands takes errors, prefer to use yarn to avoid errors)

If you se this the application is running correctly

image

After see this run the following command

yarn typeorm migration:run

or

npm run typeorm migration:run

Testing the API

To run the application tests run

  yarn test

To make requests and test with REST you have two choices

With the application running, go to the browser and write http://localhost:3333/docs/ check the swagger docs and make requests

Go to postman and import the file that has on the root called intergalatic_federation_REQUESTS and make requests

Application flow

Create a ship --> Create a pilot --> Publish a contract --> Accept a contract --> Settle a contract

You can optionally Travel between planets, Refuel ship if you need, and List the open contracts

View the application database

OBS: You need an database manager this images is from Beekeeper, but the credentials can be used on another database manager On the new connection selection postgres

Add: User: adminUser, password: root,

Default database: intergalatic-federation

image

Click connect If the migrations:run was succesful the entities must be equal to the next image

image

ER Diagram

image

About

A complete system to manage your intergalatic travels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published