A modern social platform for developers to share ideas, build communities, and connect with like-minded developers worldwide.
- Overview
- Tech Stack
- Features
- Project Structure
- Getting Started
- Installation
- Environment Setup
- Running the Project
- Contributing
- Code Style
- Git Workflow
- Key Components
- Database Schema
- Common Tasks
- Troubleshooting
DevConnect is a full-stack web application that enables developers to:
- Create and share posts with the community
- Form and manage communities around shared interests
- Engage through nested comments and replies
- Like and interact with posts
- Discover other developers and their work
- React 18 - UI library
- TypeScript - Type safety
- Tailwind CSS - Styling
- React Router - Navigation
- TanStack Query - Data fetching & caching
- Supabase Client - Real-time database client
- Lucide React - Icon library
- Supabase - PostgreSQL database & authentication
- GitHub OAuth - Social authentication
- Vite - Build tool
- ESLint - Code linting
- Prettier - Code formatting
- π GitHub Authentication - Sign in with GitHub account ,Gmail based authentication
- π Create Posts - Share posts with images and content
- π€ Profile Dashboard - View user details, email, account info, and manage sessions
- βοΈ Profile Editing - Update profile information including bio, location, website, and social links (GitHub, Twitter)
- πΌοΈ Avatar Upload - Upload custom profile pictures with real-time preview
- π Real-time Dashboard - Monitor your activity with live-updating dashboard and recent activity feed
- π¬ Nested Comments - Multi-level comment threads with collapse/expand
- π₯ Communities - Create and manage developer communities
- β€οΈ Likes System - Vote on posts and comments
- π¬ Real-Time Messaging - Direct messages and group chats with live updates
- π File Sharing - Share images and files in conversations
- π Live Notifications - Real-time typing indicators and message notifications
- π€ User Presence - See who's online and their status
- π Event Management - Create, manage, and attend developer events and meetups
- ποΈ Event Registration - RSVP system with attendance tracking
- π Virtual Events - Support for online events with meeting links
- πΈ Event Detail Pages - Beautiful, comprehensive event pages with banner images and rich details
- π Real-time Event Stats - Live updating event statistics and attendee information
- π¨ Modern UI - Dark theme with cyan accents, professional design
- π± Responsive Design - Works on desktop and mobile
src/
βββ components/
β βββ Navbar.tsx # Navigation bar
β βββ PostItem.tsx # Individual post card
β βββ PostList.tsx # List of all posts
β βββ PostDetail.tsx # Full post view
β βββ CommentItem.tsx # Individual comment
β βββ CommentSection.tsx # Comments container
β βββ LikeButton.tsx # Like/vote button
β βββ CommunityList.tsx # List of communities
β βββ CommunityDisplay.tsx # Posts in a community
β βββ CreatePost.tsx # Post creation form
β βββ CreateCommunity.tsx # Community creation form
β βββ MessagingInterface.tsx # Main messaging layout
β βββ ConversationList.tsx # Conversation sidebar
β βββ MessageList.tsx # Message display area
β βββ MessageInput.tsx # Message composition
β βββ ConversationHeader.tsx # Chat header with actions
β βββ CreateConversationModal.tsx # New chat creation
β βββ MessageNotificationBadge.tsx # Unread message indicator
β βββ EventCard.tsx # Individual event card
β βββ EventList.tsx # List of events
β βββ EventDetail.tsx # Full event view
β βββ CreateEventForm.tsx # Event creation form
β βββ EventFilters.tsx # Event filtering controls
β βββ AttendeeList.tsx # Event attendees display
β βββ EventActions.tsx # Event interaction buttons
βββ pages/
β βββ Home.tsx # Home page
β βββ PostPage.tsx # Post detail page
β βββ CommunitiesPage.tsx # Communities listing page
β βββ CommunityPage.tsx # Single community page
β βββ CreatePostPage.tsx # Post creation page
β βββ CreateCommunityPage.tsx # Community creation page
β βββ MessagesPage.tsx # Messaging interface page
β βββ EventsPage.tsx # Events listing page
β βββ CreateEventPage.tsx # Event creation page
β βββ EventDetailPage.tsx # Single event page
βββ context/
β βββ AuthContext.tsx # Authentication context
| βββ ThemeContext.tsx # Dark/light theme context
βββ hooks/
β βββ useMessaging.ts # Messaging-related hooks
βββ types/
β βββ messaging.ts # TypeScript interfaces for messaging
β βββ events.ts # TypeScript interfaces for events
βββ supabase-client.ts # Supabase configuration
βββ theme.css # Theme-related global styles
βββ App.tsx # Main app component
βββ index.css # Global styles
- Node.js 16+ and npm/yarn
- Git
- A Supabase account
- A GitHub OAuth application
- Clone the repository
git clone https://github.com/yourusername/devconnect.git
cd devconnect- Install dependencies
npm install- Create a
.envfile in the root directory:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key- Set up GitHub OAuth
- Go to GitHub Settings β Developer settings β OAuth Apps
- Create a new OAuth App
- Set Authorization callback URL to http://localhost:5173/auth/callback
- Add credentials to Supabase Authentication
- Create a new Supabase project
- Create tables with the following schema:
Posts Table
CREATE TABLE Posts (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
title TEXT NOT NULL,
content TEXT NOT NULL,
image_url TEXT,
avatar_url TEXT,
community_id BIGINT REFERENCES Communities(id),
user_id UUID NOT NULL,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);Comments Table
CREATE TABLE Comments (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
post_id BIGINT NOT NULL REFERENCES Posts(id),
content TEXT NOT NULL,
author TEXT NOT NULL,
avatar_url TEXT,
user_id UUID NOT NULL,
parent_comment_id BIGINT REFERENCES Comments(id),
created_at TIMESTAMP DEFAULT NOW()
);Communities Table
CREATE TABLE Communities (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name TEXT NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT NOW()
);Votes Table
CREATE TABLE Votes (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
post_id BIGINT NOT NULL REFERENCES Posts(id),
user_id UUID NOT NULL,
vote INT DEFAULT 1,
created_at TIMESTAMP DEFAULT NOW(),
UNIQUE(post_id, user_id)
);Events Table
CREATE TABLE Events (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
title TEXT NOT NULL,
description TEXT NOT NULL,
event_date TIMESTAMP NOT NULL,
location TEXT,
is_virtual BOOLEAN DEFAULT FALSE,
meeting_link TEXT,
max_attendees INTEGER,
image_url TEXT,
tags TEXT[],
organizer_id UUID NOT NULL REFERENCES auth.users(id),
community_id BIGINT REFERENCES Communities(id),
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);Event Attendees Table
CREATE TABLE EventAttendees (
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
event_id BIGINT NOT NULL REFERENCES Events(id) ON DELETE CASCADE,
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
status TEXT DEFAULT 'attending' CHECK (status IN ('attending', 'maybe', 'not_attending')),
registered_at TIMESTAMP DEFAULT NOW(),
UNIQUE(event_id, user_id)
);Messaging Tables
For the complete messaging schema including conversations, messages, reactions, and real-time features, see database-schema-messaging.sql.
Storage Setup
- Create a bucket named
post-imagesin Supabase Storage - Create a bucket named
message-filesin Supabase Storage (private) - Create a bucket named
event-imagesin Supabase Storage (public) - Set
post-imagesbucket to public - Set
message-filesbucket to private - Set
event-imagesbucket to public
# Development
npm run dev
# Build
npm run build
# Preview build
npm run preview
# Lint
npm run lintThe app will be available at http://localhost:5173
For detailed instructions on setting up the real-time messaging system, see MESSAGING_SETUP.md.
Quick setup:
- Run the SQL schema from
database-schema-messaging.sql - Create the
message-filesstorage bucket (private) - Enable real-time for messaging tables
- Navigate to
/messagesto start chatting!
For detailed instructions on setting up the event management system, see the documentation in /docs/:
- EVENT_SCHEMA.md - Database schema and relationships
- EVENT_API.md - API endpoints and usage
- EVENT_TYPES.md - TypeScript type definitions
- EVENT_INTEGRATION.md - Integration patterns and hooks
Quick setup:
- Run the SQL schema from
docs/EVENT_SCHEMA.md - Create the
event-imagesstorage bucket (public) - Navigate to
/eventsto start creating events!
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name- Make your changes
- Test your changes
- Commit with clear messages
git commit -m "feat: add new feature description"- Push to your fork
git push origin feature/your-feature-name- Open a Pull Request
- β Bug fixes
- β Feature enhancements
- β UI/UX improvements
- β Performance optimizations
- β Documentation improvements
- β Accessibility improvements
- Use explicit type annotations
- Avoid
anytype - Create interfaces for data structures
- Use strict mode
- Use functional components with hooks
- Keep components focused and reusable
- Use proper TypeScript types for props
- Avoid inline styles (use Tailwind)
- Components: PascalCase (e.g., PostItem.tsx)
- Functions: camelCase (e.g., fetchPosts)
- Constants: UPPER_SNAKE_CASE (e.g., MAX_ITEMS)
- Files: Match component/function name or use kebab-case
# Format code
npm run format
# Lint and fix
npm run lint -- --fix<type>: <subject>
<body>
<footer>
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringperf: Performance improvementstest: Adding testschore: Build, dependency updates
Example:
feat: add nested comments support
Implemented multi-level comment threads with collapse/expand functionality.
Added CommentItem component to handle recursive rendering.
Closes #123
Manages user authentication state including email/password login, GitHub OAuth, logout, password reset, and profile session handling.
const { signInWithGithub, signOut, user, isLoading } = useAuth();Displays individual posts and collections of posts with lazy loading.
Handles nested comment threads with real-time updates using TanStack Query.
Manages post votes with optimistic updates and cache invalidation.
Shows community listings and posts within communities.
/signinβ Email & GitHub login/signupβ Create account/reset-passwordβ Password recovery/profileβ User profile dashboard
- Users β Posts (1:N)
- Posts β Comments (1:N)
- Comments β Comments (1:N, self-referencing for nested replies)
- Posts β Communities (N:1)
- Posts β Votes (1:N)
- Events β Users (organizer_id): Many-to-One
- Events β Communities (community_id): Many-to-One (optional)
- Events β EventAttendees: One-to-Many
- EventAttendees β Users: Many-to-One
Get posts with community info:
SELECT *, Communities(name) FROM PostsGet comments with nested structure:
SELECT * FROM Comments WHERE post_id = ? ORDER BY created_atGet likes for a post:
SELECT COUNT(*) FROM Votes WHERE post_id = ? AND vote = 1- Create components in
src/components/ - Create page (if needed) in
src/pages/ - Update routing in
App.tsx - Add data fetching using TanStack Query
- Style with Tailwind CSS
- Test thoroughly
- Update documentation
import { useQuery } from '@tanstack/react-query';
import { supabase } from '../supabase-client';
const { data, isLoading, error } = useQuery({
queryKey: ['posts'],
queryFn: async () => {
const { data, error } = await supabase
.from('Posts')
.select('*')
.order('created_at', { ascending: false });
if (error) throw new Error(error.message);
return data;
}
});Use Tailwind CSS classes:
<div className="bg-slate-900/50 border border-slate-800 rounded-lg p-4">
<h2 className="text-xl font-semibold text-white">Title</h2>
</div>Solution: Table names are case-sensitive. Ensure you're using the correct casing (e.g., Comments, not comments).
Solution: Check that the post-images bucket exists in Supabase Storage and is set to public.
Solution: Verify GitHub OAuth credentials are correctly set in Supabase and the callback URL matches your app URL.
Solution: Check database permissions in Supabase. Ensure RLS policies allow reading comments.
Solution:
# Clear node modules and reinstall
rm -rf node_modules package-lock.json
npm install
npm run buildThis project is licensed under the MIT License - see the LICENSE file for details.
Have questions?
- Open an issue on GitHub
- Check existing issues for solutions
- Join our discussions
Thanks to all contributors who have helped improve DevConnect!
Happy coding! π

