Skip to content

mauprogramador/ifms-dev-competition

Repository files navigation

IFMS Dev Competition

IFMS

RESTful API for managing the IFMS Development Competition

Lint & Test Latest Release Python3 version

FastAPI Pydantic OpenCV Playwright HTTPX Poetry Pytest

Black MyPy Pylint


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


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.

  • Set WORKERS, maximum 4, to start multiple server processes.

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

Tip

Take a look at the .env.example file.


Run locally with Poetry or Pip

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 run

Run with Docker

You will need Docker installed.

# Run the App in Docker Container
make docker

For questions or concerns please contact me at sir.silvabmauricio@gmail.com.

License  •  Latest Release  •  Changelog

About

RESTful API for managing the IFMS Development Competition

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages