An open-source, AI-powered real-time team messaging platform.
- Organizations (Orgs) — Create organization.
- Teams — Organize conversations into topic-based teams within each organization.
- Threaded Messages — Reply to any message in a thread to keep conversations focused
- Image Uploads — Share images directly in teams via UploadThing
- AI Message Rewrite — Let AI rewrite your message: adjust tone, fix grammar, or improve clarity
- AI Thread Summarization — Summarize long threads to catch up instantly without reading every reply
- Email + OAuth Auth — Sign in with GitHub
- Email Verification — Nodemailer-powered email verification flow
- Rate Limiting — Arcjet-powered rate limiting and bot protection on all API routes
- Dark / Light Mode — Full theme support via next-themes
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| Database | PostgreSQL + Prisma ORM |
| Auth | better-auth (organizations plugin) |
| API | oRPC + TanStack Query |
| AI | Vercel AI SDK + OpenRouter |
| Rich Text | Tiptap editor |
| File Uploads | UploadThing |
| Rate Limiting | Arcjet |
| UI | shadcn/ui + Tailwind CSS v4 |
| Animations | Motion |
- Node.js 20+
- pnpm
- PostgreSQL database
git clone https://github.com/Ali1raz/team-comms.git
cd team-commspnpm installcp .env.example .envFill in your .env:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/team-comms?schema=public"
# Auth
BETTER_AUTH_SECRET=your_secret_here
NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000
# Email (Nodemailer)
NODEMAILER_USER=your_email@gmail.com
NODEMAILER_APP_PASSWORD=your_app_password
# GitHub OAuth (optional)
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
# Security
ARCJET_KEY=your_arcjet_key
ARCJET_ENV=development
# File Uploads
UPLOADTHING_TOKEN=your_uploadthing_token
UPLOADTHING_SECRET_KEY=your_uploadthing_secret_key
# AI (via OpenRouter)
OPENROUTER_API_KEY=your_openrouter_api_keypnpm db:migratepnpm devlogin to wrangler cli to your cloudflare account:
pnpm dlx wrangler logingenerate wrangler types:
pnpm wrangler:typesrun wrangler to serve the worker locally (because local dev server has to run in parallel):
pnpm wrangler:devOpen http://localhost:3000 for the app. Open http://localhost:8787 for wrangler dev server
| Command | Description |
|---|---|
pnpm db:migrate |
Run Prisma migrations |
pnpm db:push |
Push schema changes without migration |
pnpm db:generate |
Regenerate Prisma client |
pnpm db:sync |
Push + generate in one step |
pnpm db:studio |
Open Prisma Studio |
pnpm db:seed |
Seed the database |
├── app/ # Next.js App Router pages and API routes
├── components/ # React components (UI, chat, auth, etc.)
├── hooks/ # Custom React hooks
├── lib/ # Core utilities (auth, db, orpc, ai, arcjet)
├── prisma/ # Prisma schema and migrations
└── public/ # Static assets
TeamComms integrates OpenAI-compatible models via OpenRouter and the Vercel AI SDK:
- Message Rewrite — Rewrite message → click AI rewrite → Each rewrite is a streaming API call.
- Thread Summarization — Click "Summarize thread" on any message thread → receive a streamed summary of the conversation.
You can configure which model is used by setting your OPENROUTER_API_KEY and choosing a model in lib/ai.ts.
Contributions are welcome. Please open an issue first to discuss what you'd like to change.
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes
- Open a Pull Request