mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 19:39:40 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| .env.example | ||
| docker-compose.yml | ||
| Dockerfile | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Memoro Admin API
Backend API service for Memoro Admin with AI image generation via Replicate.
🚀 Quick Start
Prerequisites
- Node.js 20+
- Replicate API Token (get it from https://replicate.com/account/api-tokens)
Installation
- Install dependencies:
cd services/admin-api
npm install
- Configure environment:
cp .env.example .env
# Edit .env and add your REPLICATE_API_TOKEN
- Run in development:
npm run dev
The API will be available at http://localhost:3001
📝 API Endpoints
Health Check
GET /health
# No auth required
Test Replicate Configuration
GET /api/personas/test?apiKey=your-api-key
Generate Persona Images
POST /api/personas/generate-images
Headers:
X-API-Key: your-api-key
Body:
{
"personaData": {
"name": "Thomas Bauer",
"appearance": {
"prompt": "45 year old German craftsman...",
"description": "..."
}
},
"style": "portrait", // portrait | professional | casual | lifestyle
"count": 4 // 1-4 images
}
Get Available Styles
GET /api/personas/styles?apiKey=your-api-key
🐳 Docker Deployment
Using Docker Compose:
# Build and run
docker-compose up -d
# View logs
docker-compose logs -f admin-api
Using Docker directly:
# Build image
docker build -t memoro-admin-api .
# Run container
docker run -d \
-p 3001:3001 \
-e REPLICATE_API_TOKEN=your_token \
-e API_KEY=your_api_key \
-v $(pwd)/storage:/app/storage \
memoro-admin-api
🔧 Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
PORT |
API server port | 3001 |
REPLICATE_API_TOKEN |
Your Replicate API token | Required |
API_KEY |
API authentication key | memoro-admin-api-key-2025 |
CORS_ORIGIN |
Allowed CORS origin | http://localhost:4321 |
STORAGE_PATH |
Local image storage path | ./storage/images |
LOG_LEVEL |
Logging level | debug |
💰 Cost Estimation
- SDXL Model: ~$0.0023 per image
- 4 images per persona: ~$0.01
- 100 personas: ~$1.00
📁 Project Structure
admin-api/
├── src/
│ ├── index.ts # Main server file
│ ├── routes/
│ │ └── personas.route.ts # Personas endpoints
│ ├── services/
│ │ └── replicate.service.ts # Replicate integration
│ └── types/
│ └── persona.types.ts # TypeScript types
├── storage/ # Generated images storage
├── docker-compose.yml # Docker orchestration
├── Dockerfile # Container definition
└── package.json # Dependencies
🧪 Testing
Test API locally:
# 1. Check health
curl http://localhost:3001/health
# 2. Test Replicate configuration
curl "http://localhost:3001/api/personas/test?apiKey=memoro-admin-api-key-2025"
# 3. Generate test image
curl -X POST http://localhost:3001/api/personas/generate-images \
-H "X-API-Key: memoro-admin-api-key-2025" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Professional portrait of a 45 year old German craftsman",
"style": "portrait",
"count": 1
}'
🚢 Production Deployment (Hetzner + Coolify)
- Push to GitHub
- Connect repository in Coolify
- Set environment variables
- Deploy as Docker Compose stack
- Configure custom domain & SSL
📄 License
Private - Memoro Internal Use Only