Skip to content

Latest commit

Β 

History

116 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸͺ N-Market | ΩΨ±ΩˆΨ΄Ϊ―Ψ§Ω‡ Ψ§Ω†-Ω…Ψ§Ψ±Ϊ©Ψͺ

FastAPI Python PostgreSQL Docker

🌟 A Beautiful Persian Inventory Management System

Combining modern FastAPI backend with elegant Persian frontend design

πŸš€ Quick Start β€’ ✨ Features β€’ πŸ“– Documentation β€’ πŸ› οΈ Development


🎯 Why Choose N-Market?

🎨 Beautiful Persian Design

  • RTL Layout - Native right-to-left interface
  • Persian Fonts - Lalezar & IranianSans typography
  • Bootstrap 5 - Responsive, modern styling
  • Cultural Adaptation - Designed for Persian markets

⚑ Developer Friendly

  • No Complex Setup - Direct table creation, no migrations
  • One Command Deploy - Docker-compose up and running
  • Clean Architecture - Simplified, maintainable codebase
  • Comprehensive API - Auto-generated documentation

πŸš€ Quick Start

🐳 Option 1: Docker (Recommended)
# πŸ“₯ Clone the repository
git clone https://github.com/yourusername/Fast-api-shop-app.git
cd Fast-api-shop-app

# πŸš€ Launch with one command
docker-compose up --build

# βœ… That's it! Your app is running

πŸŽ‰ Access your application:

πŸ’» Option 2: Local Development
# πŸ“ Setup Python environment
python -m venv venv
venv\Scripts\activate  # Windows
# source venv/bin/activate  # macOS/Linux

# πŸ“¦ Install dependencies
cd backend
pip install -r requirements.txt

# βš™οΈ Configure environment
copy .env.example .env  # Windows
# cp .env.example .env  # macOS/Linux

# 🎯 Launch the application
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

πŸ”— Open your browser to:

πŸ’‘ Pro Tip: The Docker option sets up everything automatically, including the database!

✨ Features That Make N-Market Special

🎨 Persian-First Design πŸ“¦ Smart Inventory πŸ” Secure & Simple πŸ“Š Business Intelligence
RTL interface with Persian fonts Real-time stock tracking JWT authentication Live dashboard analytics
Bootstrap 5 responsive design Automated inventory updates Role-based access control Sales performance reports
Cultural color schemes Low stock alerts Password security Inventory valuation
Mobile-optimized navigation Multi-category organization Request logging Business insights

🌟 Core Capabilities

graph LR
    A[Persian Frontend] --> B[FastAPI Backend]
    B --> C[PostgreSQL DB]
    B --> D[Authentication]
    B --> E[Product Management]
    B --> F[Order Processing]
    B --> G[Analytics Dashboard]

    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#e8f5e8
Loading
  • πŸ›οΈ Complete E-commerce Flow - From product display to order completion
  • πŸ“± Responsive Design - Works perfectly on desktop, tablet, and mobile
  • πŸ”„ Real-time Updates - Inventory changes reflect immediately
  • πŸ“ˆ Growth Ready - Scalable architecture for business expansion

πŸ—οΈ Architecture & Tech Stack

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  🎨 Persian Frontend │◄──►│  ⚑ FastAPI Backend  │◄──►│  πŸ—„οΈ PostgreSQL DB   β”‚
β”‚                     β”‚    β”‚                      β”‚    β”‚                     β”‚
β”‚ β€’ RTL Bootstrap 5   β”‚    β”‚ β€’ Python 3.12+      β”‚    β”‚ β€’ Direct Tables     β”‚
β”‚ β€’ Persian Fonts     β”‚    β”‚ β€’ SQLAlchemy ORM     β”‚    β”‚ β€’ Auto-Creation     β”‚
β”‚ β€’ Responsive Design β”‚    β”‚ β€’ JWT Security       β”‚    β”‚ β€’ No Migrations     β”‚
β”‚ β€’ Mobile Optimized  β”‚    β”‚ β€’ Request Logging    β”‚    β”‚ β€’ Simple & Clean    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Choices

Frontend Stack

  • 🎨 HTML5 & CSS3 - Modern web standards
  • πŸ…±οΈ Bootstrap 5 - RTL-enabled responsive framework
  • πŸ”€ Persian Fonts - Lalezar & IranianSans typography
  • πŸ“± Mobile-First - Progressive enhancement design

Backend Stack

  • 🐍 Python 3.12+ - Latest language features
  • ⚑ FastAPI 0.115.6 - High-performance async framework
  • πŸ—ƒοΈ SQLAlchemy - Powerful ORM with direct table creation
  • πŸ” JWT Authentication - Stateless security tokens

Infrastructure

  • 🐳 Docker & Compose - Containerized deployment
  • πŸ—„οΈ PostgreSQL 13+ - Robust relational database
  • πŸ“Š Automatic API Docs - OpenAPI/Swagger integration
  • πŸš€ Production Ready - Scalable architecture

🎯 Design Philosophy: Simplicity without sacrificing functionality. Every component serves a clear purpose.

πŸ“ Project Structure

Fast-api-shop-app/
β”œβ”€β”€ assets/fonts/          # Persian fonts (Lalezar, IranianSans)
β”œβ”€β”€ index.html             # Main Persian frontend
β”œβ”€β”€ style.css              # Persian typography & styling
β”œβ”€β”€ pages/                 # Additional pages (about, etc.)
β”œβ”€β”€ backend/app/           # FastAPI application
β”‚   β”œβ”€β”€ main.py           # App entry point
β”‚   β”œβ”€β”€ models/           # Database models
β”‚   β”œβ”€β”€ routes/           # API endpoints
β”‚   └── auth/             # Authentication
β”œβ”€β”€ docker-compose.yml     # Docker configuration
└── Makefile              # Development commands

πŸ“‹ API Documentation

πŸ”— Interactive API Documentation Available at /docs

All endpoints are automatically documented with request/response examples

πŸ” Authentication & Security

POST /signup              # πŸ‘€ User registration with validation
POST /login               # πŸ”‘ JWT token authentication

Security Features:

  • πŸ”’ Password hashing (bcrypt)
  • 🎫 JWT token-based auth
  • πŸ“ Request logging
  • πŸ›‘οΈ CORS protection

πŸ“¦ Product Management

GET    /products              # πŸ“‹ List all products with pagination & search
POST   /products              # βž• Create new product with validation
GET    /products/{id}         # πŸ” Get detailed product information
PUT    /products/{id}         # ✏️ Update product details & stock
DELETE /products/{id}         # πŸ—‘οΈ Remove product from inventory

πŸ›’ Order Management

GET    /sales-orders          # πŸ“Š List orders with filters & status
POST   /sales-orders          # πŸ›οΈ Create new sales order
GET    /sales-orders/{id}     # πŸ“„ Get complete order details
PUT    /sales-orders/{id}     # πŸ”„ Update order status & tracking

πŸ“ˆ Analytics & Reporting

GET /dashboard/stats          # πŸ“Š Real-time business metrics
GET /dashboard/low-stock      # ⚠️ Products needing restock
GET /reports/sales-summary    # πŸ“ˆ Sales performance analysis

πŸ’‘ Try it Live: Visit /docs to test all endpoints with the interactive Swagger UI!

πŸ› οΈ Development

πŸš€ Quick Development Commands
# πŸ”§ Setup everything
make setup          # Install dependencies & setup environment

# πŸƒβ€β™‚οΈ Run development server
make serve          # Start with auto-reload

# 🐳 Docker development
make run-docker     # Run full stack with Docker

# 🧹 Cleanup
make clean          # Remove cache files & cleanup
βš™οΈ Environment Configuration

Create a .env file based on .env.example:

# πŸ—„οΈ Database Configuration
DATABASE_URL=postgresql://user:password@localhost:5432/nmarket_db

# πŸ” Security Settings
SECRET_KEY=your-super-secret-key-here-make-it-long-and-random
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

# πŸ› Development Settings
DEBUG=True
ENVIRONMENT=development

# πŸͺ Shop Configuration
SHOP_NAME=N-Market
SHOP_EMAIL=your-shop@example.com

οΏ½πŸ“„ License

MIT License - Feel free to use this project for your business needs!

See the LICENSE file for full details.


About

for a university project

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages