Skip to content

Commit ec4053b

Browse files
authored
Merge pull request #7 from CodePapi/fe-modularization
Fe modularization
2 parents be5b71e + 12b6eb5 commit ec4053b

File tree

4 files changed

+129
-179
lines changed

4 files changed

+129
-179
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ count = count + 1;
145145
count = count + 1;
146146

147147
// ✅ Good: Complex logic gets a comment block
148-
// Detect migration presets by checking if language ID includes a dash
149-
// e.g., "react-ts" or "react-vue" are migrations
150-
const isMigration = sourceLang.includes('-');
148+
// Convert language IDs for the AI engine
149+
const languageId = mapLanguageForAI(sourceLang);
151150
```
152151

153152
### React Components
@@ -356,12 +355,12 @@ npm run test:cov # With coverage
356355

357356
## Questions?
358357

359-
- **GitHub Issues:** For bugs and features
360-
- **GitHub Discussions:** For questions
361-
- **Email:** [contact@example.com] for sensitive topics
358+
- **GitHub Issues:** For bugs and feature requests
359+
- **GitHub Discussions:** For questions and ideas
360+
- **Email:** [contact@example.com] for other topics
362361

363362
---
364363

365364
**Thank you for contributing to CodePapi AI!** 🎉
366365

367-
Your efforts help make this tool better for everyone. We appreciate your time and effort!
366+
Your help improving this hobby project is much appreciated. Whether it's bug fixes, documentation, or new ideas, every contribution matters!

README.md

Lines changed: 85 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,49 @@
11
# CodePapi AI ⚡
22

3-
> **Transform your code instantly with local AI power.** No cloud, no data leaks—just blazing-fast code translation, migration, and debugging on your machine.
3+
> **A local AI-powered code companion.** Keep your code on your machine while exploring code translation, reviews, and debugging with LLMs. A learning project exploring local AI integration in developer workflows.
44
55
![License](https://img.shields.io/badge/license-MIT-blue.svg)
6+
![Status](https://img.shields.io/badge/status-experimental-yellow.svg)
67
![Ollama](https://img.shields.io/badge/AI-Ollama-orange.svg)
78
![React](https://img.shields.io/badge/Frontend-React-61DAFB.svg)
89
![NestJS](https://img.shields.io/badge/Backend-NestJS-E0234E.svg)
9-
![Biome](https://img.shields.io/badge/Linter-Biome-60a5fa.svg)
1010

1111
---
1212

1313
## What is CodePapi AI?
1414

15-
CodePapi AI is a professional, privacy-focused developer tool that brings the power of Large Language Models (LLMs) directly to your local development workflow. Whether you're translating code between languages, migrating frameworks, reviewing for security issues, or debugging complex logic—all your code stays on your machine.
15+
CodePapi AI is an experimental, open-source project that brings Large Language Models (LLMs) to your local development environment. Translate code between languages, get AI-powered code reviews, and explore debugging workflows—all without sending your code to external services.
16+
17+
**Note:** This is a hobby/learning project. While functional, it's not optimized for production use. Performance depends heavily on your hardware and model choice. Expect AI responses to take 10-60+ seconds depending on code size and hardware.
1618

1719
### Why CodePapi AI?
1820

19-
**100% Private** — Your code never leaves your machine
20-
**Lightning Fast**Runs locally on your hardware
21-
**Free** — MIT licensed, fully open-source
22-
**Extensible**Add languages, frameworks, and custom prompts easily
21+
**Private** — Your code stays on your machine (no cloud uploads)
22+
**Open-Source**Inspect the full codebase
23+
**Free** — MIT licensed, no subscriptions
24+
**Learning Tool**Explore local LLM integration in practice
2325

2426
---
2527

26-
## Core Features
28+
## ✨ Features
2729

28-
#### 🔄 Smart Code Translation
29-
Effortlessly convert code between 10+ languages including JavaScript, TypeScript, Python, Go, Rust, Java, and more. The system is flexible enough to support any language you add.
30+
#### 🔄 Code Translation
31+
Convert code between supported languages: JavaScript, TypeScript, Python, Go, Rust, Java, C++, PHP, Ruby, Swift, and C#. Quality depends on model accuracy and code complexity.
3032

31-
#### 🚀 Framework Migration Engine
32-
Pre-built, expert-level migration presets for common transformations:
33-
- React Class Components → React Functional Components (with Hooks)
34-
- JavaScript → TypeScript
35-
- CSS → Tailwind CSS
36-
- React → Vue.js
33+
#### 🔍 Code Review
34+
Get AI-generated feedback on:
35+
- Performance optimization ideas
36+
- Potential security issues
37+
- Code quality observations
38+
- Best practice suggestions
3739

38-
#### 🔍 Deep Code Review
39-
Get AI-driven analysis of your code covering:
40-
- Performance optimization opportunities
41-
- Security vulnerabilities
42-
- Best practice violations
43-
- Code quality improvements
40+
**Note:** AI suggestions should be reviewed carefully and aren't a substitute for human code review.
4441

45-
#### 🐞 Interactive Bug Fixer
46-
Fix bugs with confidence. The **Diff View** shows exactly what the AI changed, side-by-side comparison so you understand every modification before accepting.
42+
#### 🐞 Bug Detection
43+
The **Diff View** shows AI-suggested fixes side-by-side with original code. Always test fixes before committing.
4744

48-
#### 🔒 Air-Gapped Privacy
49-
Powered by **Qwen2.5-Coder** (1.5GB model) running locally through **Ollama**. Your code never touches the internet.
45+
#### 🔒 Local Privacy
46+
Code processing happens locally using Qwen2.5-Coder via Ollama—nothing leaves your machine.
5047

5148
---
5249

@@ -71,18 +68,20 @@ docker-compose up -d
7168

7269
### First Launch Setup
7370

74-
> ⚠️ **Important:** The first startup requires downloading AI models. Ensure you have a stable internet connection.
71+
> ⚠️ **First Run:** The first startup downloads the AI model (~1.5GB). Ensure stable internet and available disk space.
7572
76-
After starting the containers, pull the required models:
73+
After starting the containers, pull the required model:
7774

7875
```bash
79-
# Pull Qwen2.5 Coder (primary model, ~1.5GB)
8076
docker exec ollama ollama pull qwen2.5-coder:1.5b
81-
82-
# Pull Phi-3 Mini (optional, ~2.3GB alternative model)
83-
docker exec ollama ollama pull phi3:mini
8477
```
8578

79+
**Initial Request Times:** Expect 10-90 seconds for initial responses depending on:
80+
- Your CPU/GPU specs
81+
- Code size
82+
- Available system memory
83+
- Background processes
84+
8685
Once the models are downloaded and containers are running:
8786
- **🖥️ Frontend:** Open http://localhost in your browser
8887
- **🔌 API:** Backend runs at http://localhost:3000
@@ -92,14 +91,19 @@ Once the models are downloaded and containers are running:
9291

9392
## 💻 How to Use
9493

95-
1. **Paste or type your code** into the left editor
96-
2. **Select a source language/framework** from the dropdown
97-
3. **Choose your action:**
94+
1. Paste or type code into the left editor
95+
2. Select a source language
96+
3. Choose an action:
9897
- **Translate:** Pick a target language
99-
- **Review:** Get AI analysis (no target needed)
100-
- **Check Bugs:** See a diff view of fixes
101-
4. **Click "Run AI"** and watch the magic happen
102-
5. **Copy the result** or download your transformed code
98+
- **Review:** Get feedback on code
99+
- **Check Bugs:** See suggested fixes
100+
4. Click "Run AI" and wait for results
101+
5. Copy or review the output
102+
103+
**Tips:**
104+
- Smaller code snippets get faster responses
105+
- Review AI suggestions before using them in production
106+
- Results vary based on code complexity and quality
103107

104108
---
105109

@@ -120,13 +124,13 @@ Once the models are downloaded and containers are running:
120124

121125
### Adding New Languages
122126

123-
Want to support more programming languages or migration presets? It's easy!
127+
Want to support more programming languages? It's easy!
124128

125129
See the **[Frontend Documentation](./frontend/README.md)** for detailed instructions on adding languages to `frontend/src/constants/languages.ts`.
126130

127131
### Code Quality
128132

129-
We use **Biome** for lightning-fast linting and formatting. Before submitting a PR, run:
133+
We use **Biome** for linting and formatting. Before submitting a PR, run:
130134

131135
```bash
132136
npm run biome:lint # Check for issues
@@ -140,7 +144,7 @@ codepapi-ai/
140144
├── backend/ # NestJS API server
141145
│ └── src/converter/ # Code conversion logic
142146
├── frontend/ # React UI application
143-
│ └── src/constants/ # Language & migration definitions
147+
│ └── src/constants/ # Language definitions
144148
├── docker-compose.yml # Full stack orchestration
145149
└── README.md # This file
146150
```
@@ -162,7 +166,13 @@ Violations will not be tolerated and may result in removal from the project.
162166

163167
## 🤝 Contributing Guidelines
164168

165-
We welcome contributions from the community! Whether it's bug fixes, features, documentation, or translations, your help makes CodePapi AI better.
169+
We welcome contributions! This is a learning/hobby project, so contributions can range from bug fixes and feature ideas to documentation and testing.
170+
171+
### Important Notes
172+
173+
- **This is experimental code.** Don't expect production-grade stability
174+
- **Limitations are intentional** — helps us learn and improve
175+
- **AI suggestions need review** — this tool augments, not replaces, human developers
166176

167177
### Getting Started
168178

@@ -259,7 +269,7 @@ Before submitting a PR, ensure:
259269
While formal unit tests are encouraged:
260270
- **Manual testing** is acceptable for UI changes
261271
- **Test in Docker** to ensure consistency across environments
262-
- **Test with the Qwen2.5-Coder model** (not a different LLM)
272+
- **Test with the Qwen2.5-Coder model**
263273
- **Document test steps** in your PR
264274

265275
### Review Process
@@ -276,10 +286,10 @@ While formal unit tests are encouraged:
276286
- 🧪 **Testing:** Test coverage and edge cases
277287
- 📚 **Documentation:** Guides, tutorials, examples
278288
- 🐛 **Bug fixes:** Active issues on GitHub
279-
-**Features:** Language support, migration presets, new modes
289+
-**Features:** Language support, new modes
280290
- 🎨 **UI/UX:** Design improvements, accessibility
281291

282-
See the [Issues page](https://github.com/yourusername/codepapi-ai/issues) for tasks labeled `good first issue` and `help wanted`.
292+
See the [Issues page](https://github.com/codepapi/codepapi-ai/issues) for tasks labeled `good first issue` and `help wanted`.
283293

284294
### Recognition
285295

@@ -291,42 +301,37 @@ See the [Issues page](https://github.com/yourusername/codepapi-ai/issues) for ta
291301

292302
## 🤖 Responsible AI Ethics
293303

294-
As an AI-powered tool, CodePapi AI follows these ethical principles:
304+
As an experimental AI project, CodePapi AI follows responsible practices:
295305

296-
### Privacy First
297-
- **No telemetry:** We don't track usage or collect analytics
298-
- **Local processing:** All code processing happens on your machine
299-
- **No training data:** Your code is never used to train or improve models
300-
- **GDPR compliant:** Full control over your data
306+
### Privacy
307+
- **No telemetry:** We don't collect usage analytics
308+
- **Local processing:** All code stays on your machine
309+
- **No training:** Your code never trains models
301310

302311
### Transparency
303-
- **Open source:** Full code transparency — inspect everything
304-
- **Model disclosure:** We explicitly state which LLM is used (Phi-3 Mini)
305-
- **Limitations:** We're honest about what the AI can and cannot do
306-
- **Attribution:** AI improvements are documented and credited
307-
308-
### Responsible Use Guidelines
309-
310-
**Do:**
311-
- ✅ Use CodePapi AI for legitimate code improvement
312-
- ✅ Review AI suggestions before implementing
313-
- ✅ Report security issues responsibly
314-
- ✅ Contribute improvements back to the community
315-
316-
**Don't:**
317-
- ❌ Use for malicious code generation
318-
- ❌ Bypass security reviews using AI
319-
- ❌ Rely solely on AI without code review
320-
- ❌ Claim AI-generated code as entirely your own without attribution
321-
322-
### Security Considerations
323-
- Always review code generated by AI before committing
324-
- Run security scanners on translated/migrated code
325-
- Test thoroughly in safe environments first
326-
- Report any security concerns to [security@example.com]
312+
- **Open source:** Full code inspection available
313+
- **Clear limitations:** We're honest about what works and what doesn't
314+
- **No magic:** It's an AI assistant, not a replacement for human judgment
315+
316+
### Use Responsibly
317+
- Review all AI suggestions before implementing
318+
- Don't rely solely on AI output for security-critical code
319+
- Test thoroughly in your environment
320+
- Report security issues privately
327321

328322
---
329323

324+
## 🚨 Limitations & Known Issues
325+
326+
This is an experimental project with real limitations:
327+
328+
- **Speed:** Not fast. Responses take 10-90+ seconds per request
329+
- **Quality:** AI output varies. Some translations work well, others need manual fixes
330+
- **Hardware-dependent:** Performance heavily depends on your CPU/GPU and available RAM
331+
- **Model limitations:** Qwen2.5-Coder is a smaller model; results aren't comparable to larger proprietary models
332+
- **Error handling:** Limited error checking and validation
333+
- **Production use:** Not suitable for mission-critical workflows without thorough testing
334+
330335
## 🚨 Reporting Issues & Security
331336

332337
### Bug Reports
@@ -371,16 +376,16 @@ Distributed under the **MIT License**. See [LICENSE](./LICENSE) for details.
371376

372377
## 💬 Support
373378

374-
- **Issues:** Report bugs on [GitHub Issues](https://github.com/yourusername/codepapi-ai/issues)
375-
- **Discussions:** Ask questions in [GitHub Discussions](https://github.com/yourusername/codepapi-ai/discussions)
379+
- **Issues:** Report bugs on [GitHub Issues](https://github.com/codepapi/codepapi-ai/issues)
380+
- **Discussions:** Ask questions in [GitHub Discussions](https://github.com/codepapi/codepapi-ai/discussions)
376381
- **Docs:** Full documentation in [README files](./frontend/README.md)
377382

378383
---
379384

380385
<div align="center">
381386

382-
**Made with ❤️ for developers who value privacy and speed**
387+
**A learning project exploring local LLMs in development workflows**
383388

384-
[⭐ Star us on GitHub](https://github.com/yourusername/codepapi-ai)[🐛 Report a Bug](https://github.com/yourusername/codepapi-ai/issues)[💡 Suggest a Feature](https://github.com/yourusername/codepapi-ai/discussions)
389+
[⭐ Star us on GitHub](https://github.com/codepapi/codepapi-ai)[🐛 Report a Bug](https://github.com/codepapi/codepapi-ai/issues)[💡 Suggest a Feature](https://github.com/codepapi/codepapi-ai/discussions)
385390

386391
</div>

0 commit comments

Comments
 (0)