An enterprise-grade, location-based event discovery and booking platform. SpotDrop utilizes a microservices architecture to identify vacant event spots and dynamically match them with users through AI-driven extraction, collaborative filtering, and schedule-aware recommendations.
SpotDrop is designed with a scalable, decoupled microservices topology:
- Presentation Tier: Cross-platform mobile application built with Flutter.
- Logic Tier (API Gateway): Laravel/PHP backend managing user authentication (Sanctum/Firebase), payment processing (Stripe), and core business routing.
- Data & AI Microservice: A high-performance FastAPI (Python) server dedicated to asynchronous web scraping, Natural Language Processing (NLP), and recommendation algorithms.
- Database Tier: PostgreSQL relational database for robust data persistence.
- Concurrent Crawling: Leverages
Playwrightandhttpxto efficiently navigate and extract dynamic DOM content from platforms like SF Funcheap and Eventbrite. - LLM Data Normalization: Integrates OpenAI's
gpt-4owith strict JSON-schema enforcement to parse unstructured HTML into highly structured event entities (title, datetime, location, description). - Idempotent Operations: Implements robust database Upserts (
on_conflict_do_updatein SQLAlchemy) using source URLs as unique constraints, guaranteeing data integrity and zero duplication during concurrent cron jobs.
- Item-kNN Collaborative Filtering: Computes event-to-event similarity utilizing
scipysparse matrices (CSR) and cosine similarity to generate personalized recommendations based on implicit user interactions. - Schedule-Aware Filtering: Integrates the Google Calendar API to fetch users' busy slots, applying complex datetime logic to exclusively recommend events that perfectly fit their availability (with automated 15-minute buffer windows).
- Conversational Discovery: Features an OpenAI-powered Chatbot MVP that cross-references user queries with database inventory to return context-aware JSON event payloads.
- Automated Copywriting: Uses engineered prompts to dynamically generate highly engaging, constraint-bound (<160 characters) push notifications tailored to specific user interests.
- Comprehensive Test Suite: Employs
pytestandpytest-asynciofor extensive unit and integration testing. - External Dependency Mocking: Ensures deterministic testing and zero API costs by rigorously mocking OpenAI, PostgreSQL, and Google Maps interfaces using
unittest.mock. - GitHub Actions: Configured automated CI pipelines (
test.yml,test_calendar_event_rec.yml) to validate code integrity on every push and pull request.
- Frameworks: FastAPI, Uvicorn, SQLAlchemy (Async)
- Data & AI: OpenAI API, SciPy, NumPy, Pandas
- Scraping: Playwright, BeautifulSoup4, HTTPX, AIOHTTP
- Integrations: Google Maps Geocoding API, Google Calendar API
- Testing: Pytest, Pytest-Asyncio, Pytest-Mock
- Deployment: Railway (Nixpacks)
Requires Python 3.8+. Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Install the required packages and Playwright browser binaries:
pip install -r requirements.txt
playwright install chromium
Create a .env file in the root directory:
OPENAI_API_KEY=your_openai_api_key
GOOGLE_MAPS_API_KEY=your_gmaps_api_key
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/spotdrop_db
Launch the FastAPI microservice with hot-reload:
uvicorn backend.app.main:app --reload
Execute the automated test suite to validate data models, mocked AI extraction, and calendar logic:
# Run all tests
pytest -v
# Run specific component tests
pytest -v tests/test_calendar_event_rec.py