- Python 3.11+
- PostgreSQL 14+
- Node.js 18+ (for TailwindCSS)
- Clone and create virtual environment
git clone <repository>
cd possystem
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Linux/Mac- Install dependencies
pip install -r requirements.txt
npm install- Configure environment
copy .env.example .env
# Edit .env with your database credentials and secret keys- Setup database
# Create PostgreSQL database
createdb possystem
# Run migrations
python manage.py migrate_schemas --shared
python manage.py migrate_schemas- Create superuser and tenant
python manage.py create_tenant --schema_name=public
python manage.py createsuperuser- Build frontend assets
npm run build- Run development server
python manage.py runserverpossystem/
├── accounts/ # User & Tenant management
├── api/ # REST API endpoints
├── billing/ # Subscription management
├── branches/ # Branch operations & inventory
├── main/ # Core POS models (Product, Order, Customer)
├── notifications/ # System notifications
├── storefront/ # Public-facing storefront
├── static/ # CSS, JS, images
├── templates/ # Django templates
│ └── partials/ # Reusable template components
└── possystem/ # Project settings
Base URL: /api/v1/
| Endpoint | Method | Description |
|---|---|---|
/api/v1/auth/login/ |
POST | Get JWT tokens |
/api/v1/auth/refresh/ |
POST | Refresh access token |
/api/v1/auth/logout/ |
POST | Blacklist refresh token |
/api/v1/auth/user/ |
GET | Get current user details |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/products/ |
GET | List products |
/api/v1/products/ |
POST | Create product |
/api/v1/products/{id}/ |
GET | Get product |
/api/v1/products/{id}/ |
PUT | Update product |
/api/v1/products/{id}/ |
DELETE | Delete product |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/orders/ |
GET | List orders |
/api/v1/orders/ |
POST | Create order |
/api/v1/orders/{id}/ |
GET | Get order details |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/customers/ |
GET | List customers |
/api/v1/customers/ |
POST | Create customer |
/api/v1/customers/{id}/ |
GET | Get customer |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/reports/financial_summary/ |
GET | Financial summary |
/api/v1/reports/daily_sales/ |
GET | Daily sales report |
/api/v1/reports/top_products/ |
GET | Top selling products |
/api/v1/reports/low_stock/ |
GET | Low stock alerts |
# Run all tests
python manage.py test
# Run specific app tests
python manage.py test main
python manage.py test api
# Run with coverage
pip install coverage
coverage run manage.py test
coverage report| Variable | Description | Example |
|---|---|---|
SECRET_KEY |
Django secret key | your-secret-key |
DEBUG |
Debug mode | True or False |
ALLOWED_HOSTS |
Allowed hosts | localhost,127.0.0.1 |
DB_NAME |
Database name | possystem |
DB_USER |
Database user | postgres |
DB_PASSWORD |
Database password | your-password |
STRIPE_SECRET_KEY |
Stripe API key | sk_test_... |
FERNET_KEY |
Encryption key | base64-encoded-key |
This project uses django-tenants for schema-based multi-tenancy.
- Public schema: Shared tables (User, Tenant, Billing)
- Tenant schemas: Isolated tables (Product, Order, Customer)
Each tenant has their own subdomain: store1.yourdomain.com