An open API service indexing awesome lists of open source software.

https://github.com/mauprogramador/ifms-dev-competition

RESTful API for managing the IFMS Development Competition
https://github.com/mauprogramador/ifms-dev-competition

competition development fastapi ifms pydantic pytest python3 restful-api

Last synced: about 2 months ago
JSON representation

RESTful API for managing the IFMS Development Competition

Awesome Lists containing this project

README

          

# 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](https://www.ifms.edu.br/campi/campus-tres-lagoas)


Technology in Systems Analysis and Development  •  [TADS](https://www.ifms.edu.br/campi/campus-tres-lagoas/cursos/graduacao/analise-e-desenvolvimento-de-sistemas)

- RESTful API:
- Swagger UI:

---

## 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`](./.env.example) file.

---

## Run locally with Poetry or Pip

You will need [Python3.12](https://www.python.org/downloads/release/python-31211/) with [Pip](https://pip.pypa.io/en/stable/installation/) and [Venv](https://docs.python.org/3/library/venv.html) installed.

```bash
# 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](https://www.docker.com/) installed.

```bash
# Run the App in Docker Container
make docker
```

---

For questions or concerns please contact me at .

[License](./LICENSE)
 • 
[Latest Release](https://github.com/mauprogramador/ifms-dev-competition/releases/latest)
 • 
[Changelog](./CHANGELOG.md)