A Next.js 15 application for tenant-landlord dispute management, built with UNIX principles for modular, maintainable code.
TALHub is a comprehensive platform that helps tenants and landlords manage disputes, track cases, share documents, and communicate effectively. The system includes role-based access control, real-time messaging, document management, and deadline tracking.
- Next.js 15 with App Router and Turbopack
- TypeScript with strict mode
- Tailwind CSS for styling
- Supabase for backend services (Auth, Database, Storage, Realtime)
- React Query for data fetching and caching
- Zod for validation
- React Hook Form for form handling
- Lucide React for icons
- Radix UI for accessible components
- Authentication: Magic link authentication with role-based access
- Case Management: Create and manage tenant-landlord disputes
- Document Sharing: Secure file upload and sharing with access control
- Real-time Messaging: Live chat within cases
- Deadline Tracking: Task management and reminders
- Role-based Access: Tenant, Landlord, Lawyer, and Admin roles
- Responsive Design: Mobile-first approach with dark/light themes
src/
├── app/ # Next.js App Router pages
│ ├── auth/ # Authentication pages
│ ├── dashboard/ # Main application dashboard
│ ├── onboarding/ # User onboarding flow
│ ├── help/ # Help and support pages
│ ├── layout.tsx # Root layout component
│ ├── page.tsx # Home page
│ └── globals.css # Global styles
├── components/ # Reusable UI components
│ ├── ui/ # Base UI components (Radix + Tailwind)
│ ├── auth-provider.tsx # Authentication context
│ ├── case-card.tsx # Case display components
│ ├── document-*.tsx # Document management
│ ├── message-*.tsx # Messaging components
│ └── deadline-*.tsx # Deadline management
├── lib/ # Utility functions and configurations
│ ├── actions/ # Server actions
│ ├── hooks/ # Custom React hooks
│ ├── supabase/ # Supabase client configuration
│ └── utils.ts # Utility functions
└── docs/ # Documentation
├── Supabase_Setup_Engineering_Notes_mvp.md
└── mock-data.md
The application uses Supabase with the following core entities:
- profiles: User profiles with role information
- cases: Dispute cases with metadata
- case_participants: Many-to-many relationship for case access
- documents: File metadata and storage paths
- messages: Real-time messaging within cases
- deadlines: Task and deadline tracking
- consultations: Lawyer consultation requests (Phase 2)
- payments: Payment tracking (Phase 2)
- Do One Thing Well: Each module/component has a single responsibility
- Work Together: Components are loosely coupled and composable
- Text as Interface: Configuration through environment variables and JSON
- KISS: Simple solutions over complex ones
- Rule of Silence: Minimal logging, clear error messages
- Rule of Repair: Fail fast with helpful error information
- Rule of Economy: Focus on readability and maintainability
- Node.js 18+
- npm or yarn
- Supabase account and project
-
Clone the repository:
git clone <repository-url> cd tal-hub
-
Install dependencies:
npm install
-
Set up environment variables:
cp env.example .env.local
Edit
.env.localwith your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Set up Supabase:
- Create a new Supabase project
- Run the SQL migrations (see
docs/Supabase_Setup_Engineering_Notes_mvp.md) - Set up Row Level Security (RLS) policies
- Configure storage bucket
talhub-docs - Set up authentication with magic links
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- Create test users: Sign up with different email addresses to test different roles
- Verify RLS: Ensure users can only see cases they're participants in
- Test messaging: Send messages between users in the same case
- Upload documents: Test file upload and access control
- Check deadlines: Create and manage deadlines within cases
- Follow UNIX principles in all code
- Keep components small and focused
- Use TypeScript strict mode
- Prefer composition over inheritance
- Write clear, self-documenting code
- Fail fast with helpful error messages
- Test RLS policies thoroughly
- Use React Query for all data fetching
- Implement proper error boundaries
The application includes mock data for development and testing:
- Test Users: tenant@example.com, landlord@example.com, lawyer@example.com
- Sample Cases: Non-payment dispute and renovation case
- Mock Documents: Sample files for testing upload/download
- Test Messages: Pre-populated conversations
- Sample Deadlines: Various task deadlines
See docs/mock-data.md for detailed information about the test data.
- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
The application can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase project URL | Yes |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anonymous key | Yes |
NEXT_PUBLIC_APP_URL |
Application URL | Yes |
- Fork the repository
- Create a feature branch
- Follow the UNIX principles and coding guidelines
- Test your changes thoroughly
- Submit a pull request
- Documentation: See
docs/folder for detailed setup guides - Help Page: Visit
/helpfor user guides and FAQ - Issues: Report bugs and feature requests via GitHub issues
[Add your license information here]