Skip to content

One of the largest open database on Formula 1. A SQLite database and a Node.js API ready to be used with race results, teams, times per lap, pit stops, free-practices and much more!

License

Notifications You must be signed in to change notification settings

enrique-lozano/F1-World-API

Repository files navigation

F1 World API & Database 🗂️🏎️

Welcome to one of the largest open database on Formula 1. A SQLite database and a Node.js API ready to be used with race results, teams, times per lap, pit stops, free-practices and much more!

Table of Contents
  1. Run the code locally
  2. Manage the database
  3. Contributing
  4. Contact

Run the API locally 🚀

The following explains how to run the API locally. This way you will be able to investigate on your own how it is done, create new features, fix bugs or use it in your projects.

Prerequisites

The API has developed in Node and TypeScript, so you will need to have installed Node. Consult here your installation options. Additionally, it is recommended (but not necessary) to have git installed on your device

Installation

Open a terminal on your computer and go to the folder where you want to place the project. Then clone the project and install the dependencies by typing the following commands:

git clone https://github.com/enrique-lozano/F1-World-API.git
cd F1-World-API

Instead of this steps, you could also download the zip of the repo from GitHub and open a terminal in the extracted zip file.

After this steps, with the terminal pointing to the project directory, install the required dependencies by typing in it the following command:

npm install

If everything went correctly these commands will finish executing without errors.

Create the database in SQLite

Now you will have to create and populate the database on your machine, otherwise when running the API it will not find any data. To do this, run the following commands:

npm run import-db

Start the server

Now you are already finishing! It only remains to prove that everything goes as it should. For that, you can run npm run start on your terminal. When this command finish, you can start receiving data from the API. Try to put http://localhost:3200/api/drivers/adrian-sutil in your favorite browser. You should see how the information of this driver in JSON format is shown:

Data in the browser

To see the avalaible routes (or API calls) that you can access, you can go to our swagger documentation. Here you will have described all the calls you can make, their parameters, etc.

Swagger screenshot

NOTE: The content you see may differ from what is shown in the screenshots.

Manage the database 🗂️

If you want to collaborate by adding/correcting records in our database or simply see how we have organized all the information, you can go to this directory. In it, you will find all the necessary information, and if you have any questions, do not hesitate to ask!

Contributing 🙋🏻

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make here are greatly appreciated.

Read through our contributing guidelines to learn about how you can collaborate making this API better. All Pull Requests are welcome and will be studied without exception!

Why to contribute?

  • We can learn for you and you can learn from us.
  • You'll appear in our contributors wall.
  • You can include it in your CV/LinkedIn and show recruiters that you contribute to open-source projects.
  • You'll make Monekin better.
  • You can develop the features that you miss in the app yourself, the way you want them.
  • You'll play around and learn cutting-edge technologies.

About

One of the largest open database on Formula 1. A SQLite database and a Node.js API ready to be used with race results, teams, times per lap, pit stops, free-practices and much more!

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks