MCPcopy Index your code
hub / github.com/alperencubuk/fastapi-celery-redis-postgres-docker-rest-api

github.com/alperencubuk/fastapi-celery-redis-postgres-docker-rest-api @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
33 symbols 101 edges 9 files 8 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FastAPI Celery Redis Postgres Docker REST API

Summary:

This is simple REST API project using a modern stack with FastAPI.
Celery for background tasks
Redis for the message broker
PostgreSQL for the database
SqlAlchemy for ORM
Docker for containerization
Docker Compose for defining and running multi-container

Summary


Endpoints Table:

Request URL Description HTTP
/users/{count} Get random user data from randomuser.me/api and add database using Celery. (Delay = 10 sec) POST
/users/{count}/{delay} Get random user data from randomuser.me/api and add database using Celery. POST
/users/{user_id} Get user from database. GET
/weathers/{city} Get weather data from api.collectapi.com/weather and add database using Celery. (Delay = 10 sec) POST
/weathers/{city}/{delay} Get weather data from api.collectapi.com/weather and add database using Celery. POST
/weathers/{city} Get weather from database. GET
/tasks/{task_id} Get task status. GET

Requirements:

  • Docker and Docker Compose

How to Run:

docker-compose up --build

Example Requests:


Request:

```http request POST /users/10


#### Response:
```json
{
    "task_id": "44178ce4-6f7a-4a6b-97fd-0de72a055360"
}

Request:

```http request GET /users/5


#### Response:
```json
{
    "first_name": "Lorenzo",
    "last_name": "Domínguez"
}

Request:

```http request POST /weathers/erzincan


#### Response:
```json
{
    "task_id": "46f5f77a-5fd7-41dd-898b-235d5def4a70"
}

Request:

```http request GET /weathers/erzincan


#### Response:
```json
{
    "erzincan": [
        {
            "date": "08.10.2022",
            "day": "Cumartesi",
            "description": "orta şiddetli yağmur",
            "degree": 26.02
        },
        {
            "date": "09.10.2022",
            "day": "Pazar",
            "description": "hafif yağmur",
            "degree": 18.59
        },
        {
            "date": "10.10.2022",
            "day": "Pazartesi",
            "description": "açık",
            "degree": 17.85
        },
        {
            "date": "11.10.2022",
            "day": "Salı",
            "description": "açık",
            "degree": 17.49
        },
        {
            "date": "12.10.2022",
            "day": "Çarşamba",
            "description": "kapalı",
            "degree": 17.42
        },
        {
            "date": "13.10.2022",
            "day": "Perşembe",
            "description": "hafif yağmur",
            "degree": 19.42
        },
        {
            "date": "14.10.2022",
            "day": "Cuma",
            "description": "hafif yağmur",
            "degree": 16.37
        }
    ]
}

Request:

```http request GET /tasks/46f5f77a-5fd7-41dd-898b-235d5def4a70


#### Response:
```json
{
    "state": "SUCCESS"
}

Alperen Cubuk

Core symbols most depended-on inside this repo

crud_error_message
called by 2
api/crud.py
crud_add_user
called by 1
api/crud.py
crud_get_user
called by 1
api/crud.py
crud_add_weather
called by 1
api/crud.py
crud_get_weather
called by 1
api/crud.py
add_user
called by 1
api/main.py
add_weather
called by 1
api/main.py
get_db_session
called by 0
api/database.py

Shape

Function 19
Route 8
Class 6

Languages

Python100%

Modules by API surface

api/main.py16 symbols
api/crud.py5 symbols
api/schemas.py4 symbols
api/tests/tests.py3 symbols
api/tasks.py2 symbols
api/models.py2 symbols
api/database.py1 symbols

Datastores touched

alphaDatabase · 1 repos

For agents

$ claude mcp add fastapi-celery-redis-postgres-docker-rest-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page