Git Product home page Git Product logo

backend's Introduction

CodeQL

backend

Slick Telemetry backend written in python with fastf1.

Table of Contents:

Setting up the project

What you'll need

Development

Environment variables

  • In project root, create a copy of .env.example as .env.

Python virtual environment

Installing dependencies

poetry config virtualenvs.in-project true # OPTIONAL
poetry install --sync --no-root --with dev,lint,test

Note: Ensure that the python interpreter in your IDE is set to the newly created virtual environment by poetry. If you have not modified poetry configuration, you can find the virtual environment location as stated here.

Virtual environment sanity check

  • Your IDE should activate the virtual environment for you automatically.
  • If it doesn't, you can follow either of these steps:
    • Check the path of poetry env - poetry env info.
    • Set poetry python interpreter path in VS Code OR
    • Run poetry shell OR
    • Execute the /Scripts/Activate script from the virtual environment located here.

Poe the Poet poetry plugin

poetry self add 'poethepoet[poetry_plugin]'
  1. Check available tasks:
    poetry poe
  2. Execute a task:
    poetry poe <task-name>
    For example, running the project formatters:
    poetry poe formatters

Installing git hooks

poetry poe git-hooks-setup

Running the project

  • Open up a terminal in your IDE.
  • Run python run.py to start the server.
  • Open your browser at http://localhost:8081.

Running tests

poetry poe tests

Docker

In /docker, create a copy of .env.example as .env.

App only

  • Build image
    docker build --file Dockerfile.dev --tag backend-dev .
  • Run container
    docker run --name backend-dev --publish 8081:8081 backend-dev --detach
  • Open your browser at http://localhost:8081.

With Supabase

  • Bring up the services
    cd docker
    docker compose --file compose.dev.yaml up --detach
  • Open your browser at

For other docker commands, see useful_commands.md

Interactive API docs

Contribution Guidelines

  • NEVER MERGE YOUR OWN CODE; ALWAYS RAISE A PR AGAINST dev!
  • Follow conventional commit format when authoring commit messages.
  • Always pull latest changes
    • There are several developers working on this project. Always pull/pull-rebase the latest, as necessary, from the branch you intend to commit your changes to.
    • If there are local staged/unstaged changes, please stash or discard them as appropriate and then use git pull --rebase.
    • If you don't want to use git CLI, to simplify these operations and have a visual representation of the git tree, we suggest to use a git GUI -
  • Branches:
    • main is the production mainline.
    • dev is the development line (default branch).
  • PR merge strategy on Github
    • Code should flow in the following direction through branches:
      feature/bug fix -> dev -> main
      
    • We'll be keeping a linear commit history and so using a combination of Rebase and merge and Squash and merge merge strategies.
    • Use Rebase and merge as default to ensure all commits from the branch to be merged are brought in individually to the target branch.
    • Squash and merge may be used ONLY when bringing in changes from a feature/bug fix branch into dev.
    • To maintain linear commit history, ensure to use push force when:
      • Bringing dev on the same commit as main (ie rebasing dev onto main).
    • More information on git rebase.
    • More information on PR merge strategies.
  • Jira issue linking
    • Commits and PRs must be linked to a Jira issue.
    • To do so, include the Jira issue key in the PR title and/or the commit message after the conventional commit type.
    • More information on Jira smart commits.

Deployment

// TODO

backend's People

Contributors

borolepratik avatar github-actions[bot] avatar lombardoc4 avatar dependabot[bot] 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.