Skip to content

A products APIs to manage catalog with integration of AWS S3 as file storage service and SQLite as database.

License

Notifications You must be signed in to change notification settings

nikhil25803/products-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
https://github.com/<github_username>/products-api
  • Create and activate a virtual environment
python -m venv env
source env/scripts/activate
  • Install the dependencies
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

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?<name> 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
    {
        "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.

About

A products APIs to manage catalog with integration of AWS S3 as file storage service and SQLite as database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published