Getting Started
Get the Green Monkey Dashboard running locally in a few minutes.
Prerequisites
- Python 3.7+
- pip
- A Stripe account (for credit/payment features)
Step 1: Install Dependencies
pip install -r requirements.txt --break-system-packagesStep 2: Set Environment Variables
Create a .env file from the example:
cp .env.example .envEdit .env with your configuration:
SECRET_KEY=test-secret-key-change-in-production
BASE_URL=http://localhost:5000
DATABASE_URL=sqlite:///greenmonkey.db
# Stripe Test Keys (get from dashboard.stripe.com)
STRIPE_SECRET_KEY=sk_test_your_test_key_here
STRIPE_PUBLISHABLE_KEY=pk_test_your_test_key_here
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secretTip: For local testing, magic links print to the server console — no email service needed.
Step 3: Get Stripe Test Keys
- Go to dashboard.stripe.com
- Click Developers → API keys
- Copy your test mode keys (they start with
sk_test_andpk_test_) - For webhook secret:
- Install Stripe CLI:
brew install stripe/stripe-cli/stripe(macOS) - Login:
stripe login - Forward webhooks:
stripe listen --forward-to localhost:5000/api/stripe/webhook - Copy the webhook signing secret (starts with
whsec_)
- Install Stripe CLI:
Step 4: Initialize Database
python init_db.pyYou should see:
✅ Database tables created successfully!
✅ Seeded default credit packages:
- Starter Pack: 10 credits for $5.00
- Growth Pack: 20 credits for $8.00
- Pro Pack: 35 credits for $10.00Step 5: Start the Server
python server.pyVisit http://localhost:5000 .
Step 6: Test Authentication
- Click Login / Sign Up
- Enter your email (can be fake for testing)
- Check the server console for the magic link
- Copy the magic link URL and paste it in your browser
- You should be logged in with 5 free credits
Step 7: Test Buying Credits
- Click + Buy More next to your credit balance
- Select a package
- Click Buy Now — you’ll be redirected to Stripe Checkout
Use Stripe test cards:
- Success:
4242 4242 4242 4242 - Decline:
4000 0000 0000 0002 - Any future date for expiry, any 3-digit CVC
Troubleshooting
Magic link not working
- Check server console for the link
- Make sure the link hasn’t expired (15 min)
- Try requesting a new one
Credits not added after payment
- Make sure Stripe webhook is running:
stripe listen --forward-to localhost:5000/api/stripe/webhook - Check server console for webhook events
- Verify webhook secret in
.envmatches the one from Stripe CLI
Database error
- Delete
greenmonkey.dband runpython init_db.pyagain - Make sure SQLite is installed
Useful Commands
# Reset database (start fresh)
rm greenmonkey.db && python init_db.py
# Check database contents
sqlite3 greenmonkey.db "SELECT * FROM users;"
# Test Stripe webhook locally
stripe listen --forward-to localhost:5000/api/stripe/webhook
# Trigger test webhook
stripe trigger checkout.session.completedNext Steps
Once local testing works:
- Read the Deployment Guide for production deployment
- Set up a real email service (SendGrid, Mailgun, etc.)
- Configure production Stripe keys
- Set up a PostgreSQL database
- Deploy to Vercel
Last updated on