Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SECRET_KEY=
ALGORITHM=
ACCESS_TOKEN_EXPIRE_MINUTES=
MONGO_DATABASE_NAME=
MONGO_USERNAME=
MONGO_PASSWORD=
MONGO_HOST=
MONGO_PORT=
REDIS_URL=
RABBITMQ_HOST=
RABBITMQ_PORT=
RABBITMQ_USERNAME=
RABBITMQ_PASSWORD=
RABBITMQ_VHOST=
23 changes: 0 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,28 +167,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the enitre vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Cursor
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
# refer to https://docs.cursor.com/context/ignore-files
.cursorignore
.cursorindexingignore
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Target to install dependencies and setup the environment
install:
bash install.sh

# Target to run the FastAPI application
run:
# Add poetry to the PATH
export PATH=$$HOME/.local/bin:$$PATH && \
poetry run uvicorn app.main:app --reload
108 changes: 106 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,106 @@
# fastapi-template
This is the template for fastapi service development
# FastAPI Template API

API for FastAPI Template - A platform for managing your projects with AI.

## Features

* **Authentication:** Secure user authentication using JWT.
* **User Management:** Create, read, update, and delete users.
* **Asynchronous:** Built with FastAPI for high performance.
* **MongoDB:** Uses MongoDB as the database.
* **RabbitMQ:** Uses RabbitMQ for message queuing.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

* Python 3.12+
* Poetry
* Docker

### Installation

1. **Clone the repository:**

```bash
git clone https://github.com/your-username/fastapi-template.git
cd fastapi-template
```

2. **Run the installation script:**

The `install.sh` script will:
* Install `poppler-utils`.
* Install Python and Poetry if they are not already installed.
* Install project dependencies using Poetry.
* Install Docker if it is not already installed.
* Pull and run MongoDB, Redis, and RabbitMQ Docker containers.

```bash
bash install.sh
```

## Usage

To run the FastAPI application, use the following command:

```bash
make run
```

The application will be available at `http://127.0.0.1:8000`.

## Project Structure

```
app/
├── __init__.py
├── main.py
├── controllers/
│ └── users.py
├── core/
│ └── settings.py
├── dependencies/
│ └── auth.py
├── middlewares/
│ └── cors_middleware.py
├── models/
│ ├── base.py
│ └── users.py
├── routers/
│ ├── auths.py
│ └── users.py
├── schemas/
│ ├── auths.py
│ └── users.py
├── utils/
│ ├── mongodb.py
│ ├── rabbitmq.py
│ └── superuser.py
└── workers/
└── consumer.py
```

## Dependencies

The project uses the following dependencies:

* **fastapi:** A modern, fast (high-performance), web framework for building APIs with Python 3.12+ based on standard Python type hints.
* **uvicorn:** A lightning-fast ASGI server implementation.
* **motor:** Asynchronous Python driver for MongoDB.
* **python-jose:** A JOSE implementation in Python.
* **passlib:** A library for hashing passwords.
* **pydantic:** Data validation and settings management using Python type annotations.
* **google-auth:** Google Authentication Library for Python.
* **google-auth-oauthlib:** Google Authentication Library for Python with OAuthlib integration.
* **pydantic-settings:** Pydantic settings management.
* **python-multipart:** A streaming multipart parser for Python.
* **aiohttp:** Asynchronous HTTP client/server framework.
* **loguru:** A library which aims to bring enjoyable logging in Python.
* **aio-pika:** An asynchronous AMQP client library for Python.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading