Skip to content

A minimal FastApi app with async MongoDB, async pytest and some other cool features.

Notifications You must be signed in to change notification settings

MbxrAteeq/fastapi-task

Repository files navigation

FastAPI Task

🧩 Features

  • Python
  • FastApi
  • Async MongoDB
  • Poetry
  • Pydantic
  • Async Pytest
  • Sentry
  • Docker
  • PreCommit Hooks
  • JWT Authentication

🚚 Clone the repository

git clone git@github.com:MbxrAteeq/fastapi-task.git

📦 Setup Docker Environment

cp .env.sample .env
docker compose build
docker compose up -d

🏗️ Local Setup without Docker

1. create virtual environment

cd fastapi-task
python -m venv venv
source venv/bin/activate

2. Install requirements

bash ./setup.sh

3. Create .env file in the root directory

cp .env.sample .env

Update the MONGODB_URL environment variables to this mongodb://localhost:27017/.

4. Start the application:

bash run.sh

The server will be accessible here and swagger docs here 😎.

🧪 Run test cases

pytest -vv -s