Skip to content

CodedByManish/blok-lagyo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ” Bhok-Lagyo

Django-Powered Food Delivery System

Python Django PostgreSQL License

A secure, server-side rendered food delivery system built using Djangoโ€™s MVT architecture with multi-gateway payment integration.


๐Ÿ“Œ Table of Contents


๐Ÿ“– Introduction

Bhok-Lagyo is a robust food delivery application built using Django (MVT architecture).
It focuses on security, financial accuracy, and scalable design while maintaining a clean and responsive UI.

Users Can:

  • ๐Ÿ›’ Browse a dynamic food catalog
  • ๐Ÿงบ Add items to a session-based persistent cart
  • ๐Ÿ’ณ Pay securely using:
    • eSewa
    • Khalti
    • PayPal

โš™๏ธ System Architecture

The system follows Djangoโ€™s Model-View-Template (MVT) pattern.

๐Ÿ” Authentication & User Management

  • Powered by Djangoโ€™s built-in auth system
  • Secure login & session-based user tracking

๐Ÿฝ๏ธ Product Catalog

  • Managed inside the Products app
  • models.py defines schema
  • Full CRUD from Django Admin
  • Real-time menu updates

๐Ÿ›’ Stateful Cart System

  • Uses Django Sessions
  • Prevents database clutter from abandoned carts
  • Cart persists even after page refresh

๐Ÿงพ Checkout & Order Persistence

  • Server-side validation prevents price tampering
  • Cart revalidated against database prices
  • Permanent storage in:
    • Order
    • OrderLineItem

๐Ÿ’ณ Payment Integration

Gateway Integration Method
eSewa Server-side signature + HTML form redirect
Khalti Secure Server-to-Server API handshake
PayPal JavaScript SDK

All payment flows ensure:

  • Server-side verification
  • Accurate Decimal-based calculations
  • Secure key handling via environment variables

๐Ÿš€ Key Features

  • โœ… Persistent Cart via Sessions
  • โœ… Multi-Gateway Payments (eSewa, Khalti, PayPal)
  • โœ… Django Admin Dashboard
  • โœ… Tailwind CSS Responsive UI
  • โœ… Server-Side Checkout Validation
  • โœ… Financial Accuracy using Python Decimal
  • โœ… Clean MVT Architecture

๐Ÿ› ๏ธ Technology Stack

Layer Technology
Backend Python 3.10+, Django 4.2+
Database SQLite (Development), PostgreSQL (Production)
Payments eSewa API v2, Khalti ePayment v2, PayPal SDK
Frontend Django Templates, Tailwind CSS
Server Logic 99.5% Python, 0.5% JavaScript

๐Ÿ–ฅ๏ธ Installation & Setup

1๏ธโƒฃ Clone the Repository

git clone https://github.com/CodedByManish/blok-lagyo.git
cd blok-lagyo

2๏ธโƒฃ Create Virtual Environment

python -m venv venv

Activate:

Mac/Linux

source venv/bin/activate

Windows

venv\Scripts\activate

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

4๏ธโƒฃ Configure Environment Variables

Create a .env file:

KHALTI_SECRET_KEY=your_test_key
ESEWA_SECRET_KEY=8gBm/:&EnhH.1/q
PAYPAL_TEST=True

5๏ธโƒฃ Run Migrations

python manage.py makemigrations
python manage.py migrate

6๏ธโƒฃ Start Development Server

python manage.py runserver

Visit:

http://127.0.0.1:8000/

๐Ÿ›ก๏ธ Security Measures

  • ๐Ÿ” CSRF Protection enabled on all POST requests
  • ๐Ÿงฎ Server-side price recalculation during checkout
  • ๐Ÿ”‘ API keys stored in environment variables
  • ๐Ÿ›‘ Prevention of client-side price manipulation
  • ๐Ÿ’ฐ Decimal-based currency calculations

๐Ÿ“‚ Project Structure

blok-lagyo/
โ”‚
โ”œโ”€โ”€ products/          # Product catalog app
โ”œโ”€โ”€ orders/            # Order & checkout logic
โ”œโ”€โ”€ payments/          # Payment gateway integrations
โ”œโ”€โ”€ templates/         # Django Templates
โ”œโ”€โ”€ static/            # CSS, JS, Images
โ”œโ”€โ”€ docs/              # Screenshots & demo assets
โ”œโ”€โ”€ manage.py
โ””โ”€โ”€ requirements.txt

๐Ÿ“ธ Screenshots (Optional)

Create a docs/ folder and add:

![Homepage](docs/homepage.png)
![Checkout](docs/checkout.png)
![Payment Redirect](docs/paypal_redirect.png)

You may also include:

  • Admin dashboard screenshot
  • Cart page
  • Payment success page
  • Demo GIF of checkout flow

๐Ÿค Contributing

  1. Fork the project
  2. Create your feature branch
git checkout -b feature/AmazingFeature
  1. Commit your changes

1c98f8f (Add PayPal integration and update README.md)

git commit -m "Add AmazingFeature"
  1. Push to branch
git push origin feature/AmazingFeature"
  1. Open a Pull Request

๐Ÿ“„ License

Distributed under the MIT License.
See LICENSE for more information.


โญ If you like this project, give it a star!

Built by CodedByManish using Django

About

A food delivery app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors