This is a simple invoice API built with FastAPI, PostgreSQL, and Docker. It allows you to create, retrieve, update, and delete invoices. The API also supports user authentication and authorization.
- Create, retrieve, update, and delete invoices
- User authentication and authorization
- PDF generation for invoices
- Email notifications for invoice events
- Docker support for easy deployment
- Celery for background tasks
- Python 3.8 or higher
- PostgreSQL
- Docker (for deployment)
- Docker Compose (for local development)
- Clone the repository:
git clone https://github.com/yourusername/invoice-api.git cd invoice-api - Create a
.envfile in the root directory and set the required environment variables. You can use the.env.examplefile as a reference. - Install the required Python packages:
pip install -r requirements.txt
- Run the database migrations:
alembic upgrade head
- Start the application:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
- (Optional) If you want to run the application using Docker, use the following command:
docker-compose up --build
You can access the API at http://localhost:8000. The API documentation is available at http://localhost:8000/docs.
To run the tests, use the following command:
pytest