Skip to content

atyrode/gitemplate

Gitemplate

Image License Python FastAPI Code style: black

A production-ready FastAPI template specifically designed for building AI/LLM-powered web applications.

  • πŸ€– Optimized for LLM integration and AI workflows
  • πŸš€ FastAPI for high-performance API development
  • 🎨 Jinja2 templating engine
  • πŸ’… TailwindCSS for utility-first styling
  • ⚑️ Deploy your app in just an hour

Here are some projects based on this template: gitingest.com and gitdiagram.com.

We'd love to see what you build! Share your projects in our Discussions section and become part of our growing ecosystem.

TL;DR

You may copy and paste the following code block to get started:

git clone https://github.com/atyrode/gitemplate.git && cd gitemplate
python -m venv venv && source venv/bin/activate  # Windows: `venv\Scripts\activate`
pip install rich
python template.py -i
cd src && python -m uvicorn server.main:app --reload

You can now start developping in the src/your_package_name/main.py file. This is the entrypoint of your service.

✨ Features

  • Production-Ready Structure: Organized project layout following best practices
  • Modern Stack:
    • FastAPI for high-performance APIs
    • Jinja2 templating engine for the front-end
    • TailwindCSS for modern styling
  • Security:
    • Built-in rate limiting
    • Trusted host middleware
    • Security headers configuration
    • CORS configuration
    • Environment variables management
  • Deployment Ready:
    • Docker support with multi-stage builds
    • GitHub Actions workflows for:
      • CI/CD pipeline
      • PyPI publishing
      • Docker image building
    • Health check endpoints
    • Production-grade logging
  • Developer Experience:
    • Pre-configured development tools:
      • Black for code formatting
      • isort for import sorting
      • pylint for code analysis
      • mypy for type checking
      • pytest for testing
    • Pre-commit hooks for code quality
    • Type hints and comprehensive docstrings
    • Hot reload during development
  • Template System:
    • Easy customization through template.py
    • Flexible project structure
    • Configurable dependencies

πŸš€ Quick Start

  1. Use this template by clicking "Use this template" on GitHub or clone it:
git clone https://github.com/atyrode/gitemplate.git
cd gitemplate
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: `venv\Scripts\activate`
pip install rich # For better logging
  1. Set up your project details in template.py:
author: "Your Name"
package_name: "your_package"
project_name: "Your Project"
...
  1. Apply the template:
python template.py
  1. Run the development server:
cd src
python -m uvicorn server.main:app --reload --host 0.0.0.0 --port 8000

Visit http://localhost:8000 to see your application running! You can now start developping in the src/your_package_name/main.py file. This is the entrypoint of your service.

πŸ’» Development

Running Tests

pytest

Code Formatting

The project uses pre-commit hooks to maintain code quality:

# Format code
black .

# Sort imports
isort .

# Lint code
pylint src/

# Run pre-commit hooks
pre-commit run --all-files

# Or install pre-commit hooks to run automatically
pre-commit install

Docker Support

Build and run using Docker:

docker build -t your-app-name .
docker run -p 8000:8000 your-app-name

🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project. In its current state, the file is templated, but it should give you a good starting point.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Palette

The colors used for this project are the following: https://coolors.co/4a8394-62aec5-88c0d5-add2e4-ffffff-f678a7-ee5c8d-e64072-d91c55

πŸ™ Acknowledgments

⭐ Project Growth

Star History Chart

Releases

No releases published

Packages

No packages published

Contributors 26