-Connecting AI Talent with Opportunity
A modern, full-stack freelance marketplace platform specifically designed for connecting AI experts and developers with clients who need AI/ML services.
Features β’ Tech Stack β’ Getting Started β’ Documentation β’ Contributing
Tsunagu (ηΉγ - "to connect") is a purpose-built platform for the AI/ML freelance marketplace, featuring:
- π― Two User Types: Clients (post AI/ML projects) and Freelancers (submit proposals)
- π° Secure Payments: Milestone-based escrow system with Stripe Connect (50% upfront, 50% on completion)
- π Smart Search: Full-text search with PostgreSQL for projects and freelancers
- π¬ Real-time Messaging: Built-in messaging system for seamless communication
- π Notifications: Comprehensive in-app notification system
- π Project Management: Complete workflow from posting to delivery
- Payment Model: Fixed-price projects with milestone-based escrow
- Platform Fee: 15% (configurable)
- Core Flow: Project Posting β Proposal Submission β Hiring β Escrow Payment β Work Delivery β Payout
- Email/password authentication via Supabase Auth
- Role-based access control (Client, Freelancer, Admin)
- Email verification and password reset flows
- Server-side session management with protected routes
- Client Onboarding: Profile setup, company information, project goals, budget & timeline preferences
- Freelancer Onboarding: Professional profile, skills, portfolio, work experience, hourly rate
- Step-by-step guided process with progress tracking
- Multi-step project posting form with category-based organization
- Project statuses: Draft, Open, In Progress, Completed, Cancelled
- Project listing and detailed views
- Publish/unpublish and close project functionality
- Freelancer hiring workflow
- Freelancers submit proposals with cover letter, budget, and timeline
- Proposal statuses: Submitted, Under Review, Shortlisted, Accepted, Rejected, Withdrawn
- View tracking for client engagement
- Auto-create conversation on proposal acceptance
- Proposal statistics and analytics
- Advanced Filtering:
- Projects: Category, skills, budget range, full-text search
- Freelancers: Skills, hourly rate, experience, location, full-text search
- PostgreSQL Full-Text Search with GIN indexes
- Typo tolerance and weighted ranking
- Featured projects and top freelancers
- One-on-one conversations between clients and freelancers
- Unread message tracking
- Real-time messaging infrastructure ready
- Conversation search by participant name
- 7 notification categories with 35+ notification types
- In-app notifications with customizable preferences
- Unread count badges
- Mark as read/archive functionality
- Click-to-navigate with contextual action URLs
- Stripe Connect Integration: Standard accounts for freelancers
- Escrow System:
- 50% upfront payment held in platform account
- 50% completion payment after deliverable approval
- Platform Fee: 15% automatic deduction
- Payment Intents for secure transactions
- Automated transfers to freelancer accounts
- Webhook handlers for payment events
- Transaction history and ledger
- Client profiles with company details and project preferences
- Freelancer profiles with portfolio, work experience, and skills
- Profile visibility and discovery settings
- Freelancers submit project deliverables
- Client review and approval workflow
- Revision request system
- Framework: Next.js 15 (App Router, React 19)
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS v4
- UI Components: Radix UI + shadcn/ui
- State Management: TanStack Query (React Query)
- Forms: React Hook Form + Zod validation
- Internationalization: next-intl
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth with Row Level Security (RLS)
- Real-time: Supabase Realtime (infrastructure ready)
- API: tRPC + Next.js API Routes
- Payments: Stripe Connect for escrow and payouts
- Code Quality: Biome for linting and formatting
- Package Manager: pnpm
- Node.js 20+ and pnpm 10+
- Supabase Account (Create one free)
- Stripe Account (Sign up)
-
Clone the repository
git clone https://github.com/yourusername/tsunagu.git cd tsunagu -
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env
Fill in your environment variables:
# Supabase NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key SUPABASE_SERVICE_ROLE_KEY=your-service-role-key # Stripe STRIPE_SECRET_KEY=sk_test_... NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_... STRIPE_WEBHOOK_SECRET=whsec_... STRIPE_PLATFORM_FEE_PERCENTAGE=15 # App NEXT_PUBLIC_URL=http://localhost:3000 NEXT_PUBLIC_API_URL=http://localhost:3000/api
-
Set up the database
Run the migrations in the
supabase/migrations/folder in order (001-027) in your Supabase SQL Editor, or use the Supabase CLI:npx supabase db push
-
Run the development server
pnpm dev
-
Open your browser
Navigate to http://localhost:3000
tsunagu/
βββ src/
β βββ app/ # Next.js App Router
β β βββ [locale]/ # Internationalized routes
β β β βββ (auth)/ # Authentication pages
β β β βββ (public)/ # Public pages (homepage, browse)
β β β βββ (protected)/ # Protected pages (dashboard, projects)
β β βββ api/ # API routes (Stripe, payments, webhooks)
β β
β βββ features/ # Feature-based modules
β β βββ auth/ # Authentication
β β βββ onboarding/ # User onboarding
β β βββ projects/ # Project management
β β βββ proposals/ # Proposal system
β β βββ browse/ # Browse & search
β β βββ messaging/ # Messaging system
β β βββ notifications/ # Notification system
β β βββ payment/ # Payment UI
β β βββ profiles/ # User profiles
β β
β βββ components/ # Shared UI components
β β βββ ui/ # shadcn/ui components
β β βββ layouts/ # Layout components
β β βββ search/ # Search components
β β
β βββ lib/ # Utility libraries
β β βββ supabase/ # Supabase clients (server, client, admin)
β β βββ stripe/ # Stripe configuration
β β
β βββ server/ # Server-side code (tRPC)
β
βββ supabase/
β βββ migrations/ # Database migrations (001-027)
β
βββ public/ # Static assets
βββ email-templates/ # Email templates
-
CODEBASE_DOCUMENTATION.md - Comprehensive technical documentation (1,600+ lines)
- Complete database schema
- API reference
- Feature implementation details
- RLS policies
- Database functions
-
STRIPE_CONNECT_SETUP.md - Stripe integration guide (790 lines)
- Setup instructions
- Payment flow diagrams
- Webhook configuration
- Testing guide
-
SEARCH_IMPROVEMENT_PLAN.md - Search optimization roadmap
-
notifications.md - Notification types specification
The platform uses 15 core tables:
User Management: users, client_profiles, freelancer_profiles
Projects: projects, proposals, project_deliverables
Messaging: conversations, conversation_participants, messages
Notifications: notifications, notification_preferences
Payments: stripe_accounts, payment_intents, transfers, payment_transactions
See CODEBASE_DOCUMENTATION.md for detailed schema documentation.
pnpm dev # Start development server (with Turbopack)
pnpm build # Build for production
pnpm start # Start production server
pnpm check # Run Biome linter
pnpm check:write # Auto-fix linting issues
pnpm typecheck # TypeScript type checkingThis project uses Biome for fast, unified linting and formatting.
# Check code quality
pnpm check
# Auto-fix issues
pnpm check:write
# Unsafe auto-fix (use with caution)
pnpm check:unsafe- Authentication & authorization system
- User onboarding flows (client & freelancer)
- Project posting and management
- Proposal submission and review
- Browse and advanced search
- Messaging system
- Notification system
- Stripe Connect integration (backend complete)
- Stripe payment UI (frontend)
- Real-time message updates
- File attachments (projects, messages, deliverables)
- Email notifications (Resend/SendGrid)
- Reviews & ratings system
- Admin dashboard
- Advanced analytics
- Mobile responsiveness improvements
- Enhanced search with AI-powered matching
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style (enforced by Biome)
- Write descriptive commit messages
- Update documentation for new features
- Add tests where applicable
- Ensure
pnpm checkandpnpm typecheckpass
If you encounter any bugs or have feature suggestions, please open an issue with:
- Clear description of the issue/feature
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- Screenshots (if applicable)
This project is licensed under the MIT License - see the LICENSE file for details.
Built with these amazing open-source technologies:
- Next.js - The React Framework
- Supabase - Open source Firebase alternative
- Stripe - Payment infrastructure
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible components
- shadcn/ui - Re-usable components
- Documentation: CODEBASE_DOCUMENTATION.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
β Star this repository if you find it helpful!
Made with β€οΈ by the Tsunagu community