A modern email client built with Next.js, Shadcn UI, and Supabase. This application provides a clean and intuitive interface for managing emails with features like authentication, real-time updates, and a responsive design.
- Modern UI with Shadcn UI components
- Authentication with Supabase (email/password + Google OAuth)
- Multi-account support for managing multiple email accounts
- Real-time email updates via Supabase subscriptions
- Responsive design that works on all devices
- Dark mode support with theme switching
- Rich text editor for email composition
- Advanced email management (folders, labels, priority, etc.)
- File attachments support
- Email scheduling and snoozing
- Search functionality with filters
This project follows a modular, feature-based architecture designed for scalability and maintainability:
src/
βββ features/ # Feature-based modules
β βββ auth/ # Authentication
β βββ mail/ # Email functionality
β βββ account/ # Account management
β βββ settings/ # User settings
βββ components/ # Shared components
β βββ ui/ # Base UI components
β βββ common/ # Common business components
β βββ layout/ # Layout components
βββ lib/ # Core utilities
β βββ instant/ # InstantDB placeholders (frontend-only)
β βββ constants/ # App constants
β βββ types/ # Global types
β βββ validations/ # Validation schemas
βββ app/ # Next.js App Router
βββ (auth)/ # Auth route group
βββ (dashboard)/ # Dashboard route group
βββ api/ # API routes
- Frontend: Next.js 14, React 18, TypeScript
- UI Framework: Shadcn UI (Radix UI primitives)
- Styling: Tailwind CSS
- Backend: Supabase (PostgreSQL, Auth, Real-time)
- Rich Text: TipTap editor
- State Management: React hooks + Context
- Validation: Zod schemas
- Icons: Lucide React
-
Clone the repository
git clone <repository-url> cd Q-mail
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables
cp .env.example .env.local
Add your Supabase credentials:
# Supabase removed. Placeholder envs will be added for InstantDB later. -
Set up the database
# Run Supabase migrations npx supabase db push -
Start the development server
npm run dev
# or
yarn dev
# or
pnpm dev- Open your browser Navigate to http://localhost:3000
Each feature is self-contained with its own components, hooks, services, and types:
auth/- Authentication, login, signup, password resetmail/- Email composition, display, list, managementaccount/- Multi-account switching, profile managementsettings/- User preferences, themes, notifications
ui/- Base UI components from Shadcn UIcommon/- Shared business components (loading, error handling)layout/- Layout components (header, sidebar, footer)
instant/- InstantDB placeholder clients (no network)constants/- Application constants and configurationstypes/- Global TypeScript type definitionsvalidations/- Zod validation schemasutils/- General utility functions
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
# Database
npm run db:push # Push database migrations
npm run db:reset # Reset database
npm run db:seed # Seed database with sample data- Feature-based: Each feature has its own directory with components, hooks, services, and types
- Barrel exports: Clean imports using index files
- Type safety: Comprehensive TypeScript types throughout
- Validation: Zod schemas for form validation
- Error handling: Error boundaries and proper error states
- Create a new feature directory in
src/features/ - Add the standard structure:
components/,hooks/,services/,types/,utils/ - Create an
index.tsfile for barrel exports - Add types to
src/lib/types/if needed - Add validation schemas to
src/lib/validations/if needed
# Run tests
npm run test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage- Architecture Guide - Detailed architecture documentation
- Migration Guide - Guide for updating imports after refactoring
- Refactoring Summary - Summary of the refactoring work
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
The app can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
- 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 structure and patterns
- Add proper TypeScript types
- Include validation schemas for forms
- Write tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js for the amazing React framework
- Shadcn UI for the beautiful component library // Supabase removed; backend will be rebuilt with InstantDB
- TipTap for the rich text editor
- Tailwind CSS for the utility-first CSS framework
If you have any questions or need help:
- Check the documentation
- Search existing issues
- Create a new issue
Built with β€οΈ using modern web technologies