Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikhil25803/products-api
A products APIs to manage catalog with integration of AWS S3 as file storage service and SQLite as database.
https://github.com/nikhil25803/products-api
aws-s3 fastapi python sqlite
Last synced: 18 days ago
JSON representation
A products APIs to manage catalog with integration of AWS S3 as file storage service and SQLite as database.
- Host: GitHub
- URL: https://github.com/nikhil25803/products-api
- Owner: nikhil25803
- License: mit
- Created: 2023-03-23T18:13:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-24T15:39:18.000Z (over 1 year ago)
- Last Synced: 2024-05-02T03:40:30.143Z (7 months ago)
- Topics: aws-s3, fastapi, python, sqlite
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Products API
A products APIs to manage catalog with integration of AWS S3 as file storage service and SQLite as database.### Project setup
+ Fork and clone the repository
```powershell
https://github.com//products-api
```+ Create and activate a virtual environment
```powershell
python -m venv env
``````powershell
source env/scripts/activate
```+ Install the dependencies
```powershell
pip install -r requirements.txt
```+ Run the server
```
uvicorn main:app --reload
```*Running the server will create a `products.db` file locally as a database service*
+ Access the endpoints
```
http://127.0.0.1:8000/docs
```### Note
Upload a `.env` file with the following credentials
```js
AWS_ACCESS_KEY_ID =
AWS_SECRET_ACCESS_KEY =
AWS_REGION =
S3_Bucket =
S3_Key =
```
Add the mentioned fields respectively### Endpoints
+ **GET** `/` - Check server running status
+ **GET** `/products` - Get all the products
+ Optional - `search?` query to search products by name
+ **POST** `products/` - Create a new product as a form data (as a file is also needed to be posted)
+ Response
```py
{
"name": "string",
"category": "string",
"brand_name": "string",
"image_url": "string"
}
```
+ **Put** `products/{id}` - Update a product by id.
+ **Delete** `products/{id}` - Delete a product by id.