https://github.com/finalsa/base-fastapi-api
This is the base for the main projects made with fasta-I
https://github.com/finalsa/base-fastapi-api
fastapi
Last synced: 9 months ago
JSON representation
This is the base for the main projects made with fasta-I
- Host: GitHub
- URL: https://github.com/finalsa/base-fastapi-api
- Owner: finalsa
- License: mit
- Created: 2021-06-25T02:29:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-19T04:31:45.000Z (over 1 year ago)
- Last Synced: 2025-01-21T16:23:00.372Z (11 months ago)
- Topics: fastapi
- Language: Python
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Base-fastapi-API
The api arquitecture is based on the good practices for Fast-API by @tialongo, for more information check https://fastapi.tiangolo.com
## API Reference
All the models should have the same acces methods, you should check
http://localhost:8000/docs for testings all the methods
#### Get all items
```http
GET /items
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `token` | `string` | **Required**. Your API key |
#### Get item
```http
GET /api/items/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to fetch |
#### Post Item
```http
POST /items/
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to fetch |
#### Put Item
```http
PUT /items/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to fetch |
#### Delete Item
```http
DELETE /items/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to fetch |
## Run Locally
Clone the project
```bash
git clone ${project_link}
```
Go to the project directory
```bash
cd ${project_name}
```
Create a virutal environment
```bash
virutalenv venv
```
Activate the virutalenv
```bash
. ./venv/bin/activate
```
Install dependencies
```bash
python3 -m pip install -r requirements.txt
```
Update the db
```bash
alembic revision --autogenerate -m "made some changes"
alembic upgrade head
```
Start the server
```bash
cd app
python3 main.py
```
Start the celery server
```bash
cd app
celery -A celery_app worker -B -l info
```
## Deployment
To deploy this project run
```bash
./install.sh
```
## Documentation
[Documentation](https://linktodocumentation)
## License
The project is licensed only for the use by the team.