mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
Root cause: cf-webapp used typescript@~5.4.5 while common used typescript@^5.9.3. Since @prisma/client has typescript as a peer dep, pnpm created two separate instances. prisma generate wrote to one, but Next.js resolved the other — causing "Cannot find module '.prisma/client/default'" at build time. Fix: upgrade cf-webapp to typescript@^5.9.3 to match common. This deduplicates @prisma/client to a single pnpm instance. Also fixes cf-api deploy: exclude node_modules from copyfiles glob and use cp -rL to dereference pnpm symlinks. |
||
|---|---|---|
| .. | ||
| cf-api | ||
| cf-webapp | ||
| common | ||
| VSC-Extension | ||
| .npmrc | ||
| CLAUDE.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
CodeFlash AI
Overview
CodeFlash AI is a JavaScript/TypeScript monorepo that provides a scalable and modular architecture for web applications, focusing on efficient code sharing and robust development practices.
Project Structure
js/
├── common/ # Shared code and database schema
├── cf-api/ # Backend API service
├── cf-webapp/ # Next.js web application
├── VSC-Extension/ # VS Code extension
└── pnpm-workspace.yaml
Prerequisites
- Node.js (v20+)
- pnpm (v10+):
npm install -g pnpm - Prisma CLI (installed as devDependency)
Setup
1. Clone the Repository
git clone https://github.com/your-org/codeflash-ai.git
cd codeflash-ai/js
2. Install Dependencies
# Install all workspace dependencies from js/
pnpm install
3. Database Configuration
# Generate Prisma client and run migrations
cd common
pnpm prisma generate
pnpm prisma migrate dev
Development Workflow
Start Development Servers
# From js/ workspace root:
pnpm --filter cf-api dev
pnpm --filter cf-webapp dev
Build
# Build individual packages
pnpm --filter cf-webapp build
pnpm --filter cf-api build
pnpm --filter @codeflash-ai/common build
Key Components
Common Package (@codeflash-ai/common)
- Shared TypeScript utilities
- Prisma database schema
- Reusable functions across projects
- Referenced as
"workspace:*"by cf-api and cf-webapp
Usage Example
import { createOrUpdateUser } from "@codeflash-ai/common"
Best Practices
- Always install from the workspace root (
js/) - Keep shared logic in the
commonpackage - Use TypeScript for type safety
- Follow existing code structure
- Never commit sensitive data or build artifacts
Publishing common Package
cd common
pnpm build
pnpm publish