Skip to content

Repository files navigation

Looping Marketplace

English · Español

PythonDjangoBootstrapStripeSupabasePostgreSQLuvDockerMake

Looping Marketplace

Full web marketplace to buy and sell products, with secure online payments and buyer and seller accounts.

Full product CRUD | Buyer & seller roles | Stripe payments | 2 languages (EN / ES)


Table of contents


Project description

Looping Marketplace is a full web application designed for buying and selling products. It ships with a complete CRUD system and integrates Stripe as a payment gateway.

The application is fully functional for real use. Users can create an account and start browsing and purchasing products immediately. To become a seller, users pay a one-time fee that unlocks the seller role and lets them list and manage their own products.

Features

  • Full CRUD system for products
  • User authentication and role management (buyer / seller)
  • One-time upgrade to become a seller
  • Stripe payment integration (single and multi-item checkout)
  • Favorites and shopping cart
  • Product image storage on Supabase
  • PostgreSQL database (SQLite fallback for local development)
  • Responsive UI built with Bootstrap
  • Custom error pages (400 / 403 / 404 / 500) and centralized logging

Architecture

Looping Marketplace is a server-side rendered Django monolith. Django serves both the business logic and the HTML (Django templates + Bootstrap); external services handle payments, image storage and the database.

 ┌──────────────────────────────┐
Browser ───────▶│ Django (MarketPlace app) │
(Bootstrap UI, │ ────────────────────────── │
Stripe.js, │ urls.py → routing │
SweetAlert2) │ views.py → business logic │
│ models.py → ORM │
│ templates → server-side HTML│
└───────┬───────┬───────┬──────┘
│ │ │
┌──────────────┘ │ └──────────────┐
▼ ▼ ▼
┌───────────────┐ ┌────────────────┐ ┌────────────────┐
│ PostgreSQL │ │ Stripe │ │ Supabase │
│ (Supabase / │ │ Checkout & │ │ Storage bucket │
│ SQLite local)│ │ payments │ │ product images │
└───────────────┘ └────────────────┘ └────────────────┘

Request flow

  1. A user registers / logs in → Django auth creates the account, and a post_save signal creates the matching UserProfile.
  2. A seller creates a product → the image is uploaded to the Supabase products_images bucket and its public URL is stored on the Product.
  3. A buyer purchases → a Stripe Checkout session is created → Stripe redirects back to a success URL → the order is recorded.
  4. Favorites and cart are stored as relations on UserProfile.

Tech stack

LayerTechnology
Web frameworkDjango 6.0 (Python 3.12)
FrontendDjango templates + Bootstrap 5.3, Stripe.js, SweetAlert2
DatabasePostgreSQL (via dj-database-url) · SQLite fallback in local dev
Image storageSupabase Storage
PaymentsStripe Checkout
AuthDjango authentication + profile signals
Package manageruv
ContainerizationDocker / Docker Compose
ToolingMake

Project structure

MarketPlace/
├── Makefile # Dev commands (install, dev, migrate, docker-up...)
├── README.md / README.es.md # Documentation (EN / ES)
├── backend/
│ ├── manage.py # Django CLI entry point
│ ├── pyproject.toml # uv project + dependencies
│ ├── requirements.txt # pip dependencies (alternative)
│ ├── Dockerfile # Server image
│ ├── docker-compose.yml # Server service on port 8000
│ ├── MarketPlace/ # Django project package
│ │ ├── settings.py # Global config (apps, DB, Stripe, logging)
│ │ ├── urls.py # Root router (all endpoints)
│ │ ├── views.py # All platform views
│ │ ├── models.py # Product, UserProfile, Location, Favorite, Order, ShoppingCart
│ │ ├── forms.py # Django forms
│ │ ├── admin.py # Django admin registration
│ │ ├── error_views.py # 400 / 403 / 404 / 500 handlers
│ │ └── error_handlers.py # Error middleware
│ ├── services/ # External integrations
│ │ ├── stripe_service.py # Stripe configuration
│ │ └── supabase.py # Supabase client (image storage)
│ ├── config_logs/ # Centralized logging config
│ ├── templates/ # Server-side HTML (main, product_detail, login, profile...)
│ └── static/ # Bootstrap CSS/JS and images
└── frontend/ # Static HTML mockups (reference, not wired to the app)

Data model

ModelPurposeKey relations
UserProfileExtends Django User; is_premium marks a seller1:1 User, FK Location, M2M Product (favorites)
LocationCity / country of a user or productreferenced by UserProfile and Product
ProductItem listed for saleFK seller (UserProfile), FK Location
OrderCompleted purchase (buyer ≠ seller)FK buyer, FK seller, FK product
FavoriteSaved productFK UserProfile, FK Product (unique together)
ShoppingCartCart lineFK UserProfile, FK Product (unique together)

