A real-time analytics platform built with FastAPI. Track events, analyze user behavior, and get instant insights.
🚧 Status: Currently in Step 1 - Basic implementation with in-memory storage
- ✅ Event Ingestion - POST
/eventsto track user actions - ✅ Basic Analytics - GET
/analytics/summaryfor insights - ✅ REST API - Clean, documented endpoints
- ✅ Auto Documentation - Swagger UI at
/docs - ✅ Test Coverage - Comprehensive test suite
- Python 3.8+
- pip
# Clone and setup
git clone https://github.com/shankarkarki/analytics-platform.git
cd analytics-platform
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On macOS/Linux
# Install dependencies
pip install -r requirements.txt
# Run the server
python main.pyServer runs at: http://localhost:8000
curl http://localhost:8000curl -X POST "http://localhost:8000/events" \
-H "Content-Type: application/json" \
-d '{
"event_name": "user_signup",
"user_id": "user123",
"properties": {"source": "landing_page"}
}'curl http://localhost:8000/analytics/summaryVisit: http://localhost:8000/docs
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Health check |
POST |
/events |
Send event data |
GET |
/events |
Get recent events |
GET |
/analytics/summary |
Analytics overview |
# Run tests
pytest
# Run with details
pytest -v
# Test specific file
pytest test_main.pyanalytics-platform/
├── main.py # 🚀 FastAPI app
├── test_main.py # 🧪 Tests
├── requirements.txt # 📦 Dependencies
├── .env.example # ⚙️ Config template
└── README.md # 📖 This file
- Basic FastAPI setup
- Event ingestion
- Simple analytics
- Test coverage
- PostgreSQL integration
- Data persistence
- Event history
- Real-time dashboards
- User authentication
- Advanced analytics