This is a quick-start template for setting up a FastAPI microservice with OpenAI integration. Perfect for building lightweight API prototypes where a UI isn't needed initially. The project is containerized with Docker for easy setup and deployment.
Prototype-Mini is the lightweight FastAPI version of Prototype. Use Prototype for full-stack Django projects with UI, and Prototype-Mini for fast API-only microservices.
Before starting, ensure you have:
- Docker and Docker Compose installed (latest versions recommended)
git clone https://github.com/vorniches/prototype-mini your_app_name
cd your_app_nameRun the following command to set up the environment:
./setup.shThis will:
- Create the FastAPI project structure (if not already present)
- Move the
openai_helper.pyto the appropriate directory - Build and start the Docker containers
The FastAPI server will be available at:
- http://localhost:9019
- http://localhost:9019/docs (Interactive API Docs)
-
Copy the
example.envfile to.env:cp example.env .env
-
Edit
.envto include your OpenAI API key:OPENAI_API_KEY=<your_openai_api_key>
This project is licensed under the MIT License. See the LICENSE file for details.