A UserProfile is created automatically for every new User via a post_save signal. A user becomes a seller when is_premium = True (set after the upgrade payment).

API endpoints

RouteNamePurpose
/main_pageProduct catalog
/product/<id>/product_detailProduct detail page
/product/new/create_productCreate a listing
/product/buy/<id>/acquire_productComplete a purchase
/product/delete/<id>/delete_productRemove a listing
/register/ · /login/ · /logout/authAccount access
/profile/user_profilePurchases, sales and favorites
/profile/upgrade/upgrade_to_sellerBecome a seller
/favorites/ · /toggle-favorites/<id>/favoritesManage favorites
/shopping-cart/ · /toggle-shopping-cart/<id>/cartManage cart
/create-checkout-session/<id>/create_checkout_sessionSingle-item Stripe checkout
/create-multi-checkout/create_multi_checkoutMulti-item Stripe checkout
/create-upgrade-session/create_upgrade_sessionSeller upgrade checkout
/about/ · /contact/ · /info/static pagesInformational pages
/admin/Django admin

Getting started

Requirements

  • Python 3.12+
  • uv (recommended) — or pip
  • Make (preinstalled on macOS/Linux; on Windows use WSL or run the raw commands)
  • Docker Desktop (optional)
  • Git

Clone the repository first:

git clone https://github.com/Bootcamp-IA-P6/MarketPlace.git
cd MarketPlace

Run with Make (recommended)

From the project root:

make dev

This installs dependencies with uv, applies migrations and starts the server at http://localhost:8000.

Run on macOS / Linux

cd backend
uv sync # create .venv and install dependencies
uv run python manage.py migrate # set up the database
uv run python manage.py runserver # start at http://localhost:8000
Without uv (plain venv + pip)
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Run on Windows

PowerShell with uv (recommended):

cd backend
uv sync
uv run python manage.py migrate
uv run python manage.py runserver
Without uv (plain venv + pip)
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

make is not available on Windows by default. Use the commands above, or run the project inside WSL to use make dev.

Run with Docker

Pull and run the published image (no clone needed):

docker pull iruperth/looping:latest
docker run -d -p 8000:8000 iruperth/looping:latest

Or build from source with Docker Compose:

cd backend
docker compose up --build # add -d to run in the background
docker compose down # stop

Environment variables

Create a backend/.env file. For local development everything has a safe default, so an empty/minimal file already works (SQLite is used and payments/storage are disabled).

# DjangoDJANGO_SECRET_KEY=change-me-in-productionDJANGO_DEBUG=True# Database — omit to use the local SQLite fallbackDATABASE_URL=postgresql://user:password@host:5432/marketplace# Stripe — leave empty to disable real paymentsSTRIPE_PUBLIC_KEY=pk_test_xxxSTRIPE_SECRET_KEY=sk_test_xxxSTRIPE_WEBHOOK_SECRET=whsec_xxx# Supabase — leave empty to disable image uploadsSUPABASE_URL=https://your-project.supabase.coSUPABASE_SERVICE_ROLE_KEY=your-service-role-key
VariableRequiredDefault / effect
DJANGO_SECRET_KEYProductionInsecure dev key if unset
DJANGO_DEBUGNoTrue in local dev
DATABASE_URLProductionSQLite (db.sqlite3) if unset
STRIPE_PUBLIC_KEYFor paymentsTest placeholder if unset
STRIPE_SECRET_KEYFor paymentsEmpty → checkout disabled
STRIPE_WEBHOOK_SECRETFor webhooksEmpty
SUPABASE_URLFor image uploadEmpty → storage disabled
SUPABASE_SERVICE_ROLE_KEYFor image uploadEmpty → storage disabled

Make commands

make help# list all available targets
make install # create the virtual environment and install dependencies (uv sync)
make dev # install + migrate + run the development server
make run # start the server (no sync / migrate)
make migrate # apply database migrations
make makemigrations # generate new migrations
make superuser # create a Django admin user
make shell # open the Django shell
make collectstatic # collect static files
make test# run the test suite
make clean # remove Python cache files
make docker-up # docker compose up --build
make docker-down # docker compose down

Roadmap

  • Real-time chat between buyers and sellers
  • Optional paid promotion to highlight products at the top of the marketplace
  • Discount coupons for frequent buyers
  • Automated notifications for order updates, chat messages and low-stock alerts
  • Long-term goal: native mobile application

Contributing

We welcome contributions to improve Looping Marketplace. If you would like to collaborate, please open a pull request and our team will review it.


Looping Marketplace

About

Full-stack marketplace web app to buy and sell products, with secure online payments and buyer and seller accounts.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages