Skip to content

dikshajha25/TaskFlow

Repository files navigation

TaskFlow - Project & Client Management SaaS

A complete web-based SaaS application for managing clients, projects, and tasks with dashboards, analytics, and subscription billing.

πŸš€ Features

Core Features

  • 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

Pro Features (Subscription Required)

  • Unlimited clients and projects
  • Advanced task assignment
  • Team collaboration
  • Priority support
  • Export reports

πŸ›  Tech Stack

Frontend

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • ShadCN UI components
  • React Hook Form for forms
  • Recharts for analytics

Backend

  • Next.js API Routes
  • Prisma ORM
  • PostgreSQL database
  • NextAuth for authentication
  • Zod for validation

Payments & Storage

  • Stripe for subscriptions
  • Cloudinary for file uploads

πŸ“ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database (Neon/Supabase recommended)
  • Stripe account
  • Cloudinary account (optional)

Installation

  1. Clone and install dependencies
cd SaaS-management
npm install
  1. Set up environment variables
cp .env.example .env

Fill 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"
  1. Set up the database
npx prisma db push
npx prisma generate
  1. Run the development server
npm run dev

Visit http://localhost:3000

πŸ—„ Database Schema

Core Models

  • 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

Relationships

  • Users have many Clients, Projects, and Tasks
  • Clients can have many Projects
  • Projects can have many Tasks
  • Full referential integrity with cascading deletes

πŸ’³ Stripe Integration

Subscription Plans

  • Free Plan: 3 clients, 5 projects, basic features
  • Pro Plan: Unlimited everything, advanced features

Webhook Events

  • checkout.session.completed: Activate subscription
  • invoice.payment_succeeded: Renew subscription

Setup Steps

  1. Create products and prices in Stripe Dashboard
  2. Set up webhook endpoint: /api/webhooks
  3. Configure webhook events in Stripe
  4. Add price IDs to environment variables

πŸš€ Deployment

Vercel Deployment

  1. Connect to Vercel
npm i -g vercel
vercel
  1. Set environment variables in Vercel dashboard

  2. Deploy

vercel --prod

Database Setup (Neon)

  1. Create account at Neon
  2. Create new project
  3. Copy connection string to DATABASE_URL
  4. Run npx prisma db push

Stripe Configuration

  1. Update webhook URL to production domain
  2. Update NEXTAUTH_URL to production domain
  3. Test payments in Stripe Dashboard

πŸ“Š Features Overview

Dashboard

  • Total clients, projects, tasks
  • Tasks due today
  • Pie charts for task status
  • Bar charts for project status
  • Recent activity timeline

Client Management

  • Add/edit/delete clients
  • Contact information storage
  • Project relationship tracking
  • Client detail pages

Project Management

  • Create projects with status tracking
  • Link projects to clients
  • Budget and timeline management
  • Task progress tracking

Task Management

  • Create tasks within projects
  • Priority levels (Low, Medium, High, Urgent)
  • Due date tracking
  • Status management (Todo, In Progress, Completed)

Subscription System

  • Free tier with limitations
  • Pro tier with full features
  • Stripe checkout integration
  • Subscription status tracking

πŸ”’ Security Features

  • Protected routes with middleware
  • User session management
  • Data isolation per user
  • Secure API endpoints
  • Input validation with Zod

πŸ“± Responsive Design

  • Mobile-first approach
  • Tailwind CSS utilities
  • ShadCN UI components
  • Optimized for all screen sizes

🀝 Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make changes
  4. Test thoroughly
  5. Submit pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors