Skip to content

Latest commit

 

History

History
117 lines (78 loc) · 5.13 KB

README.md

File metadata and controls

117 lines (78 loc) · 5.13 KB

IFMS Dev Competition

RESTful API for managing the IFMS Development Competition

Latest Release Python3 Version FastAPI Pydantic Black


Federal Institute of Mato Grosso do Sul - IFMS - Campus Três Lagoas
Technology in Systems Analysis and Development - TADS

RESTful API: http://127.0.0.1:8000/v1/ifms-dev-competition/api

Swagger UI: http://127.0.0.1:8000/


Overview

This RESTful API was developed to support the exchange of HTML and CSS files between teams in the IFMS programming competition.

Dynamics

First: the pairs of each team will program independently and alternately, with each member in a language (HTML or CSS) one at a time.

Last: the final, one finalist pair per team, the same project for all teams, the order and the way of programming will be decided by the game.

Teams Count

By default, 30 code directories will be generated for First Dynamic, and 10 code directories for Last Dynamic.

Files

Each generated code directory will have two files: a HTML file type called index.html and a CSS file type called style.css.

Rate Limit

This application has a request rate limiting mechanism for API tagged routes, accepting up to 60 requests every 2 seconds. Requests beyond this limit will be responded with an HTTP 429 error.


Configuration

You can create an .env file to configure the following options:

Parameter Description Default
database_file Sets the database file (.db) absolute path database.db
host Sets the host address to listen on 127.0.0.1
port Sets the server port on which the application will run 8000
reload Enable auto-reload on file changes for local development false
workers Sets multiple worker processes 1
logging_file Enable saving logs to files false
debug Enable the debug mode and debug logs false
  • The reload and workers options are mutually exclusive.

  • Setting the host to 0.0.0.0 makes the application externally available.

  • Set the database_file like /home/user/project/repository/database.db.

  • Database backup files will be saved inside the /repository directory.

Take a look at the .env.example file.


Run locally

You will need Python3 v3.11 with Pip and Venv installed.

# Create new Venv
make venv

# Activate Venv
source .venv/bin/activate

# Install dependencies with Poetry
(.venv) make install

# Install dependencies with Pip
(.venv) pip3 install -r requirements.txt

# Run the API locally
(.venv) make run

Run in Docker

You will need Docker installed.

# Run the App in Docker Container
make docker

This project is licensed under the terms of the MIT license