This is a Recipe Management App built using FastAPI for the backend, PostgreSQL as the database, and Celery with Redis for asynchronous task processing. The app allows users to upload recipe images, process them using OCR (Tesseract), and save structured recipe details such as title, description, ingredients, and instructions.
- User Authentication: Secure login and access control for recipe owners.
- Recipe Management: Create, edit, delete, and view recipes.
- OCR Integration: Extract text from uploaded recipe images.
- Asynchronous Processing: Celery and Redis handle image processing in the background.
- Database Storage: PostgreSQL database to store recipe details.
- Dynamic Frontend: Templates with Tailwind CSS for modern UI.
- Backend: FastAPI (Python 3.12)
- Database: PostgreSQL
- Task Queue: Celery with Redis
- OCR: Tesseract OCR
- Frontend: Jinja2 Templates with Tailwind CSS
- Containerization: Docker (Optional for deployment)
$ git clone <repository_url>
$ cd fastapi_postgresql$ python -m venv venv
$ source venv/bin/activate # Linux/MacOS
$ .\venv\Scripts\activate # Windows$ pip install -r requirements.txtCreate a .env file and specify the following:
DATABASE_URL=postgresql://user:password@localhost/recipes_db
REDIS_URL=redis://localhost:6379/0
SECRET_KEY=your_secret_key
$ alembic upgrade head$ redis-server$ celery -A celery_worker.celery_app worker --pool=solo --loglevel=info$ uvicorn app.main:app --reload- Open the browser at
http://127.0.0.1:8000/ - Register/Login to create a user account.
- Upload a recipe image or add recipes manually.
- View and edit recipes in the dashboard.
- POST /recipes/upload - Upload and process a recipe image.
- GET /recipes/{id} - Fetch a recipe by ID.
- DELETE /recipes/{id} - Delete a recipe.
- GET /tasks/{task_id}/status - Check the status of an OCR task.
- Check Redis keys:
$ redis-cli keys *- Check Celery Workers:
$ celery -A celery_worker.celery_app status- Inspect Queues:
$ celery -A celery_worker.celery_app inspect active_queues- Add recipe image preview.
- Implement user comments and ratings for recipes.
- Deploy the app using Docker and AWS services.
**Author Ilyas - Owner and Developer
License: MIT License