An open API service indexing awesome lists of open source software.

https://github.com/codenlighten/lumen-sdk


https://github.com/codenlighten/lumen-sdk

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# ๐ŸŒ‰ Lumen SDK & Project Factory

[![License: Proprietary](https://img.shields.io/badge/License-Proprietary-red.svg)](./LICENSE)
[![Node.js](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
[![Lumen Bridge](https://img.shields.io/badge/Powered%20by-Lumen%20Bridge-blue)](https://lumenbridge.codenlighten.org)
[![Patents Pending](https://img.shields.io/badge/Patents-Pending-orange.svg)](./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.*

[![Lumen Bridge](https://img.shields.io/badge/Try-Lumen%20Bridge-blue?style=for-the-badge)](https://lumenbridge.codenlighten.org)