⚡
Challenges
Traditional print shops managed their orders manually and on paper.
Print price calculation based on multiple parameters (size, color, page count, binding) was complex and error-prone.
Referral and commission distribution among marketers, schools, and teachers was handled manually and prone to errors.
The lack of an online platform for file upload and order placement forced customers to visit in person.
Educational content management and customer Q&A lacked a centralized system.
No wallet and settlement system caused financial disputes among stakeholders.
💡
Solutions
Implemented a Django platform with seven-app architecture (account, site_profile, cart, marketing, seo, zarinpal, myclass) for clean separation of concerns.
Built an automatic print pricing engine with a Pricelist matrix (size × color × count × single/double-sided) and Sahafi_price (binding type × size × page count) stored in the database.
Automatic PDF page count extraction with PyPDF2 and real-time price calculation based on file content.
Implemented a multi-level marketing (MLM) system with a tree structure (self-referential FK) and automatic three-tier commission distribution (owner, marketer, school).
Added dedicated wallets, unique wallet addresses with the 8989 prefix, and peer-to-peer money transfer between users.
Built a dedicated panel for managing marketer payouts and settlements (pay_new_payment / old_payment).
Implemented a complete CMS including articles, Q&A, legal experiences, videos, multi-category classification, and advanced search with saved results.
📚
Outcomes
Complete elimination of manual price calculations replaced by automatic calculation based on 5 parameters.
Increased transparency in commission distribution and elimination of financial disputes among marketers, schools, and teachers.
Ability to place print orders 24/7 without in-person visits.
Automated referral system that manages marketers and schools without manual intervention.
Reduced per-order processing time from several minutes to a few seconds.
Searchable content base for articles, Q&A, and videos with commenting.
🔧
Technical Highlights
Seven-app Django architecture with clean domain separation.
Six-role user system with field-level access control (admin, teacher, school, marketer, printing_house, responder).
MLM system with a self-referential FK for unlimited tree structure of marketers and schools.
Automatic three-tier commission distribution (owner_income, marketer_income, school_income) on every cart line.
Automatic pricing via a Pricelist matrix (size × color × page count) and Sahafi_price (binding type × size × page count).
Automatic PDF page count extraction with PyPDF2 and real-time pricing based on file content.
Wallet system with unique addresses (8989 prefix) and peer-to-peer money transfer with transaction records.
Full Zarinpal v4 payment gateway integration + SEO-oriented CMS with saved searches and keyword counters.
🏗️
Architecture
The project is built on Django's MTV pattern with a seven-app architecture:
- account: multi-role custom user, OTP authentication, Ghasedak SMS, Jalali date conversion
- site_profile: print files (Chap_file), profile, price lists (Pricelist, Sahafi_price), states/cities, counseling
- cart: shopping cart, orders, order lines (Cart_list), discount codes
- marketing: referral, commission, payouts (Marketer_payment)
- seo: content (Seo), categories (All_category), keywords, search, comments, questions
- zarinpal: online payment
- myclass: shared utility functions
📐
Project Scale
The project is currently live on the domain pejvakprint.ir.
Comprises 7 Django apps with 20+ data models.
Supports 6 user roles with field-level access control.
Multi-level marketing system with unlimited tree structure.
Manages multiple complete workflows: from PDF upload to printing, shipping, and marketer settlement.
Content base with articles, Q&A, legal experiences, and videos.