# Post-Installation Checklist

Use this checklist to ensure your Investra platform is fully configured and ready for production.

## 🚨 Before You Begin

Legal Requirements

Before accepting real investments, ensure you have obtained all necessary licenses and consulted with a qualified legal professional. See the Investment & Legal Disclaimer for details.

## ✅ Complete Setup Checklist

### 1. Database & Environment

- [ ] Copy `.env.example` to `.env`
- [ ] Generate application key: `php artisan key:generate`
- [ ] Configure database credentials in `.env`
- [ ] Set `APP_URL` to your admin panel URL
- [ ] Configure mail credentials (SMTP, Mailgun, etc.)
- [ ] Configure Redis/caching if available

### 2. Storage & Permissions

- [ ] Run storage link command: `php artisan storage:link`

Or visit: `https://youradmin.com/admin/storage-link`

- [ ] Set folder permissions (775 for `storage`, `bootstrap/cache`)
- [ ] Verify file uploads work (upload an image in admin panel)

### 3. Payment Gateways

- [ ] Go to System Settings → Payment Gateways
- [ ] Enable at least one payment gateway
- [ ] Configure gateway credentials (Client ID, Secret Key)
- [ ] Set webhook URL in gateway dashboard:
- Stripe: `https://yourdomain.com/webhooks/stripe`
- PayPal: `https://yourdomain.com/webhooks/paypal`
- [ ] Test with sandbox credentials before production

### 4. Notification Settings

Go to System Settings → Notification Settings:

- [ ] Configure Global Template (required)
- [ ] Set up Email Settings (SMTP credentials)
- [ ] Optionally configure SMS Settings (Twilio, etc.)
- [ ] Optionally configure Push Notification Settings (Firebase)
- [ ] Create and enable notification templates

### 5. KYC Configuration

Go to System Settings → KYC Settings:

- [ ] Review default KYC fields
- [ ] Add fields required by your jurisdiction (National ID, Address Proof, etc.)
- [ ] Set fields as Required where needed
- [ ] Reorder fields by importance

See KYC Settings for details.

### 6. Currency Settings

Go to System Settings → Finance → Currency:

- [ ] Set base currency (USD default provided)
- [ ] Configure currency layer API key for live rates
- [ ] Add additional supported currencies
- [ ] Verify exchange rates are updating

Note: The free currencylayer.com API only supports USD. For multi-currency, obtain your own API key.

### 7. General Settings

Go to System Settings → General Settings:

- [ ] Set company/institution name
- [ ] Configure contact information (email, phone, address)
- [ ] Set platform timezone

### 8. Cron Job Setup

Set up the scheduler cron job on your server:

    * * * * * /usr/bin/php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1

Tasks handled by cron:

Task | Purpose
--- | ---
ROI Distribution | Distributes returns to investors
Project Status | Updates completion status
Deposit Expiry | Marks pending deposits as expired
Currency Refresh | Updates exchange rates

### 9. Queue Worker Setup (Production)

For production environments, run a queue worker:

    php artisan queue:work --queue=default

For production stability, use a process manager like Supervisor:

    [program:investra-worker]
    command=php /path-to-your-project/artisan queue:work --queue=default --tries=3 --timeout=120
    numprocs=2
    autostart=true
    autorestart=true

Jobs handled by queue:

Job | Purpose
--- | ---
Email Notifications | Transactional emails
SMS Notifications | SMS via provider
Push Notifications | Firebase notifications
Webhook Processing | Payment confirmations

### 10. User & Admin Settings

- [ ] Change default admin password
- [ ] Create additional admin users with appropriate roles
- [ ] Configure role-based permissions in Admin Users → Roles
- [ ] Review KYC Verification Workflow

### 11. Project Setup

Go to Manage Projects:

- [ ] Create project types (Types page)
- [ ] Add project cities (Cities page)
- [ ] Create your first project (Projects page)

### 12. Branding & Content

- [ ] Upload logo and favicon: Theme Settings → Logo and Favicon
- [ ] Configure menu structure: Navigation → Menu
- [ ] Set up CMS pages: Theme Settings → Manage Pages
- [ ] Add contact information: Contact Form Setup
- [ ] Configure social media links: Socialite Media

### 13. Mobile App (If Applicable)

- [ ] Update `EXPO_PUBLIC_API_BASE_URL` in mobile `.env`
- [ ] Configure Firebase credentials (google-services.json, GoogleService-Info.plist)
- [ ] Set up Stripe in mobile app config
- [ ] Build and test on devices before App Store submission

## 🧪 Verification Tests

After setup, verify everything works:

Test | Location | Expected Result
--- | --- | ---
User registration | Client frontend | Account created, KYC form shown
Deposit | User wallet | Payment gateway redirect works
Admin login | Admin panel | Login successful
KYC review | Admin → Users → Verify | Can approve/reject submissions
Email sending | User actions | Emails delivered
Cron logs | Admin → Cron Job Settings → Logs | Tasks executed

## 📋 Quick Reference Links

Setting | Path
--- | ---
Payment Gateways | System Settings → Payment Gateways
Notifications | System Settings → Notification Settings
KYC Settings | System Settings → KYC Settings
Currency | System Settings → Finance → Currency
Cron Jobs | System Settings → Cron Job Settings
User Management | Manage User → Users
Project Management | Manage Projects → Projects
Legal Disclaimer | Investment & Legal Disclaimer

## 🆘 Troubleshooting

If you encounter issues:

1. File uploads not working: Run storage link or check `APP_URL` in `.env`
2. Emails not sending: Verify SMTP credentials in notification settings
3. Cron not running: Check server cron configuration and logs
4. Queue jobs not processing: Ensure queue worker is running
5. Payment webhook failures: Verify webhook URL in gateway dashboard

See the Troubleshooting section for common issues.