Skip to content

itsiamdev/Connecto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Connecto - Social Media Platform πŸŽ‰

Connecto Logo

A modern social media platform built with React, TypeScript, and Supabase πŸš€

Live Demo

Screenshots

Screenshot 1 Screenshot 2

Features β€’ Tech Stack β€’ Getting Started β€’ Project Structure β€’ Environment Variables β€’ License


Features ✨

Core Features ✨

  • User Authentication πŸ” - Secure sign up/sign in with email and password
  • Posts πŸ“ - Create, view, like, and comment on posts
  • Stories πŸ“Έ - Share temporary content that expires after 24 hours
  • Comments πŸ’¬ - Interactive comment system on posts
  • Connections 🀝 - Send and manage connection requests
  • Follow System πŸ‘₯ - Follow other users to see their content
  • Messages πŸ’­ - Real-time private messaging between users
  • Notifications πŸ”” - Stay updated with notifications for various activities
  • User Profiles πŸ‘€ - Customizable profiles with bio, avatar, and cover image
  • Discover/Explore πŸ” - Discover new content and users
  • Dark/Light Theme πŸŒ™ - System-wide theme switching

Additional Features πŸ’‘

  • Image Upload πŸ–ΌοΈ - Upload images for posts and profiles
  • Video Upload πŸŽ₯ - Upload videos for stories and posts
  • Post Insights πŸ“Š - View engagement metrics on your posts
  • Suggested Users 🎯 - Get recommendations for users to follow
  • Online Status 🟒 - See when users are online or last active
  • Real-time Updates ⚑ - Live updates for likes, comments, and posts
  • Account Deletion πŸ—‘οΈ - Delete your account and data permanently
  • Privacy Policy πŸ“œ - Comprehensive privacy policy page
  • Terms of Service πŸ“‹ - Terms and conditions page

Tech Stack πŸ› οΈ

Frontend 🎨

  • React 18 βš›οΈ - UI library
  • TypeScript πŸ“˜ - Type-safe JavaScript
  • Vite ⚑ - Build tool and dev server
  • Tailwind CSS πŸ’¨ - Utility-first CSS framework
  • Shadcn/UI 🎭 - Component library
  • React Router πŸ›€οΈ - Client-side routing
  • Supabase Client ☁️ - Backend integration

Backend (Supabase) ☁️

  • PostgreSQL 🐘 - Relational database
  • Authentication πŸ” - User management
  • Storage πŸ“¦ - File storage for images/videos
  • Realtime πŸ“‘ - Real-time subscriptions
  • Edge Functions ⚑ - Serverless functions

Development Tools πŸ”§

  • ESLint πŸ” - Code linting
  • Vitest πŸ§ͺ - Testing framework
  • Bun 🐰 - JavaScript runtime and package manager

Getting Started 🏁

Prerequisites πŸ“‹

  • Node.js 18+ 🟒
  • Bun 🐰 (recommended) or npm/yarn πŸ“¦
  • Supabase Account ☁️ - Create one here

Installation πŸ“¦

  1. Clone the repository πŸ“‚

    git clone <repository-url>
    cd Connecto
  2. Install dependencies πŸ“₯

    # Using bun (recommended)
    bun install
    
    # Or using npm
    npm install
  3. Set up Supabase πŸ”§

    a. Create a new Supabase project at supabase.com

    b. Run the migrations in supabase/migrations/:

    • 20260213165028_e62793d5-3a85-4007-aaf2-1c00786516a8.sql
    • 20260215164637_f1fe321b-40be-4525-995f-f720d815633a.sql
    • 20260216181409_f2603ac3-5bd1-41d5-93e8-3f79b2947bdb.sql
    • 20260221100451_7332021c-64d6-475d-a30e-ae91ea2b38a3.sql
    • 20260301132000_add_last_seen_at.sql
    • 20260301134000_enable_realtime.sql
    • 20260311201500_make_username_required.sql

    c. Configure storage bucket for media uploads

    d. Set up authentication settings

  4. Configure Environment Variables βš™οΈ

    Create a .env file in the root directory:

    VITE_SUPABASE_URL=your_supabase_url
    VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
  5. Start the development server πŸš‚

    # Using bun
    bun dev
    
    # Or using npm
    npm run dev
  6. Open your browser 🌐 Navigate to http://localhost:5173


Project Structure πŸ“

Connecto/
β”œβ”€β”€ public/                    # Static assets
β”‚   β”œβ”€β”€ favicon.ico           # Site favicon
β”‚   β”œβ”€β”€ placeholder.svg       # Placeholder images
β”‚   └── robots.txt           # SEO robots file
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/               # Application assets
β”‚   β”‚   β”œβ”€β”€ connecto-icon.png
β”‚   β”‚   β”œβ”€β”€ connecto-logo.png
β”‚   β”‚   └── login.avif
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ auth/            # Authentication components
β”‚   β”‚   β”‚   └── ProtectedRoute.tsx
β”‚   β”‚   β”œβ”€β”€ layout/          # Layout components
β”‚   β”‚   β”‚   β”œβ”€β”€ EmailVerificationBanner.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ MobileNav.tsx
β”‚   β”‚   β”‚   └── Sidebar.tsx
β”‚   β”‚   β”œβ”€β”€ posts/           # Post-related components
β”‚   β”‚   β”‚   β”œβ”€β”€ CommentsSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PostCard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PostComposer.tsx
β”‚   β”‚   β”‚   └── PostInsights.tsx
β”‚   β”‚   β”œβ”€β”€ stories/         # Story components
β”‚   β”‚   β”‚   β”œβ”€β”€ Stories.tsx
β”‚   β”‚   β”‚   └── StoryViewer.tsx
β”‚   β”‚   β”œβ”€β”€ ui/              # UI components (Shad β”‚   β”‚  cn)
β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dialog.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ OnlineIndicator.tsx  # Online status indicator
β”‚   β”‚   β”‚   └── ... (many more)
β”‚   β”‚   └── users/           # User-related components
β”‚   β”‚       └── SuggestedUsers.tsx
β”‚   β”œβ”€β”€ contexts/            # React contexts
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx  # Authentication context
β”‚   β”‚   └── ThemeContext.tsx # Theme context
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useComments.ts
β”‚   β”‚   β”œβ”€β”€ useConnections.ts
β”‚   β”‚   β”œβ”€β”€ useFollows.ts
β”‚   β”‚   β”œβ”€β”€ useMessages.ts
β”‚   β”‚   β”œβ”€β”€ useNotifications.ts
β”‚   β”‚   β”œβ”€β”€ usePosts.ts
β”‚   β”‚   β”œβ”€β”€ useProfile.ts
β”‚   β”‚   β”œβ”€β”€ useStories.ts
β”‚   β”‚   β”œβ”€β”€ useSuggestedUsers.ts
β”‚   β”‚   └── useUpdateLastSeen.ts  # Auto-update last_seen timestamp
β”‚   β”œβ”€β”€ integrations/        # External integrations
β”‚   β”‚   └── supabase/
β”‚   β”‚       β”œβ”€β”€ client.ts    # Supabase client setup
β”‚   β”‚       └── types.ts     # TypeScript types
β”‚   β”œβ”€β”€ lib/                 # Utility libraries
β”‚   β”‚   └── utils.ts         # Helper functions
β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”‚   β”œβ”€β”€ Auth.tsx         # Authentication page
β”‚   β”‚   β”œβ”€β”€ Chat.tsx         # Chat page
β”‚   β”‚   β”œβ”€β”€ Connections.tsx  # Connections page
β”‚   β”‚   β”œβ”€β”€ Create.tsx       # Create post/story page
β”‚   β”‚   β”œβ”€β”€ Discover.tsx     # Discover page
β”‚   β”‚   β”œβ”€β”€ Explore.tsx      # Explore page
β”‚   β”‚   β”œβ”€β”€ Index.tsx        # Home/Feed page
β”‚   β”‚   β”œβ”€β”€ Messages.tsx     # Messages page
β”‚   β”‚   β”œβ”€β”€ Notifications.tsx# Notifications page
β”‚   β”‚   β”œβ”€β”€ Profile.tsx      # User profile page
β”‚   β”‚   β”œβ”€β”€ Settings.tsx     # Settings page
β”‚   β”‚   β”œβ”€β”€ UserProfile.tsx  # Other user profile
β”‚   β”‚   └── NotFound.tsx     # 404 page
β”‚   β”œβ”€β”€ test/                # Test files
β”‚   β”œβ”€β”€ App.css              # App styles
β”‚   β”œβ”€β”€ App.tsx              # Main App component
β”‚   β”œβ”€β”€ index.css            # Global styles
β”‚   └── main.tsx             # Entry point
β”œβ”€β”€ supabase/                # Supabase configuration
β”‚   β”œβ”€β”€ config.toml          # Supabase config
β”‚   β”œβ”€β”€ functions/           # Edge functions
β”‚   β”‚   β”œβ”€β”€ delete-account/
β”‚   β”‚   β”‚   └── index.ts     # Delete account function
β”‚   β”‚   └── signup/
β”‚   β”‚       └── index.ts     # Custom signup function
β”‚   └── migrations/          # Database migrations
β”‚       β”œβ”€β”€ 20260213165028_e62793d5-3a85-4007-aaf2-1c00786516a8.sql
β”‚       β”œβ”€β”€ 20260215164637_f1fe321b-40be-4525-995f-f720d815633a.sql
β”‚       β”œβ”€β”€ 20260216181409_f2603ac3-5bd1-41d5-93e8-3f79b2947bdb.sql
β”‚       β”œβ”€β”€ 20260221100451_7332021c-64d6-475d-a30e-ae91ea2b38a3.sql
β”‚       β”œβ”€β”€ 20260301132000_add_last_seen_at.sql
β”‚       β”œβ”€β”€ 20260301134000_enable_realtime.sql
β”‚       └── 20260311201500_make_username_required.sql
β”œβ”€β”€ components.json          # Shadcn components config
β”œβ”€β”€ eslint.config.js         # ESLint configuration
β”œβ”€β”€ index.html               # HTML entry point
β”œβ”€β”€ package.json             # Dependencies
β”œβ”€β”€ postcss.config.js        # PostCSS config
β”œβ”€β”€ tailwind.config.ts       # Tailwind config
β”œβ”€β”€ tsconfig.json            # TypeScript config
β”œβ”€β”€ tsconfig.app.json        # TypeScript app config
β”œβ”€β”€ tsconfig.node.json       # TypeScript node config
β”œβ”€β”€ vite.config.ts           # Vite config
β”œβ”€β”€ vitest.config.ts         # Vitest config
└── .env                     # Environment variables (not committed)

Environment Variables 🌍

Variable Description Required
VITE_SUPABASE_URL Your Supabase project URL Yes
VITE_SUPABASE_ANON_KEY Your Supabase anon key Yes

Getting Supabase Credentials πŸ”‘

  1. Go to Supabase Dashboard
  2. Select your project
  3. Go to Settings β†’ API
  4. Copy the Project URL and anon public key

Available Scripts πŸ“œ

# Development
bun dev          # Start development server
bun build        # Build for production
bun preview      # Preview production build

# Testing
bun test         # Run tests
bun test:watch   # Run tests in watch mode

# Linting
bun lint         # Run ESLint

# Type checking
bun typecheck    # Run TypeScript type checking

Database Schema πŸ—„οΈ

The application uses the following main tables:

  • users πŸ‘€ - User profiles and information
  • profiles πŸ‘€ - Extended profile information with last_seen_at
  • posts πŸ“„ - User posts with text, images, videos
  • comments πŸ’¬ - Comments on posts
  • likes ❀️ - Post likes (real-time enabled)
  • stories ⏰ - Temporary stories (24h expiry)
  • follows πŸ‘₯ - Follow relationships
  • connections 🀝 - Connection requests and status
  • messages βœ‰οΈ - Private messages
  • notifications πŸ”” - User notifications
  • saved_posts πŸ“‘ - Saved posts (real-time enabled)
  • story_views πŸ‘οΈ - Story view tracking

Contributing 🀝

Contributions are welcome! Please read our Contributing Guidelines before submitting pull requests.


Code of Conduct πŸ“–

Please read our Code of Conduct to keep our community approachable and respectable.


Security πŸ”’

For security vulnerabilities, please read our Security Policy.


License πŸ“„

This project is licensed under the MIT License - see the LICENSE file for details.


Acknowledgments πŸ™


Made with ❀️ by Connecto Team