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
9 changes: 6 additions & 3 deletions .cursor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project uses the new Cursor project rules structure with **MDC format** for
.cursor/rules/ # Project-wide rules and overview
project.md # General patterns, security, architecture

server/.cursor/rules/ # Backend-specific rules
server/.cursor/rules/ # Backend-specific rules
api.md # API patterns, database, server-side auth

components/.cursor/rules/ # Frontend-specific rules
Expand All @@ -18,18 +18,21 @@ components/.cursor/rules/ # Frontend-specific rules
## Rule Categories

### Project-wide (`.cursor/rules/`)

- Project overview and architecture with Mermaid diagrams
- Common patterns across the entire codebase
- Security guidelines and migration notes
- Development workflow and best practices

### Server (`server/.cursor/rules/`)

- API route patterns and error handling
- Database schema and Drizzle ORM usage
- Better-Auth server-side integration
- Environment configuration and security

### Components (`components/.cursor/rules/`)

- Vue 3 Options API patterns with examples
- shadcn-vue component usage and styling
- Client-side authentication and navigation
Expand Down Expand Up @@ -58,7 +61,7 @@ The rules files use **MDC (Markdown Components)** format with:
When working in different directories, Cursor automatically applies the most relevant rules:

- **Root directory**: General project patterns and architecture
- **`/server/` directory**: Backend API and database patterns
- **`/server/` directory**: Backend API and database patterns
- **`/components/` directory**: Vue component and UI patterns

This ensures you get contextual AI assistance based on what part of the application you're working on.
This ensures you get contextual AI assistance based on what part of the application you're working on.
143 changes: 143 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
# ── Lint (ESLint + Prettier) ──────────────────────────────────────
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v5
with:
node-version: '20'
cache: yarn

- run: yarn install --frozen-lockfile

- run: yarn lint

- run: yarn format:check

# ── Type check (vue-tsc) ──────────────────────────────────────────
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v5
with:
node-version: '20'
cache: yarn

- run: yarn install --frozen-lockfile
# postinstall runs `nuxt prepare`, which generates .nuxt/tsconfig.json

- run: yarn typecheck

# ── Unit tests (Vitest) ───────────────────────────────────────────
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v5
with:
node-version: '20'
cache: yarn

- run: yarn install --frozen-lockfile

- run: yarn test

# ── Production build ──────────────────────────────────────────────
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v5
with:
node-version: '20'
cache: yarn

- run: yarn install --frozen-lockfile

# Run nuxt build directly (not `yarn build`) to skip the
# postbuild lifecycle hook, which runs db migrations and
# requires a live PostgreSQL connection.
- run: npx nuxt build

e2e:
name: E2E (Playwright)
if: github.event_name == 'push'
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: veerify
POSTGRES_PASSWORD: veerifypassword
POSTGRES_DB: veerifydb
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U veerify -d veerifydb"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: veerify
PGPASSWORD: veerifypassword
PGDATABASE: veerifydb
BETTER_AUTH_URL: http://localhost:4173
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v5
with:
node-version: '20'
cache: yarn

- run: yarn install --frozen-lockfile

- name: Install Playwright browser
run: npx playwright install --with-deps chromium

- name: Run migrations
run: yarn db:migrate

- name: Seed test data
run: yarn db:seed:clean && yarn db:seed

- name: Run Playwright (guarded)
run: yarn test:e2e:if-available

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report
if-no-files-found: ignore
retention-days: 7

- name: Upload Playwright results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-results
path: test-results
if-no-files-found: ignore
retention-days: 7
149 changes: 149 additions & 0 deletions .github/workflows/neon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: Create/Delete Branch for Pull Request

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
setup:
name: Setup
outputs:
branch: ${{ steps.branch_name.outputs.current_branch }}
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: branch_name
uses: tj-actions/branch-names@v8

create_neon_branch:
name: Create Neon Branch
outputs:
db_url: ${{ steps.create_neon_branch.outputs.db_url }}
db_url_with_pooler: ${{ steps.create_neon_branch.outputs.db_url_with_pooler }}
needs: setup
if: |
github.event_name == 'pull_request' && (
github.event.action == 'synchronize'
|| github.event.action == 'opened'
|| github.event.action == 'reopened')
runs-on: ubuntu-latest
steps:
- name: Get branch expiration date as an env variable (2 weeks from now)
id: get_expiration_date
run: echo "EXPIRES_AT=$(date -u --date '+14 days' +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_ENV"
- name: Create Neon Branch
id: create_neon_branch
uses: neondatabase/create-branch-action@v6
with:
project_id: ${{ vars.NEON_PROJECT_ID }}
branch_name: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
api_key: ${{ secrets.NEON_API_KEY }}
expires_at: ${{ env.EXPIRES_AT }}

playwright_e2e:
name: PR E2E (Playwright on Neon)
needs: create_neon_branch
if: |
github.event_name == 'pull_request' && (
github.event.action == 'synchronize'
|| github.event.action == 'opened'
|| github.event.action == 'reopened')
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ needs.create_neon_branch.outputs.db_url_with_pooler }}
BETTER_AUTH_URL: http://localhost:4173
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v5
with:
node-version: '20'
cache: yarn

- run: yarn install --frozen-lockfile

- name: Install Playwright browser
run: npx playwright install --with-deps chromium

- name: Run migrations
run: yarn db:migrate

- name: Seed test data
run: yarn db:seed:clean && yarn db:seed

- name: Run Playwright
run: yarn test:e2e:if-available

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: neon-playwright-report-pr-${{ github.event.number }}
path: playwright-report
if-no-files-found: ignore
retention-days: 7

- name: Upload Playwright results
if: always()
uses: actions/upload-artifact@v4
with:
name: neon-playwright-results-pr-${{ github.event.number }}
path: test-results
if-no-files-found: ignore
retention-days: 7

# The step above creates a new Neon branch.
# You may want to do something with the new branch, such as run migrations, run tests
# on it, or send the connection details to a hosting platform environment.
# The branch DATABASE_URL is available to you via:
# "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}".
# It's important you don't log the DATABASE_URL as output as it contains a username and
# password for your database.
# For example, you can uncomment the lines below to run a database migration command:
# - name: Run Migrations
# run: npm run db:migrate
# env:
# # to use pooled connection
# DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url_with_pooler }}"
# # OR to use unpooled connection
# # DATABASE_URL: "${{ steps.create_neon_branch.outputs.db_url }}"

# Following the step above, which runs database migrations, you may want to check
# for schema changes in your database. We recommend using the following action to
# post a comment to your pull request with the schema diff. For this action to work,
# you also need to give permissions to the workflow job to be able to post comments
# and read your repository contents. Add the following permissions to the workflow job:
#
# permissions:
# contents: read
# pull-requests: write
#
# You can also check out https://github.com/neondatabase/schema-diff-action for more
# information on how to use the schema diff action.
# You can uncomment the lines below to enable the schema diff action.
# - name: Post Schema Diff Comment to PR
# uses: neondatabase/schema-diff-action@v1
# with:
# project_id: ${{ vars.NEON_PROJECT_ID }}
# compare_branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
# api_key: ${{ secrets.NEON_API_KEY }}

delete_neon_branch:
name: Delete Neon Branch
needs: setup
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Delete Neon Branch
uses: neondatabase/delete-branch-action@v3
with:
project_id: ${{ vars.NEON_PROJECT_ID }}
branch: preview/pr-${{ github.event.number }}-${{ needs.setup.outputs.branch }}
api_key: ${{ secrets.NEON_API_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ logs
.DS_Store
.fleet
.idea
playwright-report
test-results

# Local env files
.env
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.nuxt
.output
dist
.cache
server/database/migrations
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 120,
"tabWidth": 2,
"bracketSpacing": true
}
15 changes: 15 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Agent Memory

## Post-change validation checklist
- Run `yarn typecheck`.
- Run `yarn test`.
- Run `yarn lint`.
- Run `yarn test:e2e:if-available`.

## Playwright execution rule
- `yarn test:e2e:if-available` must run Playwright only when the environment is available (cloud/CI or explicitly forced with `PLAYWRIGHT_FORCE=1`) and a database connection is configured.
- If the guarded Playwright command skips, include the skip reason in the update/final response.

## UI change policy
- For any task that adds or changes user-facing UI behavior, create or update Playwright coverage for the affected workflow before considering the task complete.
- Run Playwright repeatedly until the updated UI workflow tests pass (not just a single run).
Loading
Loading