A modern, production-ready Instagram-like social media platform built with SvelteKit 5, Supabase, and modern web technologies.
Table of Contents
Likey is a production-ready, modern social media platform that recreates the Instagram experience with cutting-edge web technologies. Built with SvelteKit 5's latest features, real-time capabilities through Supabase, and optimized for performance and user experience.
- π± User Authentication: Secure email/password authentication with Supabase Auth
- π€ Profile Management: Customizable profiles with usernames, display names, bios, and profile pictures
- πΈ Photo Sharing: Upload and share multiple photos per post with automatic compression
- π Feed System: Infinite scroll home feed with posts from followed users
- β€οΈ Social Interactions: Like and comment on posts with real-time updates
- π₯ Following System: Follow/unfollow users with live follower counts
- π Real-time Notifications: Instant notifications for likes, comments, and new followers
- π¬ Direct Messaging: Real-time 1:1 chat with message history and context menus
- π Trending Algorithm: Score-based trending posts with time decay
- π Explore Page: Discover trending posts, popular users, and latest content
- π― User Recommendations: Intelligent user suggestions based on mutual connections
- β‘ Search System: Real-time user search with debounced queries
- π¨ Modern UI/UX: Glassmorphism design with smooth animations and transitions
- π Theme Support: Light/dark mode with system preference detection
- π± Responsive Design: Mobile-first design with desktop enhancements
- π Real-time Updates: Live updates using Supabase Realtime subscriptions
- SvelteKit 5 with modern runes syntax and server-side rendering
- JSDoc type annotations for type safety without TypeScript overhead
- PostgreSQL database with real-time subscriptions, auth, and storage
- Tailwind CSS v4 with utility-first styling
- Beautiful component library built on Tailwind CSS
- High-performance virtualization for rendering large lists
- Ultra-fast JavaScript runtime and package manager
- Beautiful, customizable SVG icons
- Modern JavaScript utility library for data manipulation
- Production-ready motion library for React and Svelte
- Lightning-fast build tool with hot module replacement
- Seamless deployment and hosting platform
Get a local copy up and running with these simple steps.
-
Bun (recommended) or Node.js 18+
curl -fsSL https://bun.sh/install | bashor
npm install -g npm@latest
-
Supabase Account - Sign up at supabase.com
-
Clone the repository
git clone https://github.com/soumikdas/Likey.git
-
Navigate to project directory
cd Likey -
Install dependencies
bun install # or npm install -
Set up environment variables
cp .env.example .env.local
Fill in your Supabase credentials:
PUBLIC_SUPABASE_URL=your_supabase_project_url PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Set up database schema
Option A: Using Supabase CLI (Recommended)
# Install Supabase CLI bun install -g supabase # Link to your project supabase link --project-ref YOUR_PROJECT_REF # Deploy schema supabase db push
Option B: Manual Setup
- Copy contents of
database-setup.sql - Run in Supabase SQL Editor
- Copy contents of
-
Start development server
bun run dev # or npm run dev -
Open your browser and navigate to
http://localhost:5173
- Create Account: Sign up with email and password
- Set Up Profile: Add display name, username, bio, and profile picture
- Explore Content: Browse trending posts and discover new users
- Start Posting: Share photos with captions and engage with the community
- Build Network: Follow interesting users and get recommendations
Content Creation:
- Upload multiple images per post with automatic compression
- Add captions and share with your followers
- Real-time post visibility in followers' feeds
Social Interaction:
- Like and comment on posts with instant updates
- Follow/unfollow users with live count updates
- Receive real-time notifications for all interactions
Discovery:
- Explore trending posts based on engagement algorithms
- Find new users through intelligent recommendations
- Search users by username or display name
Messaging:
- Send direct messages with real-time delivery
- Edit messages within 5 minutes of sending
- Forward messages to other conversations
- Context menu for message actions
Profile Management:
- Customize profile with bio, profile picture, and theme preferences
- View followers, following, and post statistics
- Manage account settings and privacy
- Frontend: SvelteKit 5 with modern runes syntax (
$state,$derived,$effect) - Backend: Supabase PostgreSQL with Row Level Security (RLS)
- Real-time: Supabase Realtime for live updates
- Storage: Supabase Storage for image hosting
- Styling: Tailwind CSS v4 with DaisyUI components
- Icons: Lucide Svelte for consistent SVG icons
- Build: Vite with SWC compiler for optimal performance
- Runtime: Bun for development and package management
- Deployment: Vercel with automatic deployments
src/
βββ lib/
β βββ components/ # Reusable Svelte components
β β βββ Navigation.svelte # Top navigation with auth state
β β βββ BottomNavigation.svelte # Mobile navigation
β β βββ Post.svelte # Post component with interactions
β β βββ Feed.svelte # Virtualized infinite scroll feed
β β βββ VirtualizedPostList.svelte # Common virtualized list component
β β βββ UserCard.svelte # User profile cards
β β βββ explore/ # Explore page components
β β β βββ TrendingSection.svelte
β β β βββ PeopleSection.svelte
β β β βββ LatestSection.svelte
β β βββ Modals/ # Authentication and post modals
β βββ composables/ # Reusable business logic
β β βββ useFollow.js # Centralized follow/unfollow logic
β βββ auth.js # Authentication logic
β βββ supabase.js # Supabase client and utilities
β βββ stores.js # Centralized state management
β βββ notifications.js # Real-time notification system
β βββ messages.js # Direct messaging API
β βββ search.js # Search and trending algorithms
β βββ utils.js # Utility functions
βββ routes/ # SvelteKit file-based routing
β βββ +layout.svelte # Main app layout
β βββ +page.svelte # Home feed
β βββ profile/[username]/ # Dynamic user profiles
β βββ post/[id]/ # Individual post pages
β βββ messages/ # Messaging interface
β βββ notifications/ # Notifications page
β βββ explore/ # Discovery and trending
β βββ settings/ # User settings
βββ app.css # Global styles with Tailwind
Core Tables:
profiles- User profile informationposts- User posts with metadatapost_images- Multiple images per postlikes- Post likes with user trackingcomments- Post comments with threading supportfollows- User follow relationshipsnotifications- Real-time notification systemconversations- Direct message conversationsmessages- Individual chat messages
Advanced Features:
trending_posts- Algorithmic trending calculationuser_recommendations- Intelligent user suggestions- Row Level Security (RLS) on all tables
- Real-time subscriptions for live updates
- Automated triggers for notification generation
- Supabase Auth: Industry-standard authentication with JWT tokens
- Row Level Security: Database-level access control for all tables
- Profile Protection: Users can only modify their own data
- Secure Sessions: Automatic session management with refresh tokens
- Input Validation: Comprehensive validation on all user inputs
- Image Security: File type validation and automatic compression
- SQL Injection Protection: Parameterized queries through Supabase
- CSRF Protection: Built-in protection through Supabase client
- Conversation Privacy: Only participants can access message threads
- Profile Visibility: Configurable privacy settings
- Secure File Upload: Validated image uploads with size limits
- Real-time Security: RLS policies applied to real-time subscriptions
- Virtualized Lists: Smart virtualization using TanStack Virtual for high-performance rendering of large post feeds
- Automatic threshold-based activation (50+ posts for feed, 20-30+ for other sections)
- Seamless switching between regular and virtualized modes
- Optimized memory usage and smooth scrolling for thousands of posts
- Infinite Scroll: Efficient pagination for large datasets with virtualized loading
- Image Compression: Automatic client-side image optimization
- Real-time Efficiency: Selective subscriptions for relevant data only
- Responsive Images: Multiple resolutions for different screen sizes
- Code Splitting: Route-based code splitting with SvelteKit
- SvelteKit 5: Latest framework features with optimal bundle sizes
- Vite Build: Lightning-fast development and production builds
- Modern CSS: Tailwind CSS v4 with advanced features
- Progressive Enhancement: Works without JavaScript for core features
-
Connect Repository
- Push code to GitHub
- Import project in Vercel dashboard
-
Environment Variables
PUBLIC_SUPABASE_URL=your_project_url PUBLIC_SUPABASE_ANON_KEY=your_anon_key -
Deploy
- Automatic deployments on every push to main
- Preview deployments for pull requests
-
Build the project
bun run build
-
Preview locally
bun run preview
-
Deploy to your platform using the generated build artifacts
- Modern Svelte 5: Utilizes latest Svelte features including runes and modern syntax
- Real-time Everything: Live updates for posts, messages, notifications, and user interactions
- Intelligent Algorithms: Score-based trending and recommendation systems
- Mobile-First Design: Optimized for mobile with progressive desktop enhancement and fixed navigation
- Type Safety: Comprehensive JSDoc annotations without TypeScript overhead
- Performance Optimized: Advanced virtualization, infinite scroll, image compression, and efficient real-time subscriptions
- Modern UI/UX: Glassmorphism design with smooth animations, branded color palette, and responsive navigation
- Composables Architecture: Reusable business logic with the useFollow composable eliminating code duplication across components
- Production Ready: Complete with security, error handling, and deployment configuration
Contributions make the open source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch
git checkout -b feature/AmazingFeature
- Install dependencies
bun install
- Set up your local environment following the installation guide
- Make your changes and test thoroughly
- Commit your Changes
git commit -m 'Add some AmazingFeature' - Push to the Branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Follow Svelte 5 modern syntax (use
$state,$derived,$effect) - Use JSDoc for type annotations
- Test your changes across different screen sizes
- Ensure real-time features work correctly
- Follow the existing code style and component patterns
Distributed under the MIT License. See LICENSE.txt for more information.
Project Link: https://github.com/soumikdas/Likey
~ Check out my other projects: https://github.com/FalconEthics
This project showcases modern full-stack development with cutting-edge technologies. It demonstrates expertise in:
- Modern Frontend Development: SvelteKit 5, Tailwind CSS, and responsive design
- Real-time Applications: Supabase Realtime for live user interactions
- Database Design: PostgreSQL with Row Level Security and complex relationships
- Performance Optimization: Infinite scroll, image compression, and efficient data loading
- User Experience: Mobile-first design with progressive enhancement
- Production Deployment: Vercel integration with CI/CD workflows
Perfect for learning modern web development patterns and building production-ready social applications.
