A complete web-based SaaS application for managing clients, projects, and tasks with dashboards, analytics, and subscription billing.
- Authentication: Email/password login with NextAuth
- Client Management: Add, edit, delete clients with contact information
- Project Management: Create projects, track status, link to clients
- Task Management: Comprehensive task system with priorities and due dates
- Dashboard Analytics: Charts, stats, and insights with Recharts
- Subscription System: Free and Pro plans with Stripe integration
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Unlimited clients and projects
- Advanced task assignment
- Team collaboration
- Priority support
- Export reports
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- ShadCN UI components
- React Hook Form for forms
- Recharts for analytics
- Next.js API Routes
- Prisma ORM
- PostgreSQL database
- NextAuth for authentication
- Zod for validation
- Stripe for subscriptions
- Cloudinary for file uploads
taskflow-saas/
βββ app/ # Next.js 14 App Router
β βββ api/ # API routes
β βββ dashboard/ # Protected dashboard pages
β βββ login/ # Authentication pages
β βββ pricing/ # Pricing page
β βββ globals.css # Global styles
βββ components/ # Reusable components
β βββ ui/ # ShadCN UI components
βββ lib/ # Utilities and configurations
β βββ auth.ts # NextAuth config
β βββ db.ts # Prisma client
β βββ stripe.ts # Stripe config
β βββ utils.ts # Helper functions
βββ prisma/ # Database schema
β βββ schema.prisma # Prisma schema
βββ middleware.ts # Route protection
- Node.js 18+
- PostgreSQL database (Neon/Supabase recommended)
- Stripe account
- Cloudinary account (optional)
- Clone and install dependencies
cd SaaS-management
npm install- Set up environment variables
cp .env.example .envFill in your environment variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/taskflow"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"
# Stripe
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
STRIPE_PRICE_ID_PRO="price_..."
# Cloudinary (optional)
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"- Set up the database
npx prisma db push
npx prisma generate- Run the development server
npm run devVisit http://localhost:3000
- User: Authentication and subscription data
- Client: Client information and contact details
- Project: Project management with status tracking
- Task: Task management with priorities and due dates
- Users have many Clients, Projects, and Tasks
- Clients can have many Projects
- Projects can have many Tasks
- Full referential integrity with cascading deletes
- Free Plan: 3 clients, 5 projects, basic features
- Pro Plan: Unlimited everything, advanced features
checkout.session.completed: Activate subscriptioninvoice.payment_succeeded: Renew subscription
- Create products and prices in Stripe Dashboard
- Set up webhook endpoint:
/api/webhooks - Configure webhook events in Stripe
- Add price IDs to environment variables
- Connect to Vercel
npm i -g vercel
vercel-
Set environment variables in Vercel dashboard
-
Deploy
vercel --prod- Create account at Neon
- Create new project
- Copy connection string to
DATABASE_URL - Run
npx prisma db push
- Update webhook URL to production domain
- Update
NEXTAUTH_URLto production domain - Test payments in Stripe Dashboard
- Total clients, projects, tasks
- Tasks due today
- Pie charts for task status
- Bar charts for project status
- Recent activity timeline
- Add/edit/delete clients
- Contact information storage
- Project relationship tracking
- Client detail pages
- Create projects with status tracking
- Link projects to clients
- Budget and timeline management
- Task progress tracking
- Create tasks within projects
- Priority levels (Low, Medium, High, Urgent)
- Due date tracking
- Status management (Todo, In Progress, Completed)
- Free tier with limitations
- Pro tier with full features
- Stripe checkout integration
- Subscription status tracking
- Protected routes with middleware
- User session management
- Data isolation per user
- Secure API endpoints
- Input validation with Zod
- Mobile-first approach
- Tailwind CSS utilities
- ShadCN UI components
- Optimized for all screen sizes
- Fork the repository
- Create feature branch
- Make changes
- Test thoroughly
- Submit pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review the code examples
Built with β€οΈ using Next.js, TypeScript, and modern web technologies.