Skip to content

MdEstiakAhmed/collabcore-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CollabCore API

A production-grade REST API backend for team collaboration and task management, built with NestJS v11 and TypeScript.

CollabCore provides a complete, secure backend foundation for team-based productivity applications. It covers the full collaboration stack — authentication, teams, projects, tasks, comments, file attachments, real-time notifications, audit logging, and role-based access control — all production-hardened and ready to deploy.


Table of Contents


Tech Stack

Layer Technology
Framework NestJS v11 (TypeScript)
Database PostgreSQL + TypeORM
Caching & Sessions Redis
Background Jobs BullMQ
Real-Time Socket.io (WebSocket Gateway)
Auth JWT (access + refresh tokens), Google OAuth 2.0
API Docs Swagger / OpenAPI
Containerization Docker + Docker Compose
CI/CD GitHub Actions
Observability Prometheus metrics, structured JSON logging (nestjs-pino)

Module Overview

# Module Base Path Description
1 Auth /api/v1/auth JWT authentication, refresh tokens, Google OAuth, email verification, account lockout
2 Users /api/v1/users User profiles, status management, soft delete
3 Teams /api/v1/teams Team creation, member management, role assignment
4 Projects /api/v1/projects Project lifecycle, team-scoped access
5 Tasks /api/v1/tasks Task CRUD, status/priority tracking, assignment
6 Comments /api/v1/tasks/:taskId/comments Threaded discussions on tasks
7 Files /api/v1/files File uploads (task attachments + profile avatars)
8 Notifications /api/v1/notifications In-app notifications with real-time WebSocket push
9 Audit Logs /api/v1/audit-logs Immutable activity history for teams and projects
10 RBAC /api/v1/rbac Role and permission inspection, system role management
11 Health /api/v1/health Liveness and readiness probes (DB, Redis, disk, memory)
12 Mail (no HTTP endpoints) Async email delivery via BullMQ (verification, password reset)

Resource hierarchy:

Team
 ├── Members (Users with team roles: owner / admin / member)
 └── Projects
      └── Tasks
           ├── Comments
           └── File Attachments

Quick Start

Prerequisites

  • Node.js v20+
  • pnpm
  • Docker & Docker Compose

1. Clone & Install

git clone <repo-url>
cd collabcore-api
pnpm install

2. Configure Environment

cp .env.example .env
# Edit .env with your local values (DB credentials, JWT secrets, etc.)

3. Start Infrastructure

docker compose up -d
# Starts PostgreSQL (port 5432) and Redis (port 6379)

4. Run Migrations & Seed

pnpm run migration:run   # Apply database schema
pnpm run seed            # Create default admin + test users (dev only)

5. Start the Dev Server

pnpm run start:dev

The API is available at http://localhost:3000/api/v1. Interactive Swagger docs at http://localhost:3000/docs.

For the full setup guide including environment variable reference, see docs/getting-started/setup.md.


API Documentation

Resource URL
Swagger UI (interactive) http://localhost:3000/docs (dev only)
API Guide docs/api-reference/API_GUIDE.md
Authentication Reference docs/api-reference/AUTHENTICATION.md
Error Codes Reference docs/api-reference/ERROR_CODES.md
Changelog docs/CHANGELOG.md

All responses follow a standard envelope:

{
  "success": true,
  "data": { },
  "message": "Operation successful",
  "timestamp": "2026-05-04T10:00:00.000Z",
  "path": "/api/v1/teams"
}

Project Structure

src/
├── main.ts                   # App bootstrap, global middleware
├── app.module.ts             # Root module
├── config/                   # Environment config & validation
├── common/                   # Shared guards, decorators, interceptors, filters
│   ├── decorators/
│   ├── filters/
│   ├── guards/
│   ├── interceptors/
│   ├── events/               # Domain event definitions (EventEmitter2)
│   └── middleware/
├── database/                 # TypeORM data source & migrations
└── modules/                  # Feature modules (one folder per domain)
    ├── auth/
    ├── users/
    ├── teams/
    ├── projects/
    ├── tasks/
    ├── comments/
    ├── files/
    ├── notifications/
    ├── audit-logs/
    ├── rbac/
    ├── health/
    └── mail/

Each feature module follows the same internal layout:

<feature>/
├── controllers/    # HTTP routing (thin)
├── services/       # Business logic
├── repositories/   # TypeORM queries
├── entities/       # Database entities
├── dtos/           # Validation & response shapes
└── <feature>.module.ts

Development Commands

# Development
pnpm run start:dev        # Watch mode
pnpm run start:debug      # Debug mode

# Build
pnpm run build
pnpm run start:prod       # Production mode

# Testing
pnpm run test             # Unit tests
pnpm run test:watch       # Watch mode
pnpm run test:cov         # Coverage report
pnpm run test:e2e         # End-to-end tests

# Database
pnpm run migration:run    # Apply pending migrations
pnpm run migration:revert # Revert last migration
pnpm run seed             # Seed dev data

# Quality
pnpm run lint
pnpm run format

Deployment

The project is fully containerized with a multi-stage Dockerfile optimized for production.

# Build production image
docker build -t collabcore-api:prod .

# Run with environment file
docker run -p 3000:3000 --env-file .env.production collabcore-api:prod

A StartupChecksService validates database connectivity, Redis availability, environment variable completeness, and pending migrations before the server begins accepting requests.

See docs/api-reference/API_GUIDE.md for full deployment checklists for AWS (ECS + RDS + ElastiCache) and DigitalOcean (App Platform).


Documentation Index

Document Description
docs/README.md Full documentation index
docs/getting-started/setup.md Local setup walkthrough
docs/architecture/system-overview.md Architecture, patterns, and design decisions
docs/architecture/module-map.md Module dependency and event graph
Module References
docs/modules/auth.md Auth module
docs/modules/users.md Users module
docs/modules/teams.md Teams module
docs/modules/projects.md Projects module
docs/modules/tasks.md Tasks module
docs/modules/comments.md Comments module
docs/modules/files.md Files module
docs/modules/notifications.md Notifications module
docs/modules/audit-logs.md Audit Logs module
docs/modules/rbac.md RBAC module
docs/modules/health.md Health module
docs/modules/mail.md Mail module

Built as a production-grade NestJS learning project. See CLAUDE.md for architectural guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages