No project description provided
Project description
Fast Template
Easily generate a template for your FastAPI applications, complete with JWT authentication and Google sign-in.
Installation
You can install Fast Template via pip
:
pip install fast_template
Or using poetry
:
poetry add fast_template
Usage
To initialize a project in an existing folder:
fast-template init project_name .
To create a new project:
fast-template init project_name
Once the template is set up, you'll need to create a .env
file as required by the settings.py
file (feel free to modify it to suit your needs).
Migrations
You can set up database migrations using Alembic:
alembic init migrations
For more information on using Alembic, check the official tutorial.
Features
Authentication
- JWT-based authentication is built-in.
- Google sign-in is fully integrated, right down to the database layer.
Extensible Folder Structure
The folder structure is designed to be modular and scalable, inspired by Philip Okiokio (LinkedIn, GitHub). It promotes loose coupling and clean separation of concerns.
Each operation is handled by three main layers:
- Router Layer: Defines FastAPI routes.
- Service Layer: Contains the business logic.
- Database Layer: Manages database interactions.
The data flow is structured as follows:
Router Layer → Service Layer → Database Layer
The service layer handles the data exchange between the router and the database, while the router serializes requests and passes them to the service.
Pre-configured Services
The root folder contains core services required for the backend, including:
- Database setup
- Redis caching
- Email templates
- Background workers (using ARQ)
- Logging configuration
- Application settings
Schema and Database Layers
- Schema: Pydantic models for serialization/deserialization, organized by feature (e.g., authentication schemas are in the
auth
folder). - Database: Handlers and ORM integration using SQLAlchemy.
Work in Progress
This package is a work in progress, created to streamline the setup of backend projects.
🐛 Bugs/Feature Requests
Contributions are welcome! Feel free to open a pull request or an issue for feature requests or bug reports.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fast_template_python-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5656579a98614df97b333663be888ea7bd21bf310a4dbae2ab397c5e2d52bb3 |
|
MD5 | 58ec73a592bc5625e8c7e7a519f18d1b |
|
BLAKE2b-256 | 46efe5f8d04c6468b3a27b722ab2e28a008e6cc7f939c505e322565e312f5560 |
Hashes for fast_template_python-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ec940a6eaeeb4cb2c1b30cd2b3c5608b8f5bd23d420dc9a590c7d57a9a6cda8 |
|
MD5 | 224719d62e8687aaa508429cfd0b7a78 |
|
BLAKE2b-256 | f1afb0d4cd83512df9aedb5e3502a42e73d8bcdb9f1e0d0422f49c50edadeddd |