Giter Site home page Giter Site logo

fastapi-stripe's Introduction

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.

Roadmap & Features

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
CI/CD Render Deployment Platform

✨ Video Presentation

This video explains how to use the product


fastapi-stripe-ecommerce.mp4

✨ 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.


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


✨ 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.

fastapi-stripe's People

Contributors

diegodorgam avatar

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.