Git Product home page Git Product logo

app-generator / ecommerce-fastapi-stripe Goto Github PK

View Code? Open in Web Editor NEW
76.0 4.0 23.0 9.03 MB

FastAPI Stripe Sample - Soft UI Design (Free Sample) | AppSeed

Home Page: https://blog.appseed.us/fastapi-stripe-free-ecommerce/

License: MIT License

Python 0.87% CSS 17.21% JavaScript 1.00% SCSS 17.55% HTML 63.36% Dockerfile 0.01%
ecommerce fastapi fastapi-template fastapi-stripe stripe-fastapi-demo stripe-fastapi-example stripe-fastapi stripe-starter stripe-template fastapi-starter-template

ecommerce-fastapi-stripe's Introduction

FastAPI & Stripe Mini eCommerce

Open-source eCommerce Starter 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.


Features

Have questions? Contact Support (Email & Discord) provided by AppSeed

Free Version Rocket eCommerce Custom Development
✓ Stack: fastAPI, Bootstrap ✅ Stack: Django, TailwindCSS Everything in PRO, plus:
✓ Payments: Stripe ✅ Payments: Stripe 1mo Custom Development
✓ Minimal Bootstrap Design Stripe Products Import Team: PM, Developer, Tester
✓ No Database Local Products Customization ✅ Weekly Sprints
- Categories, TAGS ✅ Technical SPECS
- ✅ Multi-product Checkout ✅ Documentation
- Discounts Page 30 days Delivery Warranty
- Analytics -
- Transactions Tracking -
- Zero Configuration -
- FIGMA Project -
- PRO Support - Email & Discord -
------------------------------------ ------------------------------------ ------------------------------------
- 🚀 LIVE Demo 🛒 Order: $3,999 (GUMROAD)

FastAPI & Stripe Mini eCommerce - Open-Source Starter provided by AppSeed.


✨ Quick Start in Docker

👉 Step 1 - Download the code from the GH repository (using GIT)

$ git clone https://github.com/app-generator/ecommerce-fastapi-stripe.git
$ cd ecommerce-fastapi-stripe

👉 Step 2 - Start the APP in Docker

$ docker-compose up --build 

Visit http://localhost:5085 in your browser. The app should be up & running.


✨ Manual Build

The process is basically the usual set up for any Python app: environment set up, dependencies install, and bootstrap.


👉 Step 1 - Download the code from the GH repository (using GIT)

$ git clone https://github.com/app-generator/ecommerce-fastapi-stripe.git
$ cd ecommerce-fastapi-stripe

👉 Step 2 - Rename env.sample to .env and 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 --reload

Visit http://localhost:8000 in your browser. For another port, use --port 8099 directive.


✨ Create a new Product

  • Go to src/templates/products directory
  • Create a new JSON file with data:
    • name: Used in product page & Cards
    • price: Used for payment
    • currency: Used for payment
    • info: used in cards
    • short_description: used in product page
    • full_description: used in product page
  • Create Media Files
    • Go to src/static/products
    • Create a directory using the same name as for JSON file
      • Create card.jpg: 500x335px
      • Create cover.jpg: 2100x1400px
  • 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

Sample product page generated for Air ZOOM Pegasus, assets loaded from here


✨ Credits & Links



FastAPI & Stripe Mini eCommerce - Free sample provided by AppSeed.

ecommerce-fastapi-stripe's People

Contributors

app-generator avatar barreraalexander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ecommerce-fastapi-stripe's Issues

ENV vars - All are optional

Hello @barreraalexander

All env variables are optional with defaults:

  • Debug = True
  • SECRET_KEY = random 16 chars
  • Stripe secrets = None (Null)
  • SERVER_HOST - localhost:8000 (default uvicorn PORT)

Also, when the stripe secrets are not provided the UI shows the product but informs the user using an alert.

Flask version has all these evolutions

image

Docker file with non-standard name

Hello @barreraalexander,

Regarding Docker, two files are provided:

  • docker-compose.yaml -> OK
  • docker-compose copy.yaml -> Not ok

Please rename the 2nd docker-compose YAML with a suggestive name.
Also might help to specify on README what exactly does compared to the simple set up.

Ty!

Docker execution is not successful

Hello @barreraalexander

On a fresh clone, the docker-compose up --build command is not successful:

The Docker setup should copy env.sample -> ENV or set the secrets in ENV

Note: take a look at the Flask version

Ty!

$ docker-compose up --build 

ERROR: Couldn't find env file: D:\work\repo-samples\sample-fastapi-stripe\.env

Stripe OAuth Flow

Hello @barreraalexander

Please document the set up flow for OAuth Stripe using this document.

Just the minimal steps and please specify also the required configuration on the Stripe platform.

Ty!

Product Page not accessible

Hello @barreraalexander

On the products index page, the links provided by the featured product are dead links

Note: Please mirror all features from Flask. In theory, if the user starts the Flask or FastAPI version using Docker, the behaviour should be identical.

Ty for taking a look.

image

Stripe Flow is missing

Hello @barreraalexander

The Stripe Flow is not implemented.
The following routes are required in order to have an usable product:

  • /config - this should return the Stripe PUBLIC_KEY
  • /success this endpoint is hit when the payment is successful
  • /cancelled - callback route for rejected payments
  • /create-checkout-session/<path>/ handles the payment flow

Please start the Flask sample using the following test keys for Stripe:

STRIPE_PUBLISHABLE_KEY=pk_test_51HlWtGGLLd1X07VUPujufXrN8JHjn76lzLOZ16zjo895ffZCC4JwcAAipINEC0CVFxjFGmHr1YxRf96JbhPiUeVU00uhxqX2uL
STRIPE_SECRET_KEY=sk_test_51HlWtGGLLd1X07VUIwU3iPZAK9mGdR8GtwSUAAkkyoOl3KpE4BWyIU3BX4mAcofaRrTFQIh4jFPSJHHk1njpwKMC00q3tPjAe7

Let me know if you have questions.

Ty!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.