Skip to content

Commit d64e6ce

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fixOrganizationLogic
2 parents df0216b + 597ee87 commit d64e6ce

File tree

821 files changed

+36822
-37080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

821 files changed

+36822
-37080
lines changed

.cursor/rules/guidelines.mdc

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
Concise rules for building accessible, fast, delightful UIs Use MUST/SHOULD/NEVER to guide decisions
7+
8+
## Interactions
9+
10+
- Keyboard
11+
- MUST: Full keyboard support per [WAI-ARIA APG](https://wwww3org/WAI/ARIA/apg/patterns/)
12+
- MUST: Visible focus rings (`:focus-visible`; group with `:focus-within`)
13+
- MUST: Manage focus (trap, move, and return) per APG patterns
14+
- Targets & input
15+
- MUST: Hit target ≥24px (mobile ≥44px) If visual <24px, expand hit area
16+
- MUST: Mobile `<input>` font-size ≥16px or set:
17+
```html
18+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover">
19+
```
20+
- NEVER: Disable browser zoom
21+
- MUST: `touch-action: manipulation` to prevent double-tap zoom; set `-webkit-tap-highlight-color` to match design
22+
- Inputs & forms (behavior)
23+
- MUST: Hydration-safe inputs (no lost focus/value)
24+
- NEVER: Block paste in `<input>/<textarea>`
25+
- MUST: Loading buttons show spinner and keep original label
26+
- MUST: Enter submits focused text input In `<textarea>`, ⌘/Ctrl+Enter submits; Enter adds newline
27+
- MUST: Keep submit enabled until request starts; then disable, show spinner, use idempotency key
28+
- MUST: Don’t block typing; accept free text and validate after
29+
- MUST: Allow submitting incomplete forms to surface validation
30+
- MUST: Errors inline next to fields; on submit, focus first error
31+
- MUST: `autocomplete` + meaningful `name`; correct `type` and `inputmode`
32+
- SHOULD: Disable spellcheck for emails/codes/usernames
33+
- SHOULD: Placeholders end with ellipsis and show example pattern (eg, `+1 (123) 456-7890`, `sk-012345…`)
34+
- MUST: Warn on unsaved changes before navigation
35+
- MUST: Compatible with password managers & 2FA; allow pasting one-time codes
36+
- MUST: Trim values to handle text expansion trailing spaces
37+
- MUST: No dead zones on checkboxes/radios; label+control share one generous hit target
38+
- State & navigation
39+
- MUST: URL reflects state (deep-link filters/tabs/pagination/expanded panels) Prefer libs like [nuqs](https://nuqs47ngcom/)
40+
- MUST: Back/Forward restores scroll
41+
- MUST: Links are links—use `<a>/<Link>` for navigation (support Cmd/Ctrl/middle-click)
42+
- Feedback
43+
- SHOULD: Optimistic UI; reconcile on response; on failure show error and rollback or offer Undo
44+
- MUST: Confirm destructive actions or provide Undo window
45+
- MUST: Use polite `aria-live` for toasts/inline validation
46+
- SHOULD: Ellipsis (`…`) for options that open follow-ups (eg, “Rename…”)
47+
- Touch/drag/scroll
48+
- MUST: Design forgiving interactions (generous targets, clear affordances; avoid finickiness)
49+
- MUST: Delay first tooltip in a group; subsequent peers no delay
50+
- MUST: Intentional `overscroll-behavior: contain` in modals/drawers
51+
- MUST: During drag, disable text selection and set `inert` on dragged element/containers
52+
- MUST: No “dead-looking” interactive zones—if it looks clickable, it is
53+
- Autofocus
54+
- SHOULD: Autofocus on desktop when there’s a single primary input; rarely on mobile (to avoid layout shift)
55+
56+
## Animation
57+
58+
- MUST: Honor `prefers-reduced-motion` (provide reduced variant)
59+
- SHOULD: Prefer CSS > Web Animations API > JS libraries
60+
- MUST: Animate compositor-friendly props (`transform`, `opacity`); avoid layout/repaint props (`top/left/width/height`)
61+
- SHOULD: Animate only to clarify cause/effect or add deliberate delight
62+
- SHOULD: Choose easing to match the change (size/distance/trigger)
63+
- MUST: Animations are interruptible and input-driven (avoid autoplay)
64+
- MUST: Correct `transform-origin` (motion starts where it “physically” should)
65+
66+
## Layout
67+
68+
- SHOULD: Optical alignment; adjust by ±1px when perception beats geometry
69+
- MUST: Deliberate alignment to grid/baseline/edges/optical centers—no accidental placement
70+
- SHOULD: Balance icon/text lockups (stroke/weight/size/spacing/color)
71+
- MUST: Verify mobile, laptop, ultra-wide (simulate ultra-wide at 50% zoom)
72+
- MUST: Respect safe areas (use env(safe-area-inset-*))
73+
- MUST: Avoid unwanted scrollbars; fix overflows
74+
75+
## Content & Accessibility
76+
77+
- SHOULD: Inline help first; tooltips last resort
78+
- MUST: Skeletons mirror final content to avoid layout shift
79+
- MUST: `<title>` matches current context
80+
- MUST: No dead ends; always offer next step/recovery
81+
- MUST: Design empty/sparse/dense/error states
82+
- SHOULD: Curly quotes (“ ”); avoid widows/orphans
83+
- MUST: Tabular numbers for comparisons (`font-variant-numeric: tabular-nums` or a mono like Geist Mono)
84+
- MUST: Redundant status cues (not color-only); icons have text labels
85+
- MUST: Don’t ship the schema—visuals may omit labels but accessible names still exist
86+
- MUST: Use the ellipsis character `…` (not ``)
87+
- MUST: `scroll-margin-top` on headings for anchored links; include a “Skip to content” link; hierarchical `<h1–h6>`
88+
- MUST: Resilient to user-generated content (short/avg/very long)
89+
- MUST: Locale-aware dates/times/numbers/currency
90+
- MUST: Accurate names (`aria-label`), decorative elements `aria-hidden`, verify in the Accessibility Tree
91+
- MUST: Icon-only buttons have descriptive `aria-label`
92+
- MUST: Prefer native semantics (`button`, `a`, `label`, `table`) before ARIA
93+
- SHOULD: Right-clicking the nav logo surfaces brand assets
94+
- MUST: Use non-breaking spaces to glue terms: `10&nbsp;MB`, `⌘&nbsp;+&nbsp;K`, `Vercel&nbsp;SDK`
95+
96+
## Performance
97+
98+
- SHOULD: Test iOS Low Power Mode and macOS Safari
99+
- MUST: Measure reliably (disable extensions that skew runtime)
100+
- MUST: Track and minimize re-renders (React DevTools/React Scan)
101+
- MUST: Profile with CPU/network throttling
102+
- MUST: Batch layout reads/writes; avoid unnecessary reflows/repaints
103+
- MUST: Mutations (`POST/PATCH/DELETE`) target <500 ms
104+
- SHOULD: Prefer uncontrolled inputs; make controlled loops cheap (keystroke cost)
105+
- MUST: Virtualize large lists (eg, `virtua`)
106+
- MUST: Preload only above-the-fold images; lazy-load the rest
107+
- MUST: Prevent CLS from images (explicit dimensions or reserved space)
108+
109+
## Design
110+
111+
- SHOULD: Layered shadows (ambient + direct)
112+
- SHOULD: Crisp edges via semi-transparent borders + shadows
113+
- SHOULD: Nested radii: child ≤ parent; concentric
114+
- SHOULD: Hue consistency: tint borders/shadows/text toward bg hue
115+
- MUST: Accessible charts (color-blind-friendly palettes)
116+
- MUST: Meet contrast—prefer [APCA](https://apcacontrastcom/) over WCAG 2
117+
- MUST: Increase contrast on `:hover/:active/:focus`
118+
- SHOULD: Match browser UI to bg
119+
- SHOULD: Avoid gradient banding (use masks when needed)

.github/workflows/osv-scanner.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main, staging]
6+
pull_request:
7+
branches: [main, staging]
8+
9+
jobs:
10+
test:
11+
name: Run Tests
12+
runs-on: ubuntu-latest
13+
14+
services:
15+
postgres:
16+
image: postgres:16
17+
env:
18+
POSTGRES_USER: postgres
19+
POSTGRES_PASSWORD: postgres
20+
POSTGRES_DB: databuddy_test
21+
ports:
22+
- 5432:5432
23+
options: >-
24+
--health-cmd pg_isready
25+
--health-interval 10s
26+
--health-timeout 5s
27+
--health-retries 5
28+
29+
redis:
30+
image: redis:7-alpine
31+
ports:
32+
- 6379:6379
33+
options: >-
34+
--health-cmd "redis-cli ping"
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
39+
clickhouse:
40+
image: clickhouse/clickhouse-server:latest
41+
ports:
42+
- 8123:8123
43+
- 9000:9000
44+
env:
45+
CLICKHOUSE_DB: databuddy_test
46+
options: >-
47+
--health-cmd "clickhouse-client --query 'SELECT 1'"
48+
--health-interval 10s
49+
--health-timeout 5s
50+
--health-retries 5
51+
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Setup Bun
57+
uses: oven-sh/setup-bun@v2
58+
with:
59+
bun-version: latest
60+
61+
- name: Install dependencies
62+
run: bun install
63+
64+
- name: Run tests
65+
env:
66+
# Database URLs
67+
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/databuddy_test
68+
POSTGRES_URL: postgresql://postgres:postgres@localhost:5432/databuddy_test
69+
70+
# Redis URL
71+
REDIS_URL: redis://localhost:6379
72+
REDIS_HOST: localhost
73+
REDIS_PORT: 6379
74+
75+
# ClickHouse URLs
76+
CLICKHOUSE_URL: http://localhost:8123
77+
CLICKHOUSE_HOST: localhost
78+
CLICKHOUSE_PORT: 8123
79+
CLICKHOUSE_DATABASE: databuddy_test
80+
81+
# Test environment
82+
NODE_ENV: test
83+
84+
# Better Auth secrets (use dummy values for tests)
85+
BETTER_AUTH_SECRET: test-auth-secret-for-ci-testing-only
86+
BETTER_AUTH_URL: http://localhost:3000
87+
88+
# OAuth providers (use dummy values for tests)
89+
GITHUB_CLIENT_ID: test-github-client-id
90+
GITHUB_CLIENT_SECRET: test-github-client-secret
91+
GOOGLE_CLIENT_ID: test-google-client-id
92+
GOOGLE_CLIENT_SECRET: test-google-client-secret
93+
94+
# External services (use dummy values for tests)
95+
RESEND_API_KEY: test-resend-api-key
96+
VERCEL_CLIENT_ID: test-vercel-client-id
97+
VERCEL_CLIENT_SECRET: test-vercel-client-secret
98+
99+
# Dashboard-specific (use dummy values for tests)
100+
AUTUMN_SECRET_KEY: test-autumn-secret-key
101+
NEXT_PUBLIC_API_URL: http://localhost:3000/api
102+
103+
# Other API keys (use dummy values for tests)
104+
EMAIL_API_KEY: test-email-api-key
105+
IP_HASH_SALT: test-ip-hash-salt
106+
107+
run: bun test
108+
109+
- name: Upload coverage reports
110+
if: always()
111+
uses: codecov/codecov-action@v4
112+
with:
113+
files: ./coverage/coverage-final.json
114+
fail_ci_if_error: false
115+
token: ${{ secrets.CODECOV_TOKEN }}
116+

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ out/
2828
build
2929
# generated
3030
# packages/db/generated
31+
packages/db/src/drizzle/meta/0000_snapshot.json
32+
packages/db/src/drizzle/meta/_journal.json
33+
packages/db/src/drizzle/meta
34+
packages/db/src/drizzle/*.sql
3135
dist
3236

3337

@@ -40,4 +44,3 @@ yarn-error.log*
4044
# Misc
4145
.DS_Store
4246
*.pem
43-
apps/api2/src/query/builder.ts

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"editor.codeActionsOnSave": {
1515
"source.fixAll.biome": "explicit",
1616
"source.organizeImports.biome": "explicit"
17-
}
17+
},
18+
"typescript.experimental.useTsgo": false
1819
}

0 commit comments

Comments
 (0)