https://github.com/akileshjayakumar/my-fastapi-app
https://github.com/akileshjayakumar/my-fastapi-app
docker fastapi python
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/akileshjayakumar/my-fastapi-app
- Owner: akileshjayakumar
- License: mit
- Created: 2024-05-22T01:44:57.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T11:04:27.000Z (over 1 year ago)
- Last Synced: 2025-03-10T17:11:21.623Z (over 1 year ago)
- Topics: docker, fastapi, python
- Language: Python
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FastAPI App with Celery, RabbitMQ, Flower, and Docker
## Tech Stack
- **[FastAPI](https://fastapi.tiangolo.com/)**
- **[Celery](https://docs.celeryq.dev/en/stable/)**
- **[RabbitMQ](https://www.rabbitmq.com/documentation.html)**
- **[Flower](https://flower.readthedocs.io/en/latest/)**
- **[Docker](https://www.docker.com/)**
## Project Structure
```
my-fastapi-app/
├── app/
│ ├── __init__.py
│ ├── main.py
│ └── tasks.py
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
├── README.md
└── diagram.png
```
## Setup
1. **Clone the Repository**
```bash
git clone https://github.com/akileshjayakumar/my-fastapi-app
cd my-fastapi-app
```
2. **Build and Start Containers**
```bash
docker compose up --build
```
## Usage
1. **Access FastAPI Documentation**
Open [http://localhost:8000/docs](http://localhost:8000/docs) in your browser to explore the interactive API docs.
2. **Submit a Task**
- **Via Browser or Postman**:
- **Endpoint**: `POST http://localhost:8000/add/{a}/{b}`
- **Example**: `POST http://localhost:8000/add/3/4`
3. **Check Task Status**
- **Via Browser or Postman**:
- **Endpoint**: `GET http://localhost:8000/result/{task_id}`
- **Example**: `GET http://localhost:8000/result/`
4. **Monitor Tasks with Flower UI**
Open [http://localhost:5555](http://localhost:5555) in your browser to view real-time monitoring of Celery tasks.
## Architecture Diagram
