https://github.com/codenlighten/lumen-sdk
https://github.com/codenlighten/lumen-sdk
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codenlighten/lumen-sdk
- Owner: codenlighten
- License: other
- Created: 2025-11-27T16:12:24.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-29T19:59:53.000Z (8 months ago)
- Last Synced: 2025-12-01T23:57:47.991Z (7 months ago)
- Language: JavaScript
- Size: 54.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Lumen SDK & Project Factory
[](./LICENSE)
[](https://nodejs.org/)
[](https://lumenbridge.codenlighten.org)
[](./LICENSE)
**Build entire production-ready applications from natural language descriptions using AI agents.**
The Lumen SDK provides a powerful project factory that transforms your ideas into fully-structured, deployable codebases through an intelligent multi-agent workflow.
---
## ๐ What Is This?
This repository contains:
1. **LumenSDK.js** - A clean JavaScript SDK for interacting with [Lumen Bridge](https://lumenbridge.codenlighten.org), a self-aware agent platform
2. **ProjectBuilder** - An intelligent project factory that uses AI agents to architect, plan, and generate complete applications
3. **Example Projects** - Real, working applications generated entirely by AI agents
### The Magic
```javascript
const builder = new ProjectBuilder({
userId: "your-user-id",
outputDir: "./my-awesome-app"
});
await builder.build("Create a real-time chat app with end-to-end encryption using ECIES");
```
**That's it.** The system will:
- โจ Improve and clarify your prompt
- ๐๏ธ Design the complete architecture
- ๐ Create a chronological build plan
- ๐พ Generate production-ready code files
- ๐ง Set up dependencies and configuration
---
## ๐ฏ Features
### Intelligent Multi-Agent Workflow
```
Your Idea โ PromptImprover โ ProjectArchitect โ ChronosPlanner โ CodeGenerator โ ๐ฆ Complete Project
```
| Agent | Purpose |
|-------|---------|
| **PromptImprover** | Analyzes your idea, identifies core features, suggests tech stack, highlights challenges |
| **ProjectArchitect** | Designs file structure, defines modules, specifies dependencies, plans data flow |
| **ChronosPlanner** | Creates ordered build steps, handles dependencies, sequences file generation |
| **CodeGenerator** | Produces production-ready code with best practices, tests, and documentation |
### What Makes It Powerful
- ๐ง **Context-Aware**: Understands complex, multi-paragraph requirements
- ๐๏ธ **Architecture-First**: Plans before coding (files, modules, dependencies)
- ๐ **Production-Ready**: Generates real, working code with error handling
- ๐งช **Test-Included**: Unit tests generated alongside implementation
- ๐ **Reusable**: One class, infinite projects
- ๐จ **Smart Patterns**: Follows best practices for each technology
- ๐ฆ **Dependency Management**: Automatically identifies and lists required packages
---
## ๐ฆ Installation
```bash
# Clone the repository
git clone https://github.com/codenlighten/lumen-sdk.git
cd lumen-sdk
# Install dependencies
npm install
# Add your Lumen Bridge user ID to BuildProject.js
```
### Prerequisites
- Node.js v20+ (for native fetch support)
- A Lumen Bridge account ([register here](https://lumenbridge.codenlighten.org))
- Your Lumen Bridge `userId`
---
## ๐ฎ Quick Start
### 1. Basic Usage
```javascript
import { ProjectBuilder } from './BuildProject.js';
const builder = new ProjectBuilder({
userId: "user-dev-01",
outputDir: "./my-project"
});
const projectIdea = `
Create a task management API with user authentication,
project workspaces, and real-time notifications.
`;
const result = await builder.build(projectIdea);
console.log(`Generated ${result.architecture.fileTree.length} files!`);
```
### 2. Run the Example
```bash
# Edit BuildProject.js to set your userId
# Then run:
npm run build
```
This will generate a complete project in the specified output directory.
---
## ๐๏ธ Example Projects
### 1. ECIES Chat Application
**Input**: "An end-to-end encrypted chat app using ECIES and Bitcoin SV extended keys"
**Generated**:
- 17 files across frontend/backend
- User identity with BIP32 xpub
- ECIES message encryption
- WebSocket real-time delivery
- Multi-device support
- Voice message architecture
๐ [`ecies-chat-app/`](./ecies-chat-app)
### 2. AI Legal Document Analysis Platform
**Input**: A complex, paragraph-length description with 30+ requirements
**Generated**:
- 29 files with TypeScript
- OpenAI GPT-4 integration
- Real-time collaboration (Socket.io)
- OAuth2 + JWT authentication
- Role-based access control
- Document upload with OCR
- Risk scoring visualization
- Multi-tenant architecture
- Stripe billing integration
- 509 lines of production code
๐ [`complex-ai-project/`](./complex-ai-project)
---
## ๐ง How It Works
### The Four-Phase Workflow
#### Phase 0: Prompt Improvement
```
Your idea โ AI analysis โ Enhanced technical specification
```
The **PromptImprover** agent:
- Identifies core features
- Suggests appropriate tech stack
- Highlights architectural considerations
- Clarifies ambiguous requirements
#### Phase 1: Architecture Design
```
Enhanced spec โ System design โ File structure + Modules
```
The **ProjectArchitect** agent:
- Designs complete file tree
- Defines module interfaces (inputs/outputs)
- Specifies dependencies
- Plans data flow
#### Phase 2: Build Planning
```
Architecture โ Ordered steps โ Executable plan
```
The **ChronosPlanner** agent:
- Creates chronological steps
- Handles dependency ordering
- Generates install commands
- Sequences file creation
#### Phase 3: Code Generation
```
Build plan โ Code generation โ Working files
```
The **CodeGenerator** executes:
- Creates directories
- Generates code files
- Writes configuration
- Sets up package.json
### Architecture Diagram
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ProjectBuilder โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ Prompt โโ โ Project โโ โ Chronos โ โ
โ โ Improver โ โ Architect โ โ Planner โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ Code โ โ
โ โ Generator โ โ
โ โโโโโโโโโโโโโโโโ โ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
๐ฆ Complete Project
```
---
## ๐จ Advanced Usage
### Custom Agent Configuration
```javascript
const builder = new ProjectBuilder({
userId: "your-id",
outputDir: "./output"
});
// Agents are registered automatically
// You can also register custom agents via LumenSDK
await builder.bridge.registerAgent(
"MyCustomAgent",
"Specialized for XYZ tasks",
"Your custom prompt here..."
);
```
### Reusing the Builder
```javascript
const builder = new ProjectBuilder({ userId: "your-id" });
// Build multiple projects
await builder.build("Create a blog platform");
await builder.build("Create an e-commerce API");
await builder.build("Create a real-time dashboard");
```
### Accessing Build Results
```javascript
const result = await builder.build(projectIdea);
console.log(result.improved); // Enhanced prompt details
console.log(result.architecture); // File tree, modules, dependencies
console.log(result.buildSteps); // Execution steps
console.log(result.outputDir); // Where files were created
```
---
## ๐ LumenSDK Reference
### Core Methods
```javascript
import { LumenBridge } from './LumenSDK.js';
const bridge = new LumenBridge({
userId: "your-user-id",
baseUrl: "https://lumenbridge.codenlighten.org" // optional
});
// System Agents
await bridge.terminal(task, shell);
await bridge.generateCode(prompt, language, framework);
await bridge.generateSchema(userPrompt);
// User Agent Management
await bridge.registerAgent(name, description, prompt, metadata);
await bridge.updateAgent(name, updates);
await bridge.invokeUserAgent(agentName, context);
await bridge.getMyAgents();
await bridge.deleteAgent(agentName);
```
### Agent Responses
All agents return cryptographically signed responses with:
- โ๏ธ BSV-ECDSA-DER signatures
- ๐ LLM usage metrics (tokens, model, elapsed time)
- ๐ Verifiable authenticity
---
## ๐ Real-World Examples
### Example 1: Microservice API
```javascript
const result = await builder.build(`
Create a RESTful microservice for user management with:
- PostgreSQL database
- JWT authentication
- Role-based permissions
- Password reset via email
- Rate limiting
- Docker deployment
`);
// Generated: 15 files, Express API, complete auth system
```
### Example 2: React Dashboard
```javascript
const result = await builder.build(`
Build a React dashboard with:
- TypeScript
- Chart.js visualizations
- Real-time updates via WebSocket
- Dark mode
- Responsive design
- Redux state management
`);
// Generated: 23 files, complete React app with state management
```
### Example 3: Blockchain Integration
```javascript
const result = await builder.build(`
Create a Bitcoin SV wallet interface with:
- Key generation (BIP32/BIP39)
- Transaction building
- UTXO management
- BSV price tracking
- Transaction history
- QR code support
`);
// Generated: 18 files, crypto utilities, wallet logic
```
---
## ๐ What Gets Generated?
### Typical Project Structure
```
your-project/
โโโ src/ # Frontend source
โ โโโ components/ # React components
โ โโโ services/ # API clients
โ โโโ utils/ # Helper functions
โ โโโ hooks/ # Custom React hooks
โโโ backend/ # Backend source
โ โโโ controllers/ # Request handlers
โ โโโ models/ # Database models
โ โโโ routes/ # API routes
โ โโโ services/ # Business logic
โ โโโ middleware/ # Express middleware
โ โโโ config/ # Configuration
โโโ public/ # Static assets
โโโ tests/ # Unit tests
โโโ package.json # Dependencies
โโโ README.md # Documentation
โโโ .env.example # Environment template
```
### Code Quality
Generated code includes:
- โ
Input validation
- โ
Error handling
- โ
Try/catch blocks
- โ
JSDoc comments
- โ
Type safety (when using TypeScript)
- โ
Unit test scaffolding
- โ
Best practices for chosen framework
---
## ๐ค Supported Technologies
### Backend
- Node.js / Express
- Python / Django / Flask
- MongoDB / PostgreSQL / MySQL
- Redis / Bull (job queues)
- WebSocket / Socket.io
- GraphQL / REST APIs
### Frontend
- React / TypeScript
- Vue.js / Angular
- Next.js / Vite
- Redux / Context API
- Tailwind CSS
- Chart.js / D3.js
### DevOps & Tools
- Docker / docker-compose
- GitHub Actions (CI/CD)
- Jest / Mocha (testing)
- ESLint / Prettier
- Nginx / Apache
### Integrations
- OpenAI API
- Stripe payments
- SendGrid emails
- AWS S3
- OAuth2 providers
- BSV blockchain
---
## ๐ Documentation
### Configuration Options
```javascript
new ProjectBuilder({
userId: string, // Required: Your Lumen Bridge user ID
outputDir: string, // Optional: Default "./generated-project"
})
```
### Environment Variables
Create a `.env` file:
```env
LUMEN_USER_ID=your-user-id
OPENAI_API_KEY=sk-... # If using OpenAI features
```
---
## ๐ฏ Use Cases
### Perfect For:
- ๐ **Rapid Prototyping**: Go from idea to working code in minutes
- ๐๏ธ **Learning**: See how complete applications are structured
- ๐ก **Exploration**: Try different architectures without manual coding
- ๐ **Boilerplate**: Generate starter projects with best practices
- ๐ฌ **Experimentation**: Test architectural concepts quickly
- ๐ **Documentation**: Generate well-documented code examples
### Not Meant For:
- Production deployment without review
- Mission-critical systems without testing
- Replacing software engineering expertise
- Legal/medical/financial advice in generated code
---
## ๐ ๏ธ Troubleshooting
### Common Issues
**Error: "Agent not found"**
```javascript
// Solution: Agents are auto-registered on first build
// If error persists, try:
await builder.registerAgents();
```
**Error: "MODULE_NOT_FOUND"**
```bash
# Ensure Node.js v20+
node --version
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
```
**Error: "Invalid user ID"**
```javascript
// Register at https://lumenbridge.codenlighten.org
// Get your userId from the dashboard
```
---
## ๐ค Contributing
Contributions welcome! This is an experimental project showcasing AI-powered code generation.
### Ways to Contribute:
1. ๐ Report bugs or issues
2. ๐ก Suggest new agent types
3. ๐ Improve documentation
4. ๐จ Share generated projects
5. ๐ง Enhance the SDK
---
## ๐ License
**Proprietary License** - All Rights Reserved
This software contains proprietary information and trade secrets. Patents pending.
See [LICENSE](LICENSE) file for complete terms and restrictions.
For licensing inquiries, contact via GitHub or Lumen Bridge.
---
## ๐ Acknowledgments
- **Lumen Bridge Platform**: Powering the intelligent agent system
- **OpenAI**: GPT-4 model for code generation
- **BSV Blockchain**: For cryptographic primitives and identity
- **SmartLedger**: For inspiration on verifiable systems
---
## ๐ฌ Contact & Author
### ๐จโ๐ป Author
**Gregory Ward (CodenLighten)**
Chief Development Officer & Co-Founder
[github.com/codenlighten](https://github.com/codenlighten)
**Organizations:**
- [SmartLedger.Technology](https://smartledger.technology)
- [Codenlighten.org](https://codenlighten.org)
**Platform:**
- ๐ [Lumen Bridge Platform](https://lumenbridge.codenlighten.org)
- ๐ง Contact via Lumen Bridge
---
## ๐ Star History
If this project helps you build faster, give it a โญ!
---
## ๐ฎ Roadmap
- [ ] Support for more languages (Python, Go, Rust)
- [ ] Visual architecture diagrams generation
- [ ] Interactive project customization
- [ ] One-click deployment integrations
- [ ] Version control integration
- [ ] Cost estimation for infrastructure
- [ ] Security audit agent
- [ ] Performance optimization suggestions
- [ ] API documentation generation
- [ ] Mobile app generation (React Native)
---
**Built with โค๏ธ using AI Agents**
*Transform ideas into reality, one build at a time.*
[](https://lumenbridge.codenlighten.org)