mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
- **misc fixes [VSC]** - **misc lefthook** # Pull Request Checklist ## Description - [ ] **Description of PR**: Clear and concise description of what this PR accomplishes - [ ] **Breaking Changes**: Document any breaking changes (if applicable) - [ ] **Related Issues**: Link to any related issues or tickets ## Testing - [ ] **Test cases Attached**: All relevant test cases have been added/updated - [ ] **Manual Testing**: Manual testing completed for the changes ## Monitoring & Debugging - [ ] **Logging in place**: Appropriate logging has been added for debugging user issues - [ ] **Sentry will be able to catch errors**: Error handling ensures Sentry can capture and report errors - [ ] **Avoid Dev based/Prisma logging**: No development-only or Prisma-specific logging in production code ## Configuration - [ ] **Env variables newly added**: Any new environment variables are documented in .env.example file or mentioned in description --- ## Additional Notes <!-- Add any additional context, screenshots, or notes for reviewers here --> |
||
|---|---|---|
| .. | ||
| cf-api | ||
| cf-webapp | ||
| common | ||
| VSC-Extension | ||
| 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
Prerequisites
- Node.js (v18+ recommended)
- npm (v9+)
- Prisma CLI
Setup
1. Clone the Repository
git clone https://github.com/your-org/codeflash-ai.git
cd codeflash-ai/js
2. Install Dependencies
# Install root and project dependencies
npm install
cd common && npm install
cd ../cf-api && npm install
cd ../cf-webapp && npm install
3. Database Configuration
# Generate Prisma client and run migrations
cd common
npx prisma generate
npx prisma migrate dev
Development Workflow
Start Development Servers
# Start API server
cd cf-api
For local development, developers would use `npm run dev`
For production (Azure), the system would use `npm run start`
# Start web application
cd cf-webapp
npm run dev
Build Common Package
cd common
npm run build
Key Components
Common Package (@codeflash-ai/common)
- Shared TypeScript utilities
- Prisma database schema
- Reusable functions across projects
Installation in Other Projects
npm install @codeflash-ai/common
Usage Example
import { createOrUpdateUser } from "@codeflash-ai/common"
Best Practices
- Always build the common package after making changes
- 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
# Publish common package to npm
cd common
npm run build
npm publish