Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cerebralatlas/Zenban

Repository files navigation

Zenban - Enterprise Kanban Management System

A modern, full-stack Kanban project management system built with NestJS + Next.js 15, featuring enterprise-grade multi-tenant architecture, fine-grained permission control, and complete task management workflows.

License: MIT TypeScript NestJS Next.js pnpm Prisma PostgreSQL TailwindCSS shadcn/ui

🌟 Key Features

🏒 Enterprise Architecture

  • Multi-tenant SaaS Architecture: Support for multiple teams with complete data isolation
  • Four-tier Permission System: System β†’ Workspace β†’ Board β†’ Resource inheritance with RBAC
  • Workspace-based Collaboration: Team management with role-based access control
  • Enterprise-grade Security: JWT authentication, input sanitization, rate limiting

πŸ“‹ Complete Kanban Workflow

  • Hierarchical Organization: Workspaces β†’ Boards β†’ Lists β†’ Cards
  • Drag & Drop Interface: Smooth card and list reordering with @dnd-kit
  • Task Management: Card assignment, due dates, descriptions, and activity tracking
  • Real-time Updates: Optimistic UI updates with proper state management

πŸ”§ Technical Excellence

  • Monorepo Architecture: pnpm workspace for unified code management
  • Full-stack Type Safety: Shared TypeScript types between frontend and backend
  • Modern Frontend: Next.js 15 with App Router, React Server Components
  • Enterprise Backend: NestJS with Fastify, Prisma ORM, PostgreSQL
  • Containerized Deployment: Docker support with health checks and orchestration

πŸ—οΈ Project Architecture

zenban/
β”œβ”€β”€ apps/                          # Applications
β”‚   β”œβ”€β”€ api/                       # Backend API (NestJS)
β”‚   β”‚   β”œβ”€β”€ src/                   # Backend source code
β”‚   β”‚   β”œβ”€β”€ prisma/                # Database schema and migrations
β”‚   β”‚   β”œβ”€β”€ generated/             # Generated Prisma client
β”‚   β”‚   └── package.json           # Backend dependencies
β”‚   └── web/                       # Frontend (Next.js 15)
β”‚       β”œβ”€β”€ app/                   # Next.js App Router
β”‚       β”œβ”€β”€ components/            # React components
β”‚       β”œβ”€β”€ lib/                   # Utilities and API clients
β”‚       └── package.json           # Frontend dependencies
β”œβ”€β”€ packages/                      # Shared packages
β”‚   └── shared-types/              # Shared TypeScript definitions
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ user.ts            # User types
β”‚       β”‚   β”œβ”€β”€ workspace.ts       # Workspace types
β”‚       β”‚   β”œβ”€β”€ board.ts           # Board types
β”‚       β”‚   β”œβ”€β”€ auth.ts            # Authentication types
β”‚       β”‚   └── index.ts           # Unified exports
β”‚       └── package.json
β”œβ”€β”€ docker-compose.yml            # Production Docker setup
β”œβ”€β”€ docker-compose.dev.yml        # Development Docker setup
β”œβ”€β”€ pnpm-workspace.yaml           # pnpm workspace configuration
└── package.json                  # Root package management

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • pnpm >= 8.0.0 (recommended package manager)
  • Docker & Docker Compose (for containerized deployment)
  • PostgreSQL 14+ (or use Docker)

Installation

# Clone the repository
git clone https://github.com/your-username/zenban.git
cd zenban

# Install dependencies
pnpm install

# Set up environment variables
cp env.example .env
# Edit .env file with your configuration

Development Mode

# Start all services (frontend + backend)
pnpm dev

# Or start individually
pnpm dev:api    # Backend only: http://localhost:8080
pnpm dev:web    # Frontend only: http://localhost:3000

# With Docker database
pnpm dev:full   # PostgreSQL + development servers

Building

# Build all projects
pnpm build

# Build individually
pnpm build:api
pnpm build:web

πŸ› οΈ Technology Stack

Backend (apps/api)

  • Framework: NestJS 11 with Fastify adapter
  • Database: PostgreSQL 16 with Prisma ORM
  • Authentication: JWT with Passport.js strategy
  • Security: Rate limiting, input sanitization, CORS
  • Documentation: Swagger/OpenAPI 3.0
  • Validation: class-validator with class-transformer
  • Caching: Redis integration ready

Frontend (apps/web)

  • Framework: Next.js 15 with App Router
  • Language: TypeScript 5 with strict mode
  • UI Components: shadcn/ui with Radix UI primitives
  • Styling: TailwindCSS v4 with CSS variables
  • Forms: React Hook Form with Zod validation
  • Drag & Drop: @dnd-kit for kanban functionality
  • State Management: Server Components + Client Components
  • Build Tool: Turbopack for development

Shared Package (packages/shared-types)

  • @zenban/shared-types: TypeScript type definitions
  • Build System: TypeScript compiler
  • Exports: User, Auth, Workspace, Board types and DTOs

πŸ“¦ Monorepo Architecture

This project uses pnpm workspaces for efficient monorepo management:

Key Benefits

  • Unified Dependency Management: Single lockfile for all packages
  • Type Safety: Shared TypeScript definitions across frontend and backend
  • Workspace Linking: Local packages use workspace:* protocol
  • Build Orchestration: Coordinated builds with dependency resolution
  • Code Reusability: Shared utilities, types, and validation logic

Package Structure

// Workspace dependencies
"@zenban/shared-types": "workspace:*"

πŸ” Security Features

Authentication & Authorization

  • JWT-based Authentication: Access tokens with configurable expiration
  • Refresh Token Support: Secure token rotation mechanism
  • Password Security: bcrypt hashing with salt rounds
  • Role-based Access Control: Four-tier permission inheritance

Data Protection

  • Input Sanitization: XSS prevention and SQL injection protection
  • Rate Limiting: API endpoint protection against abuse
  • CORS Configuration: Cross-origin request security
  • Security Headers: Comprehensive HTTP security headers

Permission System

System Level β†’ Workspace Level β†’ Board Level β†’ Resource Level
     ↓              ↓               ↓              ↓
   OWNER          OWNER          ADMIN        FULL_ACCESS
   MEMBER         MEMBER         MEMBER       READ_WRITE
   VIEWER         VIEWER         VIEWER       READ_ONLY

🐳 Docker Deployment

Production Deployment

# 1. Configure environment
cp env.example .env
# Edit .env with production settings

# 2. One-click deployment
pnpm deploy

Development with Docker

# Start development environment (database + hot reload)
pnpm dev:full

# Or manually
pnpm docker:dev    # Start PostgreSQL database
pnpm dev          # Start development servers

Docker Commands

pnpm docker:build     # Build all images
pnpm docker:up        # Start all services
pnpm docker:down      # Stop all services
pnpm docker:logs      # View service logs

πŸ“Š Database Schema

Core Entities

  • User: Authentication and profile information
  • Workspace: Multi-tenant organization units
  • Board: Kanban boards within workspaces
  • List: Columns within boards (with ordering)
  • Card: Tasks within lists (with ordering and assignees)
  • Member: Workspace and board membership with roles

Relationships

User β†’ WorkspaceMember β†’ Workspace β†’ Board β†’ BoardMember β†’ List β†’ Card

πŸ”§ Development Guidelines

Adding New Shared Types

  1. Create type definitions in packages/shared-types/src/
  2. Export from packages/shared-types/src/index.ts
  3. Build the package: pnpm --filter @zenban/shared-types build
  4. Import and use in both frontend and backend

API Development Patterns

  • RESTful Design: Consistent resource-based URLs
  • DTO Validation: Input validation with class-validator
  • Error Handling: Standardized error response format
  • Pagination: Use page and limit query parameters
  • Sorting: Use sortBy and sortOrder parameters

Frontend Development Patterns

  • Component Architecture: Reusable shadcn/ui components
  • Form Handling: React Hook Form with Zod schemas
  • API Integration: Centralized client with error handling
  • State Management: Server Components for data fetching
  • UI Consistency: Design system with TailwindCSS

πŸ§ͺ Testing

Backend Testing

# Unit tests
pnpm test:api

# Test coverage
pnpm test:cov

# End-to-end tests
pnpm test:e2e

Frontend Testing

# Component tests (when implemented)
pnpm test:web

πŸš€ Performance Optimizations

Backend Optimizations

  • Database Indexing: Optimized queries with Prisma
  • Connection Pooling: PostgreSQL connection management
  • Caching Strategy: Redis integration for frequently accessed data
  • Query Optimization: N+1 query prevention with Prisma

Frontend Optimizations

  • Server Components: Reduced client-side JavaScript
  • Image Optimization: Next.js Image component
  • Code Splitting: Automatic route-based splitting
  • Bundle Analysis: Build optimization with Turbopack

πŸ“š API Documentation

Interactive API documentation available at:

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • NestJS for the amazing backend framework
  • Next.js for the powerful React framework
  • shadcn/ui for the beautiful UI components
  • Prisma for the excellent database toolkit
  • pnpm for the efficient package manager

πŸ“ž Support

For support and questions:

  • Create an issue in the GitHub repository
  • Check the documentation links provided above
  • Review the existing code and configuration files

Built with ❀️ using modern web technologies

About

A modern, full-stack Kanban project management system built with NestJS + Next.js 15

Topics

Resources

License

Stars

Watchers

Forks

Languages