-
Notifications
You must be signed in to change notification settings - Fork 0
Initialized the FrontEnd #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
06a0435
bc6849c
e4b21fd
7913cb7
ca99967
5c2c3df
ce6c8d0
5f490da
c6ffdc9
287511e
256a5af
51051f5
e5f38df
6b678b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| ## Architecture & Priorities | ||
|
|
||
| - This is a PoC: prioritize developer speed and clarity over abstraction. | ||
| - Treat all backends as APIs; do not couple services together. | ||
| - The AI service is stateless and must not call application APIs directly. | ||
|
|
||
| ## Monorepo Structure | ||
|
|
||
| - This is a TurboRepo monorepo with pnpm workspaces | ||
| - Apps live in `apps/` (currently only tanstack-start) | ||
| - Shared packages live in `packages/` | ||
| - External services live in `services/` | ||
| - Use `turbo.json` for task definitions and caching | ||
|
|
||
| ## Environment & Configuration | ||
|
|
||
| - Use Zod for environment validation in TypeScript packages | ||
| - Follow the pattern in `packages/auth/env.ts` for type-safe env vars | ||
| - Never commit sensitive values; use `example.env` as a template | ||
| - Prefix AI service env vars with `AI_` to avoid conflicts | ||
|
|
||
| ## Authentication | ||
|
|
||
| - Use [WorkOS](https://workos.com/docs/llms.txt) for authentication and organization context. | ||
| - Do not invent custom auth flows. | ||
| - User identity and org context must be passed explicitly to services. | ||
|
|
||
| ## Frontend & UI | ||
|
|
||
| - All reusable UI components must live in the `packages/ui` package. | ||
| - Use Tailwind CSS for styling. | ||
| - Prefer shadcn/ui components where applicable. | ||
| - Do not create ad-hoc UI components in app folders. | ||
|
|
||
| ## Forms & State | ||
|
|
||
| - Use `@tanstack/react-form` for all forms. | ||
| - Use `@tanstack/react-query` for data fetching, caching, and mutations. | ||
| - Use `@tanstack/react-router` for routing. | ||
|
|
||
| ## APIs & Data Fetching | ||
|
|
||
| - Use tRPC for type-safe application API calls (user data, metrics, app state). | ||
| - Use OpenAPI Generator to generate a typed client for the FastAPI AI service. | ||
| - Do not mix tRPC and OpenAPI clients. | ||
| - Do not have the AI service call the application API. | ||
|
|
||
| ## Database & Validation | ||
|
|
||
| - Use Drizzle ORM for database access. | ||
| - Use Zod for validation. | ||
| - Use `drizzle-zod` for deriving Zod schemas from Drizzle models. | ||
| - Do not duplicate schema definitions manually. | ||
| - Place non-database Zod schemas in the `packages/validators` package. | ||
|
|
||
| ## AI Service Integration | ||
|
|
||
| - The AI service receives all required inputs (user context, metrics, documents). | ||
| - The AI service must not fetch user or metrics data on its own. | ||
| - Inputs should be explicit, minimal, and versionable. | ||
| - AI service shouldn't have a seperate auth flow it should instead use the AI_SERVICE_KEY env var to authenticate requests from the main app which will have that variable sent using a secure header. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| body: | ||
| - type: markdown | ||
| attributes: | ||
| value: | | ||
| Thank you for taking the time to file a feature request. Please fill out this form as completely as possible. | ||
| - type: textarea | ||
| attributes: | ||
| label: Describe the feature you'd like to request | ||
| description: Please describe the feature as clear and concise as possible. Remember to add context as to why you believe this feature is needed. | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| attributes: | ||
| label: Describe the solution you'd like to see | ||
| description: Please describe the solution you would like to see. Adding example usage is a good way to provide context. | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| attributes: | ||
| label: Additional information | ||
| description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: 🐞 Bug Report | ||
| description: Create a bug report to help us improve | ||
| title: "bug: " | ||
| labels: ["🐞❔ unconfirmed bug"] | ||
| body: | ||
| - type: textarea | ||
| attributes: | ||
| label: Provide environment information | ||
| description: | | ||
| Run this command in your project root and paste the results in a code block: | ||
| ```bash | ||
| npx envinfo --system --binaries | ||
| ``` | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| attributes: | ||
| label: Describe the bug | ||
| description: A clear and concise description of the bug, as well as what you expected to happen when encountering it. | ||
| validations: | ||
| required: true | ||
| - type: input | ||
| attributes: | ||
| label: Link to reproduction | ||
| description: Please provide a link to a reproduction of the bug. Issues without a reproduction repo may be ignored. | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| attributes: | ||
| label: To reproduce | ||
| description: Describe how to reproduce your bug. Steps, code snippets, reproduction repos etc. | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| attributes: | ||
| label: Additional information | ||
| description: Add any other information related to the bug here, screenshots if applicable. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": ["config:base"], | ||
| "packageRules": [ | ||
| { | ||
| "matchPackagePatterns": ["^@governance/"], | ||
| "enabled": false | ||
| } | ||
| ], | ||
| "updateInternalDeps": true, | ||
| "rangeStrategy": "bump", | ||
| "automerge": true, | ||
| "npm": { | ||
| "fileMatch": ["(^|/)package\\.json$", "(^|/)package\\.json\\.hbs$"] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["*"] | ||
| push: | ||
| branches: ["main"] | ||
| merge_group: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| # You can leverage Vercel Remote Caching with Turbo to speed up your builds | ||
| # @link https://turborepo.com/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds | ||
| env: | ||
| FORCE_COLOR: 3 | ||
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup | ||
| uses: ./tooling/github/setup | ||
|
|
||
| - name: Copy env | ||
| shell: bash | ||
| run: cp .env.example .env | ||
|
|
||
| - name: Lint | ||
| run: pnpm lint && pnpm lint:ws | ||
|
|
||
| format: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup | ||
| uses: ./tooling/github/setup | ||
|
|
||
| - name: Format | ||
| run: pnpm format | ||
|
|
||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup | ||
| uses: ./tooling/github/setup | ||
|
|
||
| - name: Typecheck | ||
| run: pnpm typecheck |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22.21.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "recommendations": [ | ||
| "dbaeumer.vscode-eslint", | ||
| "esbenp.prettier-vscode", | ||
| "yoavbls.pretty-ts-errors", | ||
| "bradlc.vscode-tailwindcss" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Next.js", | ||
| "type": "node-terminal", | ||
| "request": "launch", | ||
| "command": "pnpm dev", | ||
| "cwd": "${workspaceFolder}/apps/nextjs", | ||
|
Comment on lines
+5
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check which app folders exist
echo "=== Listing apps directory ==="
ls -la apps/ 2>/dev/null || echo "No 'apps' directory found"
echo -e "\n=== Finding directories in apps ==="
fd -t d -d 2 . apps/ 2>/dev/null || echo "Could not find apps structure"
echo -e "\n=== Checking .vscode/launch.json content ==="
cat .vscode/launch.json 2>/dev/null || echo "Could not find .vscode/launch.json"Repository: AFAskar/Governance-Agent Length of output: 863 Update the launch configuration to target the correct app. The config points to 🔧 Suggested update {
- "name": "Next.js",
+ "name": "TanStack Start",
"type": "node-terminal",
"request": "launch",
"command": "pnpm dev",
- "cwd": "${workspaceFolder}/apps/nextjs",
+ "cwd": "${workspaceFolder}/apps/tanstack-start",
"skipFiles": ["<node_internals>/**"],
"sourceMaps": true,
"sourceMapPathOverrides": {
- "/turbopack/[project]/*": "${webRoot}/*" //https://github.com/vercel/next.js/issues/62008
+ "/turbopack/[project]/*": "${workspaceFolder}/apps/tanstack-start/*" //https://github.com/vercel/next.js/issues/62008
}
}🤖 Prompt for AI Agents |
||
| "skipFiles": ["<node_internals>/**"], | ||
| "sourceMaps": true, | ||
| "sourceMapPathOverrides": { | ||
| "/turbopack/[project]/*": "${webRoot}/*" //https://github.com/vercel/next.js/issues/62008 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "eslint.workingDirectories": [ | ||
| { | ||
| "mode": "auto" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| routeTree.gen.ts |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineConfig } from "eslint/config"; | ||
|
|
||
| import { baseConfig, restrictEnvAccess } from "@governance/eslint-config/base"; | ||
| import { reactConfig } from "@governance/eslint-config/react"; | ||
|
|
||
| export default defineConfig( | ||
| { | ||
| ignores: [".nitro/**", ".output/**", ".tanstack/**"], | ||
| }, | ||
| baseConfig, | ||
| reactConfig, | ||
| restrictEnvAccess, | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "name": "@governance/tanstack-start", | ||
| "private": true, | ||
| "sideEffects": false, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "pnpm with-env vite dev", | ||
| "build": "vite build", | ||
| "start": "vite start", | ||
| "format": "prettier --check . --ignore-path ../../.gitignore --ignore-path .prettierignore", | ||
| "lint": "eslint --flag unstable_native_nodejs_ts_config", | ||
| "typecheck": "tsc --noEmit", | ||
| "with-env": "dotenv -e ../../.env --" | ||
| }, | ||
| "dependencies": { | ||
| "@fontsource-variable/geist": "^5.2.8", | ||
| "@fontsource-variable/geist-mono": "^5.2.7", | ||
| "@governance/api": "workspace:*", | ||
| "@governance/auth": "workspace:*", | ||
| "@governance/db": "workspace:*", | ||
| "@governance/ui": "workspace:*", | ||
| "@t3-oss/env-core": "^0.13.8", | ||
| "@tanstack/react-form": "catalog:", | ||
| "@tanstack/react-query": "catalog:", | ||
| "@tanstack/react-router": "^1.135.2", | ||
| "@tanstack/react-router-devtools": "^1.135.2", | ||
| "@tanstack/react-router-ssr-query": "^1.135.2", | ||
| "@tanstack/react-start": "^1.135.2", | ||
| "@trpc/client": "catalog:", | ||
| "@trpc/server": "catalog:", | ||
| "@trpc/tanstack-react-query": "catalog:", | ||
| "better-auth": "catalog:", | ||
| "nitro": "3.0.1-alpha.1", | ||
| "react": "catalog:react19", | ||
| "react-dom": "catalog:react19", | ||
| "superjson": "2.2.3", | ||
| "zod": "catalog:" | ||
| }, | ||
| "devDependencies": { | ||
| "@governance/eslint-config": "workspace:*", | ||
| "@governance/prettier-config": "workspace:*", | ||
| "@governance/tailwind-config": "workspace:*", | ||
| "@governance/tsconfig": "workspace:*", | ||
| "@tailwindcss/vite": "catalog:", | ||
| "@types/node": "catalog:", | ||
| "@types/react": "catalog:react19", | ||
| "@types/react-dom": "catalog:react19", | ||
| "@vitejs/plugin-react": "catalog:", | ||
| "eslint": "catalog:", | ||
| "prettier": "catalog:", | ||
| "tailwindcss": "catalog:", | ||
| "typescript": "catalog:", | ||
| "vite": "catalog:", | ||
| "vite-tsconfig-paths": "^5.1.4" | ||
| }, | ||
| "prettier": "@governance/prettier-config" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import { createAuthClient } from "better-auth/react"; | ||
|
|
||
| export const authClient = createAuthClient(); | ||
|
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Search for createAuthClient usage in the codebase
rg "createAuthClient" --type ts --type tsx -B 2 -A 2Repository: AFAskar/Governance-Agent Length of output: 95 🏁 Script executed: # Look for better-auth related files and configurations
fd -e "auth" -type f | head -20Repository: AFAskar/Governance-Agent Length of output: 238 🏁 Script executed: # Check for package.json to see better-auth version
cat package.json 2>/dev/null | grep -A 5 "better-auth" || fd "package.json" -x grep -l "better-auth" {}Repository: AFAskar/Governance-Agent Length of output: 131 🌐 Web query:
💡 Result: 1) Server (TanStack Start) — set
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||||||||||||||||||||
| import { reactStartCookies } from "better-auth/react-start"; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import { initAuth } from "@governance/auth"; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import { env } from "~/env"; | ||||||||||||||||||||||||||||
| import { getBaseUrl } from "~/lib/url"; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export const auth = initAuth({ | ||||||||||||||||||||||||||||
| baseUrl: getBaseUrl(), | ||||||||||||||||||||||||||||
| productionUrl: `https://${env.VERCEL_PROJECT_PRODUCTION_URL ?? "turbo.t3.gg"}`, | ||||||||||||||||||||||||||||
| secret: env.AUTH_SECRET, | ||||||||||||||||||||||||||||
| discordClientId: env.AUTH_DISCORD_ID, | ||||||||||||||||||||||||||||
| discordClientSecret: env.AUTH_DISCORD_SECRET, | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align
🛠️ Suggested fix (remove unsupported props) export const auth = initAuth({
baseUrl: getBaseUrl(),
productionUrl: `https://${env.VERCEL_PROJECT_PRODUCTION_URL ?? "turbo.t3.gg"}`,
secret: env.AUTH_SECRET,
- discordClientId: env.AUTH_DISCORD_ID,
- discordClientSecret: env.AUTH_DISCORD_SECRET,
extraPlugins: [reactStartCookies()],
});📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Actions: CI[error] 12-12: TypeScript error TS2353: Object literal may only specify known properties, and 'discordClientId' does not exist in type '{ baseUrl: string; productionUrl: string; secret: string | undefined; extraPlugins?: { id: "react-start-cookies"; hooks: { after: { matcher(ctx: EndpointContext<string, any> & Omit<...> & { ...; }): true; handler: (inputContext: MiddlewareInputContext<...>) => Promise<...>; }[]; }; }[] | undefined; }'. (during 'tsc --noEmit' for 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| extraPlugins: [reactStartCookies()], | ||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Renovate automerge top level configuration applies all updates best practices💡 Result:
Does top-level
automergeapply to all updates?Yes. Setting
"automerge": trueat the top level makes every Renovate PR eligible for automerge by default (including majors), unless you override it with more specific config likepackageRules. Renovate’s own docs caution that you “usually won’t want to automerge all PRs” and recommend usingpackageRulesto scope automerge to safer update types (e.g. minor/patch/digest). [1]Best-practice approach (recommended)
"automerge": false(or omit it), and enable automerge only for low-risk updates viapackageRules. [1]config:best-practices. Renovate maintainers recommend extending it for upgrade strategy defaults. [2]0.x) to reduce accidental breaking changes. [4]Example config (safe “automerge for most low-risk updates”)
{ "extends": ["config:best-practices"], "automerge": false, "automergeType": "pr", "packageRules": [ { "description": "Automerge non-major only for semver-stable deps", "matchCurrentVersion": "!/^0/", "matchUpdateTypes": ["minor", "patch", "pin", "digest"], "automerge": true }, { "description": "Never automerge majors", "matchUpdateTypes": ["major"], "automerge": false } ] }If you tell me your platform (GitHub/GitLab/Azure) and whether you want automerge for prod
dependenciesor onlydevDependencies, I can tailor the rules more tightly.🌐 Web query:
Renovate packageRules automerge scope specific packages internal dependencies💡 Result:
To automerge only your internal dependencies (e.g., npm packages in your org scope like
@myco/*, or packages whosesourceUrlpoints to your GitHub org), usepackageRuleswith matchers such asmatchPackageNames(supports glob/regex) and/ormatchSourceUrls, then enableautomerge(optionally limited to safe update types). (docs.renovatebot.com)Example: automerge internal scoped npm packages (recommended)
{ "packageRules": [ { "description": "Automerge internal `@myco/`* deps (non-major only)", "matchDatasources": ["npm"], "matchPackageNames": ["@myco/**"], "matchUpdateTypes": ["patch", "minor", "pin", "digest"], "automerge": true, "automergeType": "pr" } ] }matchPackageNamessupports exact names, glob (e.g.@myco/**), and regex patterns. (docs.renovatebot.com)automergecan be combined withmatchUpdateTypesto avoid major updates. (docs.renovatebot.com)matchDatasourcesis a common way to scope rules to npm (or other ecosystems). (docs.renovatebot.com)Example: automerge “internal” by repo/source URL (works across names)
If your internal packages all originate from (say) GitHub org repos, match on
sourceUrl:{ "packageRules": [ { "description": "Automerge deps whose source is our GitHub org", "matchSourceUrls": ["https://github.com/myco/**"], "matchUpdateTypes": ["patch", "minor", "pin", "digest"], "automerge": true, "automergeType": "pr" } ] }matchSourceUrlscan match exact URLs or patterns. (docs.renovatebot.com)Example: automerge a specific internal package (exact list)
{ "packageRules": [ { "matchPackageNames": ["@myco/shared-config", "@myco/eslint-config"], "automerge": true } ] }matchPackageNamessupports exact matching too. (docs.renovatebot.com)If you tell me your ecosystem (npm/maven/docker/etc.) and what you mean by “internal” (scope, registry host, GitHub org, monorepo workspace), I can tailor the tightest/least-risk rule set.
Citations:
Scope automerge to specific update types instead of globally enabling it.
Global
automerge: trueapplies to all updates by default, including major version bumps and all third-party dependencies. Renovate's documentation recommends disabling global automerge and enabling it selectively only for low-risk updates (e.g., minor, patch, digest) viapackageRules.Instead of the suggested config, disable global automerge and add a
packageRulesentry withmatchUpdateTypesto limit automerge to safe, non-breaking updates:♻️ Recommended configuration
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], "packageRules": [ { "matchPackagePatterns": ["^@governance/"], "enabled": false }, + { + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true + } ], "updateInternalDeps": true, "rangeStrategy": "bump", - "automerge": true, + "automerge": false, "npm": { "fileMatch": ["(^|/)package\\.json$", "(^|/)package\\.json\\.hbs$"] } }This prevents accidental automerge of major versions while still automating safe, low-risk updates.
📝 Committable suggestion
🤖 Prompt for AI Agents