Skip to content

omariomari2/ScalepointERP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScalepointERP

A full-featured Enterprise Resource Planning system built with Python and Flask, designed for retail and wholesale businesses.

Features

  • Point of Sale (POS) - Cash register management, order processing, payment handling, receipts
  • Inventory Management - Product catalog, stock tracking, warehouse transfers, scrap management
  • Sales & Returns - Sales orders, invoicing, partial/full returns with quality checks
  • Employee Management - Attendance tracking, clock-in/out, departments, leave management
  • Purchasing - Supplier management, purchase orders, receipts, invoicing
  • Reporting - Sales reports, inventory reports, PDF/Excel export with digital signatures
  • Role-Based Access - Admin, Manager, Shop Manager, Inventory Manager, Sales Worker, Cashier
  • Multi-Branch - Branch-aware operations with location-based stock management

Tech Stack

Layer Technology
Backend Python 3.9, Flask (factory pattern)
ORM SQLAlchemy 2.x, Flask-Migrate (Alembic)
Auth Flask-Login (sessions) + Flask-JWT-Extended (API tokens)
Frontend Jinja2 server-side rendering
Database SQLite (dev) / PostgreSQL (production)
PDF/Reports WeasyPrint, ReportLab, xhtml2pdf, pyHanko (digital signatures)
Data Export pandas, openpyxl, XlsxWriter
Deployment Docker, Google Cloud Run, Kubernetes

Project Structure

ScalepointERP/
├── app.py                 # Flask app factory, blueprint registration, routes
├── config.py              # Environment-specific configuration
├── extensions.py          # Flask extension initialization
├── wsgi.py                # WSGI entry point for Gunicorn
├── init_db.py             # Database seeding (roles, users, sample data)
│
├── modules/               # Business domain blueprints
│   ├── auth/              # Authentication, user models, role decorators
│   ├── inventory/         # Products, stock, warehouses, transfers, scrap
│   ├── pos/               # POS orders, returns, cash registers, API
│   ├── sales/             # Sales orders, invoicing, payments
│   ├── purchase/          # Suppliers, purchase orders, receipts
│   ├── employees/         # HR, attendance, departments, clock-in/out
│   ├── reports/           # Sales and business reports
│   ├── warehouse_reports/ # Warehouse-specific reporting
│   ├── admin/             # Admin utilities, notifications
│   ├── manager/           # Managerial dashboards
│   ├── core/              # Shared models (Activity, Event)
│   ├── notifications/     # User notification system
│   ├── settings/          # Application settings
│   ├── help/              # Help pages
│   └── tour/              # Onboarding tour
│
├── migrations/            # Alembic database migration scripts
├── scripts/               # Utility and maintenance scripts
│   ├── checks/            # Database inspection and diagnostics
│   ├── fixes/             # Bug fixes and data patches
│   ├── setup/             # Database and data initialization
│   ├── updates/           # Schema updates and column additions
│   ├── reset/             # Database reset and rebuild
│   ├── debug/             # Debug utilities
│   └── deploy/            # Deployment helpers
│
├── templates/             # HTML templates
├── static/                # CSS, JS, images
├── sql/                   # SQL scripts
│
├── Dockerfile             # Container build
├── cloudbuild.yaml        # Google Cloud Build pipeline
├── k8s-deployment.yaml    # Kubernetes deployment manifest
├── Procfile               # Process definition (Railway, Heroku)
└── requirements.txt       # Python dependencies

Getting Started

Prerequisites

  • Python 3.9+
  • pip

Local Development

# Clone the repository
git clone https://github.com/your-username/ScalepointERP.git
cd ScalepointERP

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
.venv\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt

# Set environment variables
export FLASK_CONFIG=development       # Linux/Mac
set FLASK_CONFIG=development          # Windows CMD
$env:FLASK_CONFIG="development"       # PowerShell

# Initialize database
flask db upgrade
python init_db.py

# Run the application
python app.py

The app will be available at http://localhost:5000.

Docker

docker build -t scalepoint-erp .
docker run -p 8080:8080 \
  -e SECRET_KEY=your-secret-key \
  -e JWT_SECRET_KEY=your-jwt-secret \
  -e DATABASE_URL=your-database-url \
  scalepoint-erp

Default Credentials

Username Password Role
admin admin123 Admin

Architecture

The application follows the modular monolith pattern using Flask blueprints. Each business domain is isolated in its own module under modules/, with its own models, routes, templates, and forms.

Request → Flask Router → Blueprint → Route Handler → SQLAlchemy → Database
                                         ↓
                                   Jinja2 Template → HTML Response

Key design decisions:

  • Server-side rendering for reliability in constrained environments
  • SQLite for dev, PostgreSQL for prod to minimize local setup friction
  • Factory pattern (create_app()) for testability and multi-config support
  • JWT API alongside session auth for POS integration endpoints

Deployment

The application is deployed on Google Cloud Run via Cloud Build. See tech.md for detailed deployment architecture, security considerations, and operational notes.

License

All rights reserved.

About

Full-featured Enterprise Resource Planning system with POS, inventory, sales, purchasing, HR, and reporting. Built with Flask in Python, SQLAlchemy, and Docker

Topics

Resources

Stars

Watchers

Forks

Contributors