FastAPI & Stripe Mini eCommerce
Open-source mini eCommerce project that loads the products from JSON files saved in the templates directory (no database required) and uses a decent UI for page styling - Powered by FastAPI & Stripe.
👉 FastAPI & Stripe eCommerce -
Video Presentation
| Status | Item | info |
|---|---|---|
| ✅ | FastAPI | For backend logic |
| ✅ | Stripe | Payment processor |
| ✅ | Soft UI Design | (Free Version) by Creative-Tim |
| ✅ | JSON | Products definition - see sample |
| ✅ | Automatic Products Discovery | Source DIR: templates\products |
| ❌ | Deployment | Docker & Pages Compression |
| ❌ | CI/CD | Render Deployment Platform |
The process is basically the usual set up for any Python app: environment set up, dependencies install, and bootstrap.
👉 Step 1 -
Download the codefrom the GH repository (usingGIT)
$ git clone https://github.com/app-generator/ecommerce-fastapi-stripe.git
$ cd ecommerce-fastapi-stripe👉 Step 2 - Rename
env.sampleto.envand provide the Stripe Secrets
- Edit
STRIPE_SECRET_KEY- provided by Stripe Platform - Edit
STRIPE_PUBLISHABLE_KEY- provided by Stripe Platform
👉 Step 3 -
Install dependencies
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt👉 Step 4 -
Start the App
$ uvicorn src.app:app --reloadVisit http://localhost:8000 in your browser. For another port, use --port 8099 directive.
- Go to
src/templates/productsdirectory - Create a new
JSONfile with data:name: Used in product page & Cardsprice: Used for paymentcurrency: Used for paymentinfo: used in cardsshort_description: used in product pagefull_description: used in product page
- Create Media Files
- Go to
src/static/products - Create a directory using the same name as for
JSONfile- Create
card.jpg: 500x335px - Create
cover.jpg: 2100x1400px
- Create
- Go to
- Start or refresh the app
- The new product should be listed in the
products/page - Product page is available at address:
http://localhost:8000/products/<SLUG>/where the SLUG is the name of the JSON file
- The new product should be listed in the
Sample product page generated for Air ZOOM Pegasus, assets loaded from here
- FastAPI Framework - The official website
- Stripe Dev Tools - official docs
FastAPI & Stripe Mini eCommerce - Free sample provided by AppSeed.
