Local development provides the maximum flexibility and control over your Spoo.me deployment. This method is ideal for developers who want to customize the codebase, add new features, or thoroughly understand how the application works.
Advanced Users Only: This method requires experience with Python development, uv package manager, and server management. It’s recommended for developers comfortable with command-line tools and debugging.
✅ Full Control: Complete access to modify code, add features, and customize functionality✅ Development Environment: Perfect for testing changes before deployment✅ Custom Integrations: Add analytics, SEO optimizations, or third-party integrations✅ Performance Tuning: Optimize database queries and server configuration✅ Learning Opportunity: Understand the complete application architecture
Start by cloning the Spoo.me repository to your local machine:
Copy
# Clone the repositorygit clone https://github.com/spoo-me/url-shortener.git# Navigate to the project directorycd url-shortener# List files to verify successful clonels -la
This downloads the complete source code, including all necessary configuration files and dependencies.
2
Installing Dependencies
We use uv to automatically setup the development environment and install the dependencies:
Windows
macOS/Linux
Copy
# Install uvpip install uv# Sync and install dependenciesuv sync
Copy
# Install uvpip3 install uv# Sync and install dependenciesuv sync
Your command prompt should now show (venv) at the beginning, indicating the virtual environment is active.
3
Configure Environment Variables
Create and configure your environment file:
Copy
# Create environment filetouch .env # On Windows: type nul > .env# Edit the file with your preferred editornano .env # or code .env, vim .env, etc.
Add your configuration variables:
Copy
# MongoDB ConfigurationMONGODB_URI=mongodb+srv://username:[email protected]/spoo-me?retryWrites=true&w=majorityMONGODB_URI_DEV=mongodb://localhost:27017/MONGO_DB_NAME=url-shortener# Discord WebhooksCONTACT_WEBHOOK=https://discord.com/api/webhooks/your-contact-webhook-id/your-webhook-tokenURL_REPORT_WEBHOOK=https://discord.com/api/webhooks/your-report-webhook-id/your-webhook-token# Redis Configuration (Optional)REDIS_URI=redis://localhost:6379REDIS_URI_DEV=redis://localhost:6379REDIS_TTL_SECONDS=3600# Flask ConfigurationFLASK_SECRET_KEY=your-random-secret-key-hereHOST_URI=127.0.0.1:8000SHORTEN_API_RATE_LIMIT_PER_HOUR=100# JWT Configuration (Required for v1 API)JWT_ISSUER=spoo.meJWT_AUDIENCE=spoo.meACCESS_TOKEN_TTL_SECONDS=3600REFRESH_TOKEN_TTL_SECONDS=2592000COOKIE_SECURE=falseJWT_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYour-Private-Key-Here\n-----END PRIVATE KEY-----"JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nYour-Public-Key-Here\n-----END PUBLIC KEY-----"# Google OAuth (Optional)GOOGLE_OAUTH_CLIENT_ID=your-google-client-id.apps.googleusercontent.comGOOGLE_OAUTH_CLIENT_SECRET=your-google-client-secretGOOGLE_OAUTH_REDIRECT_URI=http://127.0.0.1:8000/oauth/google/callback# GitHub OAuth (Optional)GITHUB_OAUTH_CLIENT_ID=your-github-client-idGITHUB_OAUTH_CLIENT_SECRET=your-github-client-secretGITHUB_OAUTH_REDIRECT_URI=http://127.0.0.1:8000/oauth/github/callback# Discord OAuth (Optional)DISCORD_OAUTH_CLIENT_ID=your-discord-client-idDISCORD_OAUTH_CLIENT_SECRET=your-discord-client-secretDISCORD_OAUTH_REDIRECT_URI=http://127.0.0.1:8000/oauth/discord/callback# HCaptcha (Optional)HCAPTCHA_SECRET=your-hcaptcha-secret# Development SettingsDEBUG=TruePORT=8000HOST=0.0.0.0
Never commit your .env file to version control. Add it to .gitignore to prevent accidental commits.
You should see the Spoo.me homepage. Test the URL shortening functionality to ensure everything is working correctly.
3
Test Core Features
Verify all functionality is working:Public Features (No Auth Required):
URL Shortening: Create a test short URL via v1 API (anonymous)
Analytics: Click the short URL and check public analytics
Contact Form: Submit the contact form to test webhooks
URL Reporting: Test the URL reporting feature
Authenticated Features (Requires Login):
5. User Login: Test OAuth login at http://localhost:8000/login
6. Dashboard Access: Verify dashboard loads at http://localhost:8000/dashboard
7. API Key Creation: Create a test API key in dashboard settings
8. URL Management: Test listing, updating, and deleting URLs via v1 API
9. Advanced Analytics: Test filtered analytics queries
Check your Discord channels to verify webhook notifications are being received.