You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full-stack social networking platform designed to help people discover meaningful connections through shared interests and activities. Built with Next.js, FastAPI, and Supabase.
CircleTime is a social networking application that emphasizes thoughtful matching, local community focus, and authentic relationships. The platform helps users:
Discover nearby people with similar interests
Create and join activities
Build meaningful connections through shared experiences
Track engagement through gamification features
Features
User Management & Authentication
Email/password authentication via Supabase
Comprehensive user profiles with interests, bio, and location
Profile management and updates
Social Connections
Friend System: Send, accept, and manage connection requests
Nearby Discovery: Location-based user matching using Haversine formula
Friend Suggestions: AI-powered recommendations based on interest similarity
Activities
Create activities with location, duration, and participant limits
Join and participate in community activities
Complete activities with photos and notes
Category-based organization
Activity Feed
Social feed showing completed activities
Photo galleries for activities
Like, comment, and share functionality
Engagement metrics
Gamification
Badges: Achievement system with rarity levels (common, rare, epic, legendary)
Streaks: Track consecutive activity participation
Seasonal Challenges: Time-limited events with progress tracking
API Requests: Token passed in Authorization header
Validation: Backend validates token on protected endpoints
Security Features
Password Requirements
Minimum 8 characters
At least one uppercase letter
At least one lowercase letter
At least one number
Input Validation
Email format validation (regex)
Username: alphanumeric + underscore only
Bio: 500 character limit
Interests: 10 maximum
XSS pattern detection and sanitization
Database Security (Row Level Security)
-- Users can only update their own profile
CREATE POLICY "Users can update own profile"ON user_profiles FOR UPDATE
USING (auth.uid() = id);
-- Users can view all profiles
CREATE POLICY "Users can view all profiles"ON user_profiles FOR SELECT
USING (true);
API Security Headers
Content-Security-Policy (CSP)
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: enabled
Strict-Transport-Security (HSTS)
Referrer-Policy: strict-origin-when-cross-origin
Rate Limiting
100 requests per minute per IP
Applied via middleware on both frontend and backend
Third-Party Integrations
Supabase
Authentication: User registration, login, JWT management
Database: PostgreSQL with Row Level Security
Real-time: Built-in real-time subscriptions
Storage: File storage for activity photos
Firebase
Cloud Messaging (FCM): Push notifications
Admin SDK: Server-side notification management
AI/ML Services
Sentence Transformers: Semantic embeddings for recommendations
OpenAI/Gemini: Vibe classification for activities
Google Maps
Geocoding: Location services
Maps Display: Activity location visualization
Getting Started
Prerequisites
Node.js 20+
Python 3.11+
Supabase account
Firebase project (for notifications)
Installation
Clone the repository
git clone https://github.com/pavan2184/Circletime.git
cd circletime
Set up the backend
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Build and run
docker-compose up --build
# Run in background
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
Docker Configuration
The Dockerfile uses a multi-stage build:
Base image: python:3.11-slim
Node.js: 20.x
Process manager: Supervisor
Services are exposed on:
Frontend: Port 3000
Backend: Port 8000
Environment Variables
Frontend (frontend/.env.local)
# SupabaseNEXT_PUBLIC_SUPABASE_URL=your_supabase_urlNEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key# FirebaseNEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_keyNEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.comNEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_idNEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.comNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_idNEXT_PUBLIC_FIREBASE_APP_ID=your_app_idNEXT_PUBLIC_FIREBASE_VAPID_KEY=your_vapid_key# Google MapsNEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_key# AI (optional)NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_key