CodeGen Server is a powerful AI-powered code generation API that provides endpoints for AI code template generation, refining prompts, chatting with AI assistants, and managing coding projects.
- Production API: https://codegen-aws.elitedev.tech
- API Documentation: https://codegen-aws.elitedev.tech/api-docs
- Live Project: https://codegen.elitedev.tech
- 🤖 AI Code Generation: Generate code templates based on prompts
- 💬 AI Chat: Interact with AI assistants for coding help
- 📝 Project Management: Create and organize coding projects
- 📊 Message History: Store and retrieve conversation history
- 🔍 Code Storage: Save and retrieve generated code snippets
The API provides the following main endpoint groups:
/api/v1/ai
: AI-related endpoints for code generation and chatting/api/v1/message
: Message management endpoints/api/v1/project
: Project management endpoints/api/v1/code
: Code snippet management endpoints
For detailed API documentation, visit the API docs.
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: Prisma ORM
- AI Integration: Google Gemini AI
- Documentation: OpenAPI / Swagger
- Node.js 14.x or higher
- pnpm (or npm/yarn)
- Database (configured via Prisma)
-
Clone the repository:
git clone https://github.com/AshutoshDM1/CodeGen-Server.git cd CodeGen-Server
-
Install dependencies:
pnpm install
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration
-
Generate Prisma client:
pnpx prisma generate
-
Run database migrations:
pnpx prisma migrate deploy
-
Build the application:
pnpm build
-
Start the server:
pnpm start
For development mode with hot-reloading:
pnpm dev
Create a .env
file with the following variables:
# Server
PORT=4000
# Database
DATABASE_URL="your-database-url"
# AI Configuration
GEMINI_API_KEY="your-gemini-api-key"
# CORS origins (comma-separated)
ALLOWED_ORIGINS="http://localhost:3000,https://yourdomain.com"
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature
- Commit your changes:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature/my-feature
- Submit a pull request
Please make sure to update tests as appropriate and follow the code style of the project.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please open an issue on this repository or contact the maintainers directly.
Made with ❤️ by the Ashutosh