A comprehensive Django-based investment platform with Tesla-inspired dark theme, user authentication, investment plans, deposits, withdrawals, and support system.
- Authentication: Secure registration and login with email
- Dashboard: View balance, investments, and earnings with real-time updates
- Deposit Management: Submit crypto deposits with proof
- Investment Plans: Browse and subscribe to investment plans with automatic ROI crediting
- Withdrawals: Request fund withdrawals with automatic balance handling
- Support System: Create tickets and communicate with admin
- User Management: Manage user balances and accounts
- Deposit Approval: Approve deposits with automatic balance updates
- Support Management: Reply to user tickets inline
- Investment Plans: Create and manage investment plans
- Withdrawal Processing: Approve/reject with automatic refund on rejection
- β Automatic Balance Updates: Deposits auto-credit on approval
- β Smart Refunds: Rejected withdrawals auto-refund balance
- β ROI Crediting: Completed investments automatically credit earnings + principal
- β Duplicate Prevention: Status-change detection prevents double-credits
- β Total Earnings Tracking: Dashboard tracks cumulative ROI earnings
- Backend: Django 4.2.7, Django REST Framework 3.14.0
- Frontend: Tailwind CSS (Tesla dark theme), Alpine.js, Vanilla JavaScript
- Database: SQLite (default), PostgreSQL (production)
- Authentication: Token-based + Session authentication
- Security: CSRF protection, JWT support, HTTPS ready
- Static Files: WhiteNoise with compression
- Deployment: Gunicorn + Nginx ready
- Python 3.14.0
- pip and virtualenv
- PostgreSQL (for production)
- Nginx (for production deployment)
-
Clone the Repository
git clone <your-repo> cd prodig
-
Create Virtual Environment
python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # Linux/Mac
-
Install Dependencies
pip install -r requirements.txt
-
Setup Environment
cp .env.example .env # Edit .env with your settings -
Run Migrations
python manage.py migrate
-
Create Superuser
python manage.py createsuperuser
-
Collect Static Files
python manage.py collectstatic --noinput
-
Run Development Server
python manage.py runserver 8001
Access at http://127.0.0.1:8001
Run the deployment readiness checker:
python check_deployment.pyThis validates:
- β Environment configuration
- β Database connectivity
- β Static files collection
- β Security settings
- β Required dependencies
- β Signal handlers
- β Template files
See DEPLOYMENT.md for comprehensive production deployment guide.
Quick production checklist:
- Set
DEBUG=Falsein .env - Configure PostgreSQL database
- Set strong
SECRET_KEY - Update
ALLOWED_HOSTS - Enable SSL/HTTPS
- Configure Gunicorn + Nginx
- Run
python manage.py check --deploy
POST /api/users/register/- Register new userPOST /api/users/login/- Login userPOST /api/users/logout/- Logout userGET /api/users/me/- Get current user profile
GET /api/investments/plans/- Get all investment plansGET /api/investments/my-investments/- Get user investmentsPOST /api/investments/my-investments/subscribe/- Subscribe to plan
GET /api/deposits/wallets/- Get crypto walletsGET /api/deposits/- Get user depositsPOST /api/deposits/- Submit new deposit
GET /api/withdrawals/- Get user withdrawalsPOST /api/withdrawals/request_withdrawal/- Request withdrawal
GET /api/support/tickets/- Get support ticketsPOST /api/support/tickets/- Create ticketPOST /api/support/tickets/{id}/add_reply/- Add reply
- Email, username, password
- Balance, total_invested, total_earnings
- Profile information
- Name, description
- ROI percentage, duration
- Min/max investment amounts
- User, plan, amount
- Status, dates, returns
- Cryptocurrency type
- Wallet address
- User, amount, cryptocurrency
- Proof type and content
- Status (pending/approved/rejected)
- User, amount, cryptocurrency
- Wallet address, status
- Signal: Auto-refunds on rejection
- Priority, status, category
- Admin inline replies
- User-admin communication
- User submits deposit with proof
- Admin reviews in Django admin
- Admin approves β Signal auto-credits balance
- Duplicate prevention via
approved_attimestamp
- User requests withdrawal (balance deducted)
- Admin reviews request
- If rejected β Signal auto-refunds balance
- Duplicate prevention via status change detection
- User subscribes to plan (balance deducted)
- Investment becomes active
- Admin completes investment β Signal credits:
- Principal amount back to balance
- ROI earnings to balance
- Updates
total_earningsfield
- User can cancel active investment β Signal refunds amount
- Duplicate prevention via
earnedfield check
POST /api/users/register/- Register new userPOST /api/users/login/- Login (returns token)POST /api/users/logout/- LogoutGET /api/users/me/- Current user profile
GET /api/investments/plans/- List investment plansGET /api/investments/my-investments/- User's investmentsPOST /api/investments/my-investments/subscribe/- Subscribe to planPOST /api/investments/my-investments/cancel_investment/- Cancel investment
GET /api/deposits/wallets/- Crypto wallet addressesGET /api/deposits/my_deposits/- User's depositsPOST /api/deposits/- Submit new deposit
GET /api/withdrawals/my-withdrawals/- User's withdrawalsPOST /api/withdrawals/request_withdrawal/- Request withdrawal
GET /api/support/tickets/- List user ticketsPOST /api/support/tickets/- Create ticketGET /api/support/tickets/{id}/- Ticket details with repliesPOST /api/support/tickets/{id}/add_reply/- Add reply
Access: http://yourdomain.com/admin/
- User Management: Edit balances, total_invested, total_earnings
- Deposit Approval: Inline actions, auto-balance update
- Investment Tracking: View all active/completed investments
- Withdrawal Processing: Approve with proof, reject with auto-refund
- Support Tickets: Inline reply system with admin indicator
- Investment Plans: Create plans with ROI % and duration
Set during deployment with python manage.py createsuperuser
- Check browser console for JavaScript errors
- Verify API endpoint returns correct data:
/api/users/me/ - Hard refresh: Ctrl+Shift+R (Windows) / Cmd+Shift+R (Mac)
- Check Django admin logs
- Verify signal files exist:
apps/deposits/signals.pyapps/withdrawals/signals.pyapps/investments/signals.py
- Check apps.py imports signals in
ready()method
python manage.py collectstatic --clear --noinputpython manage.py migrate
python manage.py check# Create migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Collect static files
python manage.py collectstatic
# Run development server
python manage.py runserver 8001
# Django shell
python manage.py shell
# Check deployment readiness
python check_deployment.py
# Security check
python manage.py check --deploy- DEPLOYMENT.md: Complete production deployment guide
- FRONTEND_COMPLETE.md: Frontend implementation details
- SSR_MIGRATION.md: Server-side rendering notes
- SYSTEM_STATUS.md: System status and features
- Fork the repository
- Create feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Submit pull request
Proprietary - All rights reserved Β© 2024-2025
- In-App: Use the support ticket system
- Admin: Login to Django admin for backend management
- Documentation: See DEPLOYMENT.md for detailed guides
Built with Django 4.2.7 | Styled with Tesla-inspired design | Ready for Production π
prodig/
βββ manage.py
βββ requirements.txt
βββ config/
β βββ settings.py
β βββ urls.py
β βββ wsgi.py
β βββ celery.py
βββ apps/
β βββ users/
β βββ investments/
β βββ deposits/
β βββ withdrawals/
β βββ support/
βββ templates/
β βββ base.html
β βββ login.html
β π§ Configuration
### Environment Variables (.env)
**Development:**
```env
DEBUG=True
SECRET_KEY=development-key-change-in-production
ALLOWED_HOSTS=localhost,127.0.0.1
DB_ENGINE=django.db.backends.sqlite3
Production:
DEBUG=False
SECRET_KEY=<generate-strong-key>
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
DB_ENGINE=django.db.backends.postgresql
DB_NAME=investment_platform
DB_USER=postgres
DB_PASSWORD=<secure-password>
DB_HOST=localhost
DB_PORT=5432
CSRF_COOKIE_SECURE=True
SESSION_COOKIE_SECURE=True
SECURE_SSL_REDIRECT=True
SECURE_HSTS_SECONDS=31536000python check_deployment.pypython manage.py check --deploy# Test investment completion and earnings
python test_complete_inv.py
# Test database connectivity
python check_db.pyprodig/
βββ manage.py
βββ requirements.txt
βββ Procfile # Heroku/deployment
βββ runtime.txt # Python version
βββ DEPLOYMENT.md # Deployment guide
βββ check_deployment.py # Pre-deployment validator
βββ config/
β βββ settings.py # Base settings
β βββ settings_production.py # Production settings
β βββ urls.py
β βββ wsgi.py
β βββ context_processors.py
βββ apps/
β βββ users/ # User management
β β βββ models.py # CustomUser model
β β βββ views.py
β β βββ serializers.py
β β βββ urls.py
β βββ investments/ # Investment system
β β βββ models.py # InvestmentPlan, UserInvestment
β β βββ signals.py # Auto ROI crediting
β β βββ views.py
β βββ deposits/ # Deposit handling
β β βββ models.py # Deposit, CryptoWallet
β β βββ signals.py # Auto balance update
β β βββ views.py
β βββ withdrawals/ # Withdrawal system
β β βββ models.py # Withdrawal
β β βββ signals.py # Auto refund
β β βββ views.py
β βββ support/ # Support tickets
β βββ models.py # SupportTicket, SupportReply
β βββ admin.py # Inline admin replies
β βββ views.py
βββ templates/ # HTML templates (Tesla theme)
β βββ base.html # Master template
β βββ dashboard.html # Main dashboard
β βββ investments.html # Investment page
β βββ deposits.html # Deposit page
β βββ withdrawals.html # Withdrawal page
β βββ support.html # Support page
βββ static/ # Frontend assets
βββ css/
β βββ tesla.css # Tesla dark theme
βββ js/
βββ main.js # API utilities
βββ dashboard.js # Dashboard logic
βββ investments.js # Investment logic
βββ deposits.js # Deposit logic
βββ withdrawals.js # Withdrawal logic
βββ support.js # Support logic
- CSRF Protection: All forms protected
- Token Authentication: Secure API endpoints
- Password Hashing: Django PBKDF2 with SHA256
- SSL/HTTPS Support: Production-ready configuration
- Input Validation: Server-side validation
- XSS Protection: Template auto-escaping
- Secure Cookies: HTTPOnly, Secure, SameSite
- SQL Injection Protection: ORM parameterized queries
- Tesla Dark Theme: Professional black & gray design
- Mobile Responsive: Works on all device sizes
- Alpine.js: Interactive hamburger menu
- Real-time Updates: JavaScript fetches live data
- Status Badges: Color-coded transaction statuses
- Modal Dialogs: Support ticket details
- Form Validation: Client + server side
python manage.py makemigrations python manage.py migrate
### Load Sample Data
Create sample investment plans and crypto wallets through the admin panel.
## Deployment
### Using Gunicorn
```bash
pip install gunicorn
gunicorn config.wsgi:application --bind 0.0.0.0:8000
- Set
DEBUG=False - Update
SECRET_KEYto strong value - Configure
ALLOWED_HOSTS - Enable
SECURE_SSL_REDIRECT=True - Setup PostgreSQL database
- Use environment variables for sensitive data
For issues or questions, create a support ticket through the platform.
Proprietary - All rights reserved