- Node.js v20.17.0
- NPM
Install pnpm for faster dependency management
npm install --global pnpm
Install all Node modules
pnpm i
See .env.dev
for the necessary environment variable template.
pnpm dev
Note that (routes)
with parentheses are for visual grouping only and do not affect the app routing logic.
scripts/
├── github_templates # Python scripts for scraping/embedding GitHub template repos for matching
src/
├── app/
│ ├── (client)/
│ │ ├── (pages)/ # Pages corresponding to React routes
│ │ ├── components/ # Custom reusable React components
│ │ │ ├── ui/ # UI components generated by ShadCN
│ │ ├── hooks/ # Custom hooks for managing client-side logic
│ │ ├── stores/ # State management (e.g., Zustand stores)
│ ├── (server)/
│ ├── api/ # API routes for backend functionality
│ ├── db/ # Drizzle configuration, schemas, and queries
│ ├── integration/
│ │ ├── auth/ # Authentication logic
│ │ ├── email/ # Email-related utilities
│ │ ├── github/ # GitHub API calls and logic
│ │ └── llm/ # LLM configurations and helper functions
├── lib/ # Utility libraries for common app logic
├── types/ # TypeScript types and Zod schemas for data validation
The source of truth for the project's DB schema is defined using Drizzle in src/app/(server)/db/schema.ts
.
Updates to the DB schema can be made by modifying the TS definitions in this file and running the following commands:
npx drizzle-kit generate
npx drizzle-kit migrate
See Drizzle docs for more info about schema migration.
Important Notes:
- Do NOT update the tables directly in Supabase. There is a known bug with Drizzle that can cause errors when trying to sync the schemas if Supabase manages the tables, foreign keys, etc.
- For proper foreign key relationships to be applied, make sure to define them using the
relations
TS function, not just in the TS table definition:
// Define the relations
export const projectRelations = relations(projects, ({ one }) => ({
owner: one(users, {
fields: [projects.owner_id],
references: [users.id],
}),
}));