Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=replace-with-publishable-key
NEXT_PUBLIC_SITE_URL=http://localhost:3000
LOG_LEVEL=debug
43 changes: 43 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Code ownership for the Flack codebase.
# Each line maps a path pattern to one or more owners who are
# automatically requested for review on matching pull requests.
# Syntax: https://docs.github.com/articles/about-code-owners
# Later matching rules take precedence over earlier ones.

# Default owner for everything not matched below.
* @factory-sam

# Application code (Next.js App Router + React UI).
/src/ @factory-sam
/src/app/ @factory-sam
/src/components/ @factory-sam
/src/features/ @factory-sam

# Auth, session, and Supabase access layer (security-sensitive).
/src/proxy.ts @factory-sam
/src/app/auth/ @factory-sam
/src/features/auth/ @factory-sam
/src/lib/supabase/ @factory-sam

# Observability surface (logger, health checks).
/src/lib/logger.ts @factory-sam
/src/lib/health.ts @factory-sam
/src/app/health/ @factory-sam

# Database schema, RLS policies, and migrations (high blast radius).
/supabase/ @factory-sam

# CI/CD, repo automation, and tooling configuration.
/.github/ @factory-sam
/scripts/ @factory-sam
/eslint.config.mjs @factory-sam
/vitest.config.ts @factory-sam
/playwright.config.ts @factory-sam
/next.config.ts @factory-sam
/knip.json @factory-sam
/.jscpd.json @factory-sam

# Project documentation and agent guidance.
/README.md @factory-sam
/AGENTS.md @factory-sam
/.factory/ @factory-sam
78 changes: 78 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Bug report
description: Report something in Flack that is broken or behaving unexpectedly.
title: "[Bug]: "
labels: ["type: bug", "priority: p2-medium"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to file a bug. Please fill out the sections below so the issue is reproducible and actionable for both humans and AI agents.
- type: textarea
id: summary
attributes:
label: Summary
description: A clear and concise description of the bug.
placeholder: Messages sent while offline are duplicated when the connection is restored.
validations:
required: true
- type: dropdown
id: area
attributes:
label: Affected area
description: Which part of the codebase is impacted?
options:
- auth (login/signup/invite/session)
- chat (workspace, channels)
- messages (send/edit/optimistic updates)
- realtime (Supabase subscriptions)
- supabase (schema, RLS, migrations)
- observability (logging, health)
- build/tooling/CI
- other
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to reproduce
description: Numbered steps that reliably reproduce the issue.
value: |
1.
2.
3.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
description: What actually happened? Include error messages, screenshots, or `/health` output if relevant.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
description: Browser, OS, deployment (local/Vercel preview/production), and relevant commit SHA.
value: |
- Environment: (local / preview / production)
- Browser/OS:
- Commit SHA:
validations:
required: false
- type: checkboxes
id: checks
attributes:
label: Pre-submission checklist
options:
- label: I searched existing issues and this is not a duplicate.
required: true
- label: I can reproduce this on the latest `main`.
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Setup and contribution questions
url: https://github.com/factory-sam/flack/blob/main/AGENTS.md
about: Read AGENTS.md for commands, conventions, architecture, and the local Supabase workflow before opening an issue.
- name: Security report
url: https://github.com/factory-sam/flack/security/advisories/new
about: Please report suspected security vulnerabilities privately rather than via a public issue.
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Feature request
description: Propose a new capability or enhancement for Flack.
title: "[Feature]: "
labels: ["type: feature", "priority: p3-low"]
body:
- type: markdown
attributes:
value: |
Describe the problem you want solved and your proposed solution. Clear, scoped requests are easier for both maintainers and AI agents to implement.
- type: textarea
id: problem
attributes:
label: Problem statement
description: What user or developer problem does this solve? Why now?
placeholder: Users cannot tell which messages failed to send after a network drop.
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
description: Describe the behavior you would like. Include UI/UX or API notes where relevant.
validations:
required: true
- type: dropdown
id: area
attributes:
label: Affected area
description: Which part of the codebase would this touch?
options:
- auth (login/signup/invite/session)
- chat (workspace, channels)
- messages (send/edit/optimistic updates)
- realtime (Supabase subscriptions)
- supabase (schema, RLS, migrations)
- observability (logging, health)
- build/tooling/CI
- other
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Other approaches you evaluated and why you discarded them.
validations:
required: false
- type: textarea
id: acceptance
attributes:
label: Acceptance criteria
description: Concrete, testable conditions that define "done".
value: |
- [ ]
- [ ]
validations:
required: false
- type: checkboxes
id: checks
attributes:
label: Pre-submission checklist
options:
- label: I searched existing issues and this is not a duplicate.
required: true
4 changes: 4 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
## Design Context

### Users

Flack is for one organization with power users who live in chat all day: founders, operators, engineers, sales, support, and leadership. They need channel conversation, direct messages, threads, mentions, file sharing, search, and keyboard-driven workflows that feel immediate under production pressure.

### Brand Personality

Technical, minimal, fast, and precise. The interface should feel like a professional work surface, not a branded destination: quiet, exacting, trustworthy, and optimized for repeated use.

### Aesthetic Direction

Dark-mode-first with a Linear-adjacent power-user feel, blended with a dense terminal workspace, an issue tracker, and a restrained enterprise command center. Use flat tinted near-black planes, 4-6px radii, hairline borders, compact rows, small typography, and minimal color. Avoid decorative gradients, radial glow, glass blur, pill overload, bubbly cards, cute empty-state copy, oversized avatars, and anything that reads as an AI dashboard or playful Slack clone.

### Design Principles

- Optimize for speed perception: optimistic updates, immediate feedback, and no decorative motion.
- Keep density high but legible with tight grouping, stable alignment, and clear hierarchy.
- Make keyboard use first-class with command search, shortcuts, visible focus states, and AA contrast.
Expand Down
54 changes: 54 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!--
Thanks for contributing to Flack. Fill out each section so reviewers (human and AI) have the
context they need. PRs missing testing or context details may be sent back for more information.
-->

## Description

<!-- What does this PR change and why? Summarize the user-facing or developer-facing impact. -->

## Related issue

<!-- Link the issue this PR addresses, e.g. "Closes #123". Use "N/A" if none. -->

Closes #

## Type of change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] Feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that changes existing behavior)
- [ ] Refactor / tech debt (no functional change)
- [ ] Docs / tooling / CI

## Affected area

- [ ] auth (login/signup/invite/session)
- [ ] chat (workspace, channels)
- [ ] messages (send/edit/optimistic updates)
- [ ] realtime (Supabase subscriptions)
- [ ] supabase (schema, RLS, migrations)
- [ ] observability (logging, health)
- [ ] build / tooling / CI

## Testing done

<!-- Describe how you verified the change. Include commands run and their results. -->

- [ ] `pnpm lint`
- [ ] `pnpm typecheck`
- [ ] `pnpm test`
- [ ] `pnpm test:e2e` (if UI/routing changed)
- [ ] Manual verification (describe below)

<!-- Manual testing notes, screenshots, or `/health` output: -->

## Database / migrations

<!-- If this PR touches supabase/migrations or RLS policies, describe the change and how to apply it. Use "N/A" otherwise. -->

## Checklist

- [ ] My changes follow the conventions in `AGENTS.md`.
- [ ] I updated documentation (README/AGENTS.md) where relevant.
- [ ] No secrets, keys, or `.env` values are included in this PR.
61 changes: 61 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Code Quality

on:
push:
branches: [main]
pull_request:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 11.5.0

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint (includes complexity, max-lines, naming)
run: pnpm lint

- name: Type check
run: pnpm typecheck

- name: Unit tests (coverage thresholds + JUnit timing report)
run: pnpm test:ci

- name: Upload test report (timing + flaky detection)
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: test-report
path: reports/junit.xml
if-no-files-found: warn

- name: Upload coverage report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/
if-no-files-found: warn

- name: Dead code and unused dependencies (knip)
run: pnpm knip

- name: Duplicate code (jscpd)
run: pnpm duplication

- name: Technical debt markers
run: pnpm tech-debt

- name: Validate docs (AGENTS.md/README commands + links)
run: pnpm validate-docs
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ node_modules/
.env.local
.env.*.local
coverage/
reports/
.DS_Store
*.tsbuildinfo
/test-results/
/playwright-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm precommit
4 changes: 4 additions & 0 deletions .impeccable.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
## Design Context

### Users

Flack is for one organization with power users who live in chat all day: founders, operators, engineers, sales, support, and leadership. They need channel conversation, direct messages, threads, mentions, file sharing, search, and keyboard-driven workflows that feel immediate under production pressure.

### Brand Personality

Technical, minimal, fast, and precise. The interface should feel like a professional work surface, not a branded destination: quiet, exacting, trustworthy, and optimized for repeated use.

### Aesthetic Direction

Dark-mode-first with a Linear-adjacent power-user feel, blended with a dense terminal workspace, an issue tracker, and a restrained enterprise command center. Use flat tinted near-black planes, 4-6px radii, hairline borders, compact rows, small typography, and minimal color. Avoid decorative gradients, radial glow, glass blur, pill overload, bubbly cards, cute empty-state copy, oversized avatars, and anything that reads as an AI dashboard or playful Slack clone.

### Design Principles

- Optimize for speed perception: optimistic updates, immediate feedback, and no decorative motion.
- Keep density high but legible with tight grouping, stable alignment, and clear hierarchy.
- Make keyboard use first-class with command search, shortcuts, visible focus states, and AA contrast.
Expand Down
10 changes: 10 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"threshold": 3,
"minLines": 8,
"minTokens": 60,
"reporters": ["console"],
"absolute": true,
"gitignore": true,
"path": ["src"],
"ignore": ["**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.next/
node_modules/
coverage/
pnpm-lock.yaml
tsconfig.tsbuildinfo
screenshots/
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"semi": true,
"singleQuote": false,
"trailingComma": "none"
}
Loading
Loading