Installation and Usage

Follow the instructions below to install and use the project:

  1. Clone this repository to your local machine:
git clone https://github.com/skay1994/the-space-devs-api the-space-devs-api
  1. Navigate to the project directory:
cd the-space-devs-api
  1. Start the server using Docker Compose:
docker-compose up -d
  1. Access container ssh:
docker exec -it server /bin/sh
  1. Inside the container, run the following command to install project dependencies using Composer:
composer install
  1. Run the migrations to create the database tables:
php artisan migrate
  1. Run the cron command to import data from The Space Devs project:
php artisan the-space-devs:launch-import
  1. Access the API in your browser or API client:
http://localhost:8080

API Endpoints

The following endpoints are available in the REST API:

  • POST /api/login: Creates a new user token with email and password
  • POST /api/logout: Removes a user token currently logged in
  • GET /api/: Returns a message "REST Back-end Challenge 20210221 Running"
  • PUT /api/launchers/:launchId: Responsible for receiving updates made
  • DELETE /api/launchers/:launchId: Removes a launch from the database
  • GET /api/launchers/:launchId: Retrieves information about a specific launch from the database
  • GET /api/launchers: Lists the launchers from the database in a paginated manner