Skip to Content
Getting Started

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-packages

Step 2: Set Environment Variables

Create a .env file from the example:

cp .env.example .env

Edit .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_secret

Tip: For local testing, magic links print to the server console — no email service needed.

Step 3: Get Stripe Test Keys

  1. Go to dashboard.stripe.com 
  2. Click DevelopersAPI keys
  3. Copy your test mode keys (they start with sk_test_ and pk_test_)
  4. 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_)

Step 4: Initialize Database

python init_db.py

You 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.00

Step 5: Start the Server

python server.py

Visit http://localhost:5000 .

Step 6: Test Authentication

  1. Click Login / Sign Up
  2. Enter your email (can be fake for testing)
  3. Check the server console for the magic link
  4. Copy the magic link URL and paste it in your browser
  5. You should be logged in with 5 free credits

Step 7: Test Buying Credits

  1. Click + Buy More next to your credit balance
  2. Select a package
  3. 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

  • 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 .env matches the one from Stripe CLI

Database error

  • Delete greenmonkey.db and run python init_db.py again
  • 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.completed

Next Steps

Once local testing works:

  1. Read the Deployment Guide for production deployment
  2. Set up a real email service (SendGrid, Mailgun, etc.)
  3. Configure production Stripe keys
  4. Set up a PostgreSQL database
  5. Deploy to Vercel
Last updated on