A Kanban full-stack application built with modern technologies, featuring JWT authentication, fine-grained authorization, real-time GraphQL subscriptions, and AI integration.
- Backend: TypeScript, Bun runtime, Express + Apollo GraphQL Server
- Frontend: Next.js (app router) React 19 + Zustand for client state
- DB: PostgreSQL (Docker Compose) with migrations (drizzle / graphile-migrate)
- PubSub: Redis (Docker Compose) for real-time subscriptions
- Auth: JWT access + refresh tokens, cookie-based refresh where applicable
| Landing Page | Dashboard |
|---|---|
![]() |
![]() |
| Project View | Task Dialog |
|---|---|
![]() |
![]() |
- Clone the repo and install dependencies
git clone https://github.com/your-org/kanban.git
cd kanban
bun install- Start PostgreSQL and Redis (Docker Compose)
docker compose up -d
# Optional: show logs
docker compose logs -f postgres redis- Initialize the database (migrations)
Use graphile-migrate (project includes script aliases) or drizzle-kit where appropriate.
# Run migration tooling (graphile-migrate)
# npm/yarn: npm run gm migrate
bun run gm migrate
# Or use drizzle (if using drizzle migrations)
bun run drizzle:pull- Start backend and frontend in separate terminals
# Backend (from repo root)
bun run dev
# Frontend (inside client folder)
cd client && npm run devBy default the frontend runs on http://localhost:3000 and backend on http://localhost:4000 (GraphQL at /graphql). Adjust ports via .env if needed.
Create a .env file from .env.example and set the values below. Example keys used by the app:
# Server
PORT=4000
NODE_ENV=development
# Database
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/kanban_db
# Redis
REDIS_URL=redis://localhost:6379
# JWT
JWT_ACCESS_SECRET=your-access-secret
JWT_REFRESH_SECRET=your-refresh-secret
# AI
GEMINI_API_KEY=your-gemini-api-key
# Optional
LOG_LEVEL=info
Note: API_BASE_URL is configured in client/src/lib/gql.ts and defaults to http://localhost:4000.
- graphile-migrate: commands are exposed in the root
package.jsonasgmscripts (e.g.,bun run gm migrate,bun run gm commit). - drizzle-kit: use
bun run drizzle:pullor relateddrizzlescripts inpackage.jsonwhen applicable.
Run backend tests from repo root (uses Jest):
bun run testFrontend tests (if present) live in client/ and can be run with the client's test script.
# Backend lint
bun run lint
# Frontend lint
cd client && npm run lintDevelopment uses docker compose for PostgreSQL. To run full development stack:
docker compose up --buildTo stop and clean volumes (use with caution):
docker compose down -vbun run devβ start backend in dev modecd client && npm run devβ start Next.js frontendbun run gm migrateβ apply migrationsbun run testβ run backend testsbun run buildβ build backend
src/graphqlcontains GraphQL schemas and resolvers. Resolvers delegate tosrc/servicesandsrc/models.src/models/drizzlecontains typed DB access using Drizzle ORM;src/models/rawcontains light wrappers for ad-hoc SQL.client/src/storeuses domain-focused Zustand stores (auth, workspace, notifications, ui, etc.) and a small compatibility wrapperuseAppStorefor incremental migration.- API helper
client/src/lib/gql.tscentralizes the GraphQL endpoint and helpergraphqlRequest()used across services.
- Fork and create a feature branch
- Add tests for new behavior
- Run migrations and seed data locally when needed
- Follow lint rules and run
bun run lint
- Database connection issues: ensure Docker container is running and
DATABASE_URLmatches container port. - GraphQL schema errors: restart the server after updating schema files and run migrations if DB schema changed.
- Auth/Logout issues: client uses
/auth/logout(REST) for cookie-based logout; ensure cookies are passed when testing.
If you want, I can also add a small CONTRIBUTING.md and a DEVELOPMENT.md with exact commands for common dev tasks.
- JWT Authentication: Secure login/logout with refresh tokens and device tracking
- Complex Authorization: Multi-level permission system (Workspace β Project β Task)
- Real-time Updates: GraphQL subscriptions for live task status changes
- Task Management: Complete CRUD operations with automatic notifications
- AI Integration: Gemini API for task summarization and generation
- PostgreSQL Database: Robust data modeling with Docker deployment
- Runtime: Bun (both runtime and package manager)
- Framework: Express.js with TypeScript
- API: GraphQL (Apollo Server) with REST endpoints for auth
- Database: PostgreSQL with raw SQL queries
- Authentication: JWT with separate access/refresh tokens
- Real-time: GraphQL Subscriptions with PubSub
- Security: Helmet, CORS, rate limiting, input validation
- Logging: Winston dual-logging (File + Database)
Workspace (OWNER/MEMBER/VIEWER)
βββ Project (PROJECT_LEAD/CONTRIBUTOR/PROJECT_VIEWER)
βββ Task (Assigned users with notifications)
- REST Endpoints: Authentication (
/auth/login,/auth/logout,/auth/refresh) - GraphQL: All business logic (workspaces, projects, tasks, notifications, AI features)
- Subscriptions: Real-time task status updates
- Bun:
curl -fsSL https://bun.sh/install | bash - Docker & Docker Compose: For PostgreSQL database
- Node.js 20+: For compatibility
git clone <https://github.com/your-org/kanban.git>
cd kanban
bun installcp .env.example .env
# Edit .env with your configuration# Start PostgreSQL with Docker
docker compose up --build -d
# Initialize database schema
bun run db:migrate# Backend (Terminal 1)
bun run dev
# Frontend (Terminal 2)
cd client && npm run dev- Frontend: http://localhost:3000
- GraphQL Playground: http://localhost:4000/graphql
- Health Check: http://localhost:4000/health
# Database
DATABASE_URL=postgresql://postgres:postgres@localhost:5433/collaboration_db
# JWT
JWT_ACCESS_SECRET=your-access-secret-key
JWT_REFRESH_SECRET=your-refresh-secret-key
JWT_ACCESS_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
# Server
PORT=4000
NODE_ENV=development
# AI (Optional)
GEMINI_API_KEY=your-gemini-api-key
# Logging
LOG_LEVEL=info
LOG_FILE=logs/audit.log# Login
POST /auth/login
{
"email": "user@example.com",
"password": "password"
}
# Logout
POST /auth/logout
# Refresh Token
POST /auth/refresh
# Update Password
POST /auth/update-password
{
"currentPassword": "oldpass",
"newPassword": "newpass"
}mutation {
createWorkspace(name: "My Workspace") {
id
name
ownerId
}
}mutation {
createTask(
projectId: "project-uuid"
title: "Implement feature"
description: "Detailed description"
assignedToIds: ["user-uuid"]
) {
id
title
status
assignedUsers {
id
email
}
}
}subscription {
taskStatusUpdated(workspaceId: "workspace-uuid") {
id
title
status
updatedAt
}
}query {
summarizeTask(description: "Long task description here...")
}# Run all tests
bun run test
# Run with coverage
bun run test:coverage
# Run specific test file
bun run test auth.test.tsdocker compose up --builddocker build -t collaboration-platform .
docker run -p 4000:4000 collaboration-platform- JWT Authentication: Stateless authentication with refresh tokens
- Device Tracking: IP address and user agent logging
- Rate Limiting: Protection against brute force attacks
- Input Validation: Joi schemas for all inputs
- Security Headers: Helmet.js configuration
- Audit Logging: Comprehensive security and activity logs
- CORS: Configured cross-origin policies
users: User accounts with global status (ACTIVE/BANNED/ADMIN)workspaces: Collaborative spaces with ownershipworkspace_members: Membership with roles (OWNER/MEMBER/VIEWER)projects: Work containers within workspacesproject_memberships: Project-specific roles (PROJECT_LEAD/CONTRIBUTOR/PROJECT_VIEWER)tasks: Work items with assignment and status trackingnotifications: User notifications with delivery statususer_devices: Session management and device trackingaudit_logs: Security and activity logging
- Task Summarization: Generate concise summaries from detailed descriptions
- Task Generation: Create structured task lists from high-level prompts
- Intelligent Assistance: Powered by Google Gemini API
# Summarize a task
query {
summarizeTask(description: "Implement user authentication with JWT tokens, including password hashing, refresh tokens, and device tracking...")
}
# Generate tasks from prompt
mutation {
generateTasksFromPrompt(
projectId: "project-uuid"
prompt: "Build a user registration system"
)
}- Security Logs: Authentication failures, admin actions, bans
- Activity Logs: Task lifecycle, project/workspace management
- System Logs: Errors, critical events
- User Logs: Session management, device tracking
- File:
logs/audit.logwith Winston formatting - Database:
audit_logstable for compliance and querying
export NODE_ENV=production
export DATABASE_URL=postgresql://prod-user:prod-pass@prod-host:5432/prod-db
export JWT_ACCESS_SECRET=strong-production-secret
export GEMINI_API_KEY=your-production-api-keybun run build
bun run startβββ src/
β βββ config/ # Database configuration
β βββ graphql/
β β βββ schemas/ # GraphQL type definitions
β β βββ resolvers/ # GraphQL resolvers
β βββ middleware/ # Express middleware
β βββ models/ # Database models
β βββ routes/ # REST API routes
β βββ services/ # External services (AI)
β βββ types/ # TypeScript definitions
β βββ utils/ # Utilities (auth, logger)
βββ client/ # Next.js frontend
βββ database-schema.sql # PostgreSQL schema
βββ docker-compose.yml # Docker configuration
βββ jest.config.js # Test configuration
bun run dev # Start development server
bun run build # Build for production
bun run start # Start production server
bun run test # Run test suite
bun run lint # Run ESLint
bun run db:migrate # Initialize database- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Database Connection Failed
# Ensure Docker containers are running
docker compose ps
# Check database logs
docker compose logs postgresGraphQL Schema Errors
# Validate schema
bun run dev # Check console for schema validation errorsTest Failures
# Clean test database
docker compose down -v
docker compose up --build -d
bun run testAI Features Not Working
# Verify GEMINI_API_KEY in .env
echo $GEMINI_API_KEYFor questions or issues:
- Check the troubleshooting section above
- Review the API documentation
- Create an issue with detailed information
- Include environment details and error logs
Built with β€οΈ using Bun, TypeScript, GraphQL, and PostgreSQL



