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
RELOADandWORKERSoptions are mutually exclusive. -
Setting the
HOSTto0.0.0.0makes the application externally available. -
Set the
DATABASE_FILElike/home/user/project/repository/database.db. -
Set
WORKERS, maximum 4, to start multiple server processes. -
Database backup files will be saved inside the
/repositorydirectory.
Tip
Take a look at the .env.example file.
You will need Python3.12 with Pip and Venv installed.
# Create new Venv
make venv
# Activate Venv
source .venv/bin/activate
# Install dependencies with Poetry [1]
(.venv) make poetry-install
# Install dependencies with Pip [2]
(.venv) make pip-install
# Run the App locally
(.venv) make runYou will need Docker installed.
# Run the App in Docker Container
make dockerFor questions or concerns please contact me at sir.silvabmauricio@gmail.com.
