This repository hosts the API backend for my personal portfolio.
The project is built with FastAPI and Ollama for advanced AI capabilities.
- FastAPI – Lightweight, fast (high‑performance) web framework.
- Ollama – Local model inference for quick AI responses.
- uv – Modern, dependency‑free package manager and build tool.
- Auto‑generated documentation via FastAPI’s built‑in OpenAPI support.
portfolio-api/
├── app/
│ └── main.py # FastAPI application entry point
├── tests/ # Placeholder for future tests
├── .gitignore
├── pyproject.toml # Project metadata and dependencies
└── README.md
Prerequisites
Python 3.10+ installed and available in yourPATH.
-
Clone the repo
git clone https://github.com/<your-username>/portfolio-api.git cd portfolio-api
-
Create the virtual environment
uv venv . # creates .venv in the project root
-
Install dependencies
uv sync
-
Run the development server
uv run start
The API will be available at
http://127.0.0.1:8000.- Swagger UI:
http://127.0.0.1:8000/docs - ReDoc:
http://127.0.0.1:8000/redoc
- Swagger UI:
- FastAPI docs – See the automatically generated docs at
/docs. - Testing – Add tests under the
tests/directory and run them with your preferred test runner. - Linting & Formatting – Use
rufforblackfor code style consistency.
For production deployments, consider:
- Using Docker to containerize the app.
- Deploying to a platform like Fly.io, Render, or Railway.
- Configuring environment variables (e.g.,
OLLAMA_HOST) for Ollama integration.
Feel free to open issues or pull requests. All contributions are welcome!
MIT License – see LICENSE for details.
Happy coding! 🚀