Skip to content

Commit 32b8712

Browse files
authored
Merge pull request #1 from Cognitive-Stack/master
Master
2 parents 255df20 + ff97562 commit 32b8712

File tree

23 files changed

+2853
-25
lines changed

23 files changed

+2853
-25
lines changed

.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SECRET_KEY=
2+
ALGORITHM=
3+
ACCESS_TOKEN_EXPIRE_MINUTES=
4+
MONGO_DATABASE_NAME=
5+
MONGO_USERNAME=
6+
MONGO_PASSWORD=
7+
MONGO_HOST=
8+
MONGO_PORT=
9+
REDIS_URL=
10+
RABBITMQ_HOST=
11+
RABBITMQ_PORT=
12+
RABBITMQ_USERNAME=
13+
RABBITMQ_PASSWORD=
14+
RABBITMQ_VHOST=

.gitignore

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -167,28 +167,5 @@ cython_debug/
167167
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168168
#.idea/
169169

170-
# Abstra
171-
# Abstra is an AI-powered process automation framework.
172-
# Ignore directories containing user credentials, local state, and settings.
173-
# Learn more at https://abstra.io/docs
174-
.abstra/
175-
176-
# Visual Studio Code
177-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178-
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
180-
# you could uncomment the following to ignore the enitre vscode folder
181-
# .vscode/
182-
183-
# Ruff stuff:
184-
.ruff_cache/
185-
186170
# PyPI configuration file
187171
.pypirc
188-
189-
# Cursor
190-
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
191-
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192-
# refer to https://docs.cursor.com/context/ignore-files
193-
.cursorignore
194-
.cursorindexingignore

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Target to install dependencies and setup the environment
2+
install:
3+
bash install.sh
4+
5+
# Target to run the FastAPI application
6+
run:
7+
# Add poetry to the PATH
8+
export PATH=$$HOME/.local/bin:$$PATH && \
9+
poetry run uvicorn app.main:app --reload

README.md

Lines changed: 106 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,106 @@
1-
# fastapi-template
2-
This is the template for fastapi service development
1+
# FastAPI Template API
2+
3+
API for FastAPI Template - A platform for managing your projects with AI.
4+
5+
## Features
6+
7+
* **Authentication:** Secure user authentication using JWT.
8+
* **User Management:** Create, read, update, and delete users.
9+
* **Asynchronous:** Built with FastAPI for high performance.
10+
* **MongoDB:** Uses MongoDB as the database.
11+
* **RabbitMQ:** Uses RabbitMQ for message queuing.
12+
13+
## Getting Started
14+
15+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
16+
17+
### Prerequisites
18+
19+
* Python 3.12+
20+
* Poetry
21+
* Docker
22+
23+
### Installation
24+
25+
1. **Clone the repository:**
26+
27+
```bash
28+
git clone https://github.com/your-username/fastapi-template.git
29+
cd fastapi-template
30+
```
31+
32+
2. **Run the installation script:**
33+
34+
The `install.sh` script will:
35+
* Install `poppler-utils`.
36+
* Install Python and Poetry if they are not already installed.
37+
* Install project dependencies using Poetry.
38+
* Install Docker if it is not already installed.
39+
* Pull and run MongoDB, Redis, and RabbitMQ Docker containers.
40+
41+
```bash
42+
bash install.sh
43+
```
44+
45+
## Usage
46+
47+
To run the FastAPI application, use the following command:
48+
49+
```bash
50+
make run
51+
```
52+
53+
The application will be available at `http://127.0.0.1:8000`.
54+
55+
## Project Structure
56+
57+
```
58+
app/
59+
├── __init__.py
60+
├── main.py
61+
├── controllers/
62+
│ └── users.py
63+
├── core/
64+
│ └── settings.py
65+
├── dependencies/
66+
│ └── auth.py
67+
├── middlewares/
68+
│ └── cors_middleware.py
69+
├── models/
70+
│ ├── base.py
71+
│ └── users.py
72+
├── routers/
73+
│ ├── auths.py
74+
│ └── users.py
75+
├── schemas/
76+
│ ├── auths.py
77+
│ └── users.py
78+
├── utils/
79+
│ ├── mongodb.py
80+
│ ├── rabbitmq.py
81+
│ └── superuser.py
82+
└── workers/
83+
└── consumer.py
84+
```
85+
86+
## Dependencies
87+
88+
The project uses the following dependencies:
89+
90+
* **fastapi:** A modern, fast (high-performance), web framework for building APIs with Python 3.12+ based on standard Python type hints.
91+
* **uvicorn:** A lightning-fast ASGI server implementation.
92+
* **motor:** Asynchronous Python driver for MongoDB.
93+
* **python-jose:** A JOSE implementation in Python.
94+
* **passlib:** A library for hashing passwords.
95+
* **pydantic:** Data validation and settings management using Python type annotations.
96+
* **google-auth:** Google Authentication Library for Python.
97+
* **google-auth-oauthlib:** Google Authentication Library for Python with OAuthlib integration.
98+
* **pydantic-settings:** Pydantic settings management.
99+
* **python-multipart:** A streaming multipart parser for Python.
100+
* **aiohttp:** Asynchronous HTTP client/server framework.
101+
* **loguru:** A library which aims to bring enjoyable logging in Python.
102+
* **aio-pika:** An asynchronous AMQP client library for Python.
103+
104+
## License
105+
106+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

app/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)