Case Study
Project Case Study
Challenges, solutions, outcomes, technical highlights, architecture, and project scale.
⚡
Challenges
- Need for secure authentication system with two verification steps (email + Google Authenticator)
- Managing multiple access levels for admins
- Implementing KYC system with national ID image and identity verification
- Managing cryptocurrency transactions with support for various blockchains
- Need for API to communicate with external services
- Generating QR Code for Google Authenticator setup
- Sending secure email with Gmail SMTP and App Password
- Managing admins, customers, and financial transactions simultaneously
💡
Solutions
- Using django-otp and django-two-factor-auth for 2FA implementation
- Implementing TOTPDevice to store Google Authenticator keys
- Generating QR Code with qrcode library and displaying with base64
- Using django.contrib.auth for basic authentication
- Designing custom User model with KYC and access fields
- Implementing API with DRF and permission_classes for security
- Using Gmail SMTP with App Password for email sending
- Implementing serializer for converting models to JSON
- Using OTPMiddleware to enforce 2FA verification
- Designing dedicated admin panel with jQuery and AJAX
📚
Outcomes
- Complete financial management system with high security
- Two-factor authentication with email and Google Authenticator
- Multi-level admin access management
- Complete KYC system for customer identity verification
- Cryptocurrency transaction management
- Powerful API for future developments
- Dedicated and user-friendly admin panel
- Secure and professional email sending
🔧
Technical Highlights
- Django 5.2.5 and Python 3
- MySQL database with pymysql
- django-otp and django-two-factor-auth for 2FA
- pyotp for TOTP generation
- qrcode and pypng for QR Code generation
- Django REST Framework 3.16 for API
- Pillow for image processing
- CustomUser system with KYC and security fields
- Using OTPMiddleware
- Google Authenticator for second authentication
- Email sending with Gmail SMTP + App Password
- 6-digit code verification via email
- Multi-blockchain management (BEP20, TRC20, Polygon)
- Different access levels for admins
🏗️
Architecture
Fuchase Finance is built on Django's MVT (Model-View-Template) architecture and consists of two main applications:
1. users: Responsible for user management, authentication, and admin panel
- Custom User model with KYC, access, and security fields
- login_admin, enable_totp views in main project
- admin_manager, add_admin, alluser, user_information views
- deposite, witheraw views for transaction management
- API endpoints for customer_list and customer_checkin
- serializer for converting User to JSON
- permissions for access control
2. web: Responsible for landing page management
- Lp model for storing landing page information
- Ability to add name, score, logo, and description
Main views.py file includes:
- login_admin: three-step login (email/code, OTP, 2FA)
- enable_totp: Google Authenticator setup with QR Code
The project runs in DEBUG mode and uses SQLite for development and MySQL for production.
📐
Project Scale
- 2 main applications (users, web)
- 2 main data models (User, Lp)
- Three-step authentication system
- Dedicated admin panel
- Complete KYC system
- API with DRF
- Cryptocurrency transaction management
- Support for 3 blockchains (BEP20, TRC20, Polygon)
- 3 admin access levels
- Google Authenticator + email 2FA