Skip to content

Latest commit

 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Biikstore

A clean, modern digital bookstore platform. Browse, purchase via Stripe, and access your personal library.

Python Django Stripe

Live MVP • Fully functional purchase flow • Secure digital delivery


✨ Features

  • Beautiful public site — Home, About the Author, Gallery, Contact
  • Full bookstore — Search, genre filtering, detailed book pages
  • Smart cart — Session-based shopping cart (no login required to browse)
  • Stripe payments — Secure checkout with webhooks for reliability
  • Personal Library — Buyers instantly access purchased books (read online + download)
  • Author dashboard ready — Rich admin panel for books, orders, gallery & messages

🖼️ Architecture

flowchart TB
    subgraph Public
        A[Home / About / Gallery / Contact]
    end

    subgraph Store
        B[Book Catalog + Search]
        C[Cart Session]
        D[Stripe Checkout]
    end

    subgraph Users
        E[Auth + Profile]
        F[My Library]
    end

    subgraph Backend
        G[(SQLite / PostgreSQL)]
        H[Order + Library Services]
        I[Stripe Webhooks]
    end

    A --> B
    B --> C
    C --> D
    D --> H
    H --> G
    D --> I
    I --> F
    E --> F
Loading

🔄 Purchase Flow

sequenceDiagram
    participant User
    participant Store as Bookstore
    participant Stripe
    participant Webhook

    User->>Store: Browse & add books to cart
    User->>Store: Checkout (login required)
    Store->>Stripe: Create Checkout Session
    Stripe-->>User: Redirect to Stripe payment page
    User->>Stripe: Complete payment
    Stripe->>Store: Redirect to /success
    Store->>Store: Mark order paid + add to Library
    Note over Store,Webhook: Webhook (backup)
    Stripe-->>Webhook: checkout.session.completed
    Webhook->>Store: Confirm payment + grant access
    User->>Store: Open My Library → Read / Download
Loading

📊 Data Model (Core)

erDiagram
    User ||--o{ Order : places
    User ||--o{ UserLibrary : owns
    Order ||--o{ OrderItem : contains
    OrderItem }o--|| Book : references
    UserLibrary }o--|| Book : grants_access

    Book {
        string title
        string subtitle
        text description
        decimal price
        string genre
        file cover_image
        file file
        boolean is_free
        boolean is_featured
        int views
        int downloads
    }

    Order {
        decimal total
        string payment_status
        string stripe_checkout_session
    }

    UserLibrary {
        datetime purchased_at
    }
Loading

🚀 Quick Start

Prerequisites

  • Python 3.10+
  • Stripe account (free test mode works)

1. Clone & setup

git clone https://github.com/cleven12/biikstore.git
cd biikstore
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

2. Environment

cp .env.example .env

Edit .env and add your Stripe keys:

STRIPE_PUBLIC_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...

3. Database & run

python manage.py migrate
python manage.py createsuperuser   # optional but recommended
python manage.py runserver

Visit:


💳 Stripe Setup (Important)

  1. Go to Stripe Dashboard (use Test mode)
  2. Copy Publishable key and Secret key
  3. For local webhooks:
stripe login
stripe listen --forward-to localhost:8000/store/webhook/

Copy the whsec_... value into your .env.

The app converts prices from TZS to USD cents internally for Stripe compatibility.


📁 Project Structure

biikstore/
├── config/                 # Django project settings & URLs
├── home/                   # Public pages + Author profile + Gallery + Contact
├── store/                  # Books, Cart, Orders, Stripe integration
├── users/                  # Accounts, Profile, Library
├── templates/              # All Django templates
├── media/                  # Uploaded images & book files (gitignored in prod)
├── static/                 # Custom CSS / assets
├── manage.py
├── requirements.txt
└── .env.example

🛠️ Tech Stack

Layer Technology
Backend Django 5
Database SQLite (dev) / PostgreSQL
Payments Stripe Checkout + Webhooks
Images Pillow
Config python-decouple
Frontend Bootstrap 5 + custom styles

📸 Screenshots

Comming soon

Homepage Bookstore
Home Books
Library Checkout
Library Stripe

🧪 Development

python manage.py makemigrations
python manage.py migrate
python manage.py test

📦 Production Recommendations

  • Set DEBUG=False
  • Use PostgreSQL + proper static/media serving (WhiteNoise / S3)
  • Rotate and secure SECRET_KEY
  • Configure real Stripe live keys + domain
  • Set up proper ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS

Housekeeping (recommended)

# Stop committing development databases
git rm --cached bookstore_db.db db.sqlite3
echo "bookstore_db.db\ndb.sqlite3" >> .gitignore
git add .gitignore
git commit -m "chore: stop tracking dev databases"

📄 License

MIT — see LICENSE file.


🙌 Author

Built by Cleven.


Made with ❤️ + clean code.

About

A clean, modern digital bookstore platform. Browse, purchase via Stripe, and access your personal library.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages