RESTful API for managing the IFMS Development Competition
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/
This RESTful API was developed to support the exchange of HTML and CSS files between teams in the IFMS programming competition.
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.
By default, 30 code directories will be generated for First Dynamic, and 10 code directories for Last Dynamic.
Each generated code directory will have two files: a HTML
file type called index.html and a CSS
file type called style.css
.
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.
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
andworkers
options are mutually exclusive. -
Setting the
host
to0.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.
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
You will need Docker installed.
# Run the App in Docker Container
make docker
This project is licensed under the terms of the MIT license