Skip to content

Membership based Fitness application created using Django and Stripe

Notifications You must be signed in to change notification settings

shinchri/Star-Fitness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Star-Fitness

What is Used

  • Python 3.10
  • Django
  • Django-allauth
  • Stripe

Project Photos

Landing Page

Landing Page

Home Page

Home Page

Logged in Subscribed user

Subscribed

Not logged in

Membership Page 1

Logged in but not subscribed

Membership Page 2

Stripe Payment

Stripe Payment

Signup Page

Signup Page

Login Page

Login Page

Logout Page

Logout Page

how to start

First create virtual environment and install dependency by following:

$ python3.10 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Inside src/config/, create .env file and create the following environment variable:

SECRET_KEY
DEBUG
STRIPE_PUBLISHABLE_KEY
STRIPE_SECRET_KEY
STRIPE_ENDPOINT_SECRET
DOMAIN_URL

For the local development, set DEBUG and DOMAIN_URL to True and http://localhost:8000/, repectively

SECRET_KEY is a Django secret key

STRIPE_PUBLISHABLE_KEY, STRIPE_SECRET_KEY, STRIPE_ENDPOINT_SECRET must be retrieved from the Stripe (please refer to Stripe Integration section).

While we are creating the Stripe account, make sure to create Product object with Monthly and Yearly Prices. (please refer to Stripe Integration section).

We can cd in to ./src.

Before we can start we need to make migrations and create super user:

$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py createsuperuser

Enter email address and password.

We can start the application with following command:

$ python manage.py runserver

Before we can subscribe though, we must create Membership model object for Monthly and Yearly (id for Monthly must be 1 and 2 for Yearly; If the ids are different, ./src/main/static/js/script.js must be fixed appropriately)

  • If the ids are different, change the fetch urls appropriately.
  • Each Membership model requires name and priceId.
  • Retrieve the priceId from Stripe Dashboard.

That's it! Have fun!

Stripe Integration

Stripe integration was based on this tutorial

About

Membership based Fitness application created using Django and Stripe

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published