diff --git a/.env b/.env new file mode 100644 index 0000000..2728b56 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +NEXT_PUBLIC_SUPABASE_URL=https://example.supabase.co +NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key +BLOB_READ_WRITE_TOKEN=your-blob-token diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2006a51 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# Deployment +# VERCEL_TOKEN= +# FIREBASE_TOKEN= + +# Assets +BLOB_READ_WRITE_TOKEN= diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..7c9c9f2 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,17 @@ +{ + "projects": { + "default": "cur8d-vibe" + }, + "targets": { + "cur8d-vibe": { + "hosting": { + "site": [ + "cur8d-site" + ], + "docs": [ + "cur8d-docs" + ] + } + } + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a038193 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @amrabed diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..4bb707e --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,78 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and unwelcome sexual attention or advances +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT EMAIL ADDRESS]. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..3b585c3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,45 @@ +name: Bug Report +description: File a bug report +body: + - type: input + id: title + attributes: + label: Title + placeholder: "[BUG] Brief description of the issue" + validations: + required: true + - type: textarea + id: environment + attributes: + label: Environment + description: OS, Browser, Node version, etc. + placeholder: | + OS: macOS 14.0 + Browser: Chrome 120 + Node version: 24.0.0 + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproduction Steps + placeholder: | + 1. Run `pnpm dev` + 2. Navigate to `/dashboard` + 3. Click on ... + validations: + required: true + - type: textarea + id: expected-actual + attributes: + label: Expected vs Actual + placeholder: | + Expected: ... + Actual: ... + validations: + required: true + - type: textarea + id: context + attributes: + label: Additional Context + placeholder: Add any other context or screenshots about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..7818132 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: GitHub Discussions + url: https://github.com/cur8d/typescript/discussions + about: Please ask questions and share ideas in Discussions. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..f121701 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,34 @@ +name: Feature Request +description: Suggest an idea for a new feature or an improvement to an existing one +body: + - type: input + id: title + attributes: + label: Title + placeholder: "[FEAT] Brief description of the feature" + validations: + required: true + - type: textarea + id: problem + attributes: + label: Problem + description: Is your feature request related to a problem? Please describe. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Alternatives + description: A clear and concise description of any alternative solutions or features you've considered. + - type: textarea + id: context + attributes: + label: Additional Context + placeholder: Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..842c368 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +## Description +Please include a summary of the change and which issue is fixed. + +## Change Type +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] Documentation update + +## Testing Steps +Please describe the tests that you ran to verify your changes. + +## Screenshots (if applicable) + +## Related Issues +Fixes # + +## Checklist +- [ ] `pnpm typecheck` passes +- [ ] `pnpm lint` passes +- [ ] `pnpm test` (Vitest) passes +- [ ] `pnpm test:e2e` (Playwright) passes +- [ ] Coverage thresholds (80%) met +- [ ] Documentation updated +- [ ] No `any` types introduced diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..baca7e4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + groups: + production: + patterns: + - "*" + dependency-type: "production" + development: + patterns: + - "*" + dependency-type: "development" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..53e08b7 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,39 @@ +name: Test and Lint Code + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v4 + - name: Install dependencies + run: mise run install + - name: Typecheck + run: mise run typecheck + - name: Lint + run: mise run lint + - name: Test + run: mise run test:coverage + - name: Install Playwright Browsers + run: mise run playwright:install + - name: Build + run: mise run build + - name: Run E2E tests + run: mise run test:e2e + - name: Upload coverage + uses: actions/upload-artifact@v7 + with: + name: coverage-report + path: coverage/ + - name: Upload Playwright report + if: failure() + uses: actions/upload-artifact@v7 + with: + name: playwright-report + path: playwright-report/ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ba84d94 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,54 @@ +name: Deploy Site + +on: + push: + branches: [main] + paths-ignore: + - 'docs/**' + workflow_dispatch: + inputs: + environment: + description: 'Environment to deploy to' + required: true + default: 'preview' + type: choice + options: + - production + - preview + provider: + description: 'Deployment provider' + required: true + default: 'vercel' + type: choice + options: + - vercel + - firebase + +jobs: + deploy-vercel: + if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.provider == 'vercel') }} + runs-on: ubuntu-latest + environment: + name: ${{ github.event.inputs.environment || 'production' }} + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v4 + - name: Deploy to Vercel + run: mise run deploy:vercel + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + VERCEL_ENV: ${{ github.event.inputs.environment || 'production' }} + + deploy-firebase: + if: ${{ github.event_name == 'workflow_dispatch' && inputs.provider == 'firebase' }} + runs-on: ubuntu-latest + environment: + name: ${{ github.event.inputs.environment }} + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v4 + - name: Deploy to Firebase + run: mise run deploy:firebase + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + FIREBASE_ENV: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8fbe3a7 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,36 @@ +name: Deploy Docs to GitHub Pages + +on: + push: + branches: [main] + paths: + - 'docs/**' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v4 + - name: Install dependencies + run: mise run install + - name: Build Docs + run: mise run docs:build + - name: Upload artifact + uses: actions/upload-pages-artifact@v5 + with: + path: ./docs/out + + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bc1a3cc --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# dependencies +node_modules +.pnpm-debug.log* +yarn-error.log* + +# next.js +.next/ +out/ + +# production +/build + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# testing +/coverage +/test-results +/playwright-report +/blob-report +/playwright/.cache + +# misc +.DS_Store +*.pem diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..c5b546c --- /dev/null +++ b/.mise.toml @@ -0,0 +1,101 @@ +[tools] +node = "24.0.0" +pnpm = "11.1.2" + +[shell_alias] +m = "mise run" +i = "mise run install" +l = "mise run lint" +t = "mise run test" +b = "mise run build" +d = "mise run dev" +s = "mise run start" + +[tasks.install] +description = "Install dependencies" +run = "pnpm install" +alias = "i" + +[tasks.dev] +description = "Start development server" +run = "pnpm run dev" +alias = "d" + +[tasks.build] +description = "Build the project" +run = "pnpm run build" +alias = "b" + +[tasks.start] +description = "Start production server" +run = "pnpm run start" +alias = "s" + +[tasks.lint] +description = "Run linting" +run = "pnpm run lint" +alias = "l" + +[tasks.typecheck] +description = "Run typechecking" +run = "pnpm run typecheck" + +[tasks.test] +description = "Run unit tests" +run = "pnpm run test" +alias = "t" + +[tasks."test:ui"] +description = "Run unit tests with UI" +run = "pnpm run test:ui" + +[tasks."test:coverage"] +description = "Run unit tests with coverage" +run = "pnpm run test:coverage" + +[tasks."test:e2e"] +description = "Run E2E tests" +run = "pnpm run test:e2e" + +[tasks."test:e2e:ui"] +description = "Run E2E tests with UI" +run = "pnpm run test:e2e:ui" + +[tasks."playwright:install"] +description = "Install Playwright browsers" +run = "pnpm exec playwright install --with-deps" + +[tasks."docs:dev"] +description = "Start documentation development server" +run = "pnpm --filter docs dev" + +[tasks."docs:build"] +description = "Build the documentation" +run = "pnpm --filter docs build" + +[tasks."deploy:firebase"] +description = "Deploy the site to Firebase" +run = """ +pnpm add -g firebase-tools +pnpm install +pnpm run build +if [ "$FIREBASE_ENV" = "production" ]; then + firebase deploy --only hosting:site --token=$FIREBASE_TOKEN +else + firebase hosting:channel:deploy site --expires 7d --token=$FIREBASE_TOKEN +fi +""" + +[tasks."deploy:firebase:docs"] +description = "Deploy the documentation to Firebase" +run = "pnpm run deploy:firebase:docs" + +[tasks."deploy:vercel"] +description = "Deploy the site to Vercel" +run = """ +pnpm add -g vercel +pnpm install +vercel pull --yes --environment=$VERCEL_ENV --token=$VERCEL_TOKEN +vercel build $([ "$VERCEL_ENV" = "production" ] && echo "--prod") --token=$VERCEL_TOKEN +vercel deploy --prebuilt $([ "$VERCEL_ENV" = "production" ] && echo "--prod") --token=$VERCEL_TOKEN +""" diff --git a/.vibe/specs/0-create-template/plan.md b/.vibe/specs/0-create-template/plan.md new file mode 100644 index 0000000..aec06a7 --- /dev/null +++ b/.vibe/specs/0-create-template/plan.md @@ -0,0 +1,49 @@ +# Design and Plan: Cur8d Template + +## Overview +Cur8d is a production-ready Next.js 16 starter template designed for high performance, accessibility, and developer productivity. It leverages the latest web technologies and strictly enforces TypeScript for type safety. + +## Tech Stack +- **Next.js 16.2.6**: App Router, TypeScript strict mode, Turbopack. +- **React 19**: Peer dependency of Next.js 16. +- **Tailwind CSS v4**: CSS-first configuration via `@theme` in `globals.css`. +- **HeroUI v3.0.5**: Core UI component library. +- **Framer Motion**: For complex animations and page transitions. +- **Lucide React**: Icon library. +- **cmdk**: Keyboard-driven command palette. +- **next-themes**: Dark mode management. +- **Zod**: Environment variable validation. +- **Vitest 4.1**: Unit and component testing. +- **Playwright 1.59.1**: E2E and accessibility testing. +- **Supabase**: Data layer (stubbed integration). +- **Vercel Blob**: File storage (stubbed integration). + +## Architectural Design +### 1. Component Strategy +- **Server Components by default**: Optimization for performance and SEO. +- **Client Components at leaf nodes**: Minimal use of `"use client"` for interactivity. +- **Barrel Exports**: Every component folder includes an `index.ts` for clean imports. +- **TSDoc**: Mandatory documentation for all public components and utilities. + +### 2. Styling +- **Tailwind v4 CSS-first**: Theme configuration is handled directly in CSS, avoiding a separate JS/TS config file. +- **Responsive Design**: Mobile-first approach, tested at 375px and 1280px. +- **Dark Mode**: Seamless light/dark mode support with system preference detection. + +### 3. Data & State Management +- **Type-safe Environment**: Environment variables validated at runtime using Zod. +- **Data Access Layer**: Abstracted data fetching through `src/lib/data/` returning typed interfaces. +- **URL-synced State**: Data table filters and search state synchronized with URL search params. + +### 4. Testing & Quality +- **Co-located Unit Tests**: Tests sit next to their components. +- **Comprehensive E2E**: Covering navigation, keyboard interactions, and accessibility. +- **CI/CD Integration**: Automated workflows for type-checking, linting, and testing on every PR. + +## Implementation Strategy +The project will be built in phases: +1. **Infrastructure**: Toolchain setup (mise, pnpm), core configurations (Next.js, TS, Tailwind). +2. **Core Components**: Navigation, layout providers, and theme toggling. +3. **Data Layer**: Mock data structures and Supabase/Blob stubs. +4. **Feature Pages**: Landing, Dashboard (complex data table), About, and Error pages. +5. **Testing & Docs**: Implementing the test suites and the Nextra documentation site. diff --git a/.vibe/specs/0-create-template/requirements.md b/.vibe/specs/0-create-template/requirements.md index 0187f34..ab343c7 100644 --- a/.vibe/specs/0-create-template/requirements.md +++ b/.vibe/specs/0-create-template/requirements.md @@ -162,8 +162,8 @@ Scaffold with realistic, domain-agnostic placeholder data (not lorem ipsum): **Reusable components (`src/components/`):** - `` — SVG logo placeholder + nav links + dark mode toggle + `⌘K` trigger with badge; - logo must read "blueprint" in the SVG mark -- `