AI-powered image generation app with TRMNL e-ink display sync. Generate stunning images using OpenAI's DALL-E 3 and display them on your TRMNL device.
- AI Image Generation - Create images using OpenAI DALL-E 3 with natural language prompts
- Voice Input - Speak your prompts using Web Speech API (supports English & Chinese)
- TRMNL Sync - Push generated images to TRMNL e-ink displays
- User Authentication - Secure JWT-based authentication with email/password
- Multi-User Support - Each user has their own TRMNL webhook and device settings
- Dark/Light Theme - Toggle between themes with persistent preference
- Bilingual UI - Full English and Chinese language support
- Mobile Responsive - Optimized for all screen sizes
| Chat Interface | Settings Page |
|---|---|
| Generate images with text or voice | Configure your TRMNL device |
- Bun v1.0+
- OpenAI API Key
- TRMNL Device (optional, for e-ink display sync)
# Clone the repository
git clone https://github.com/kenken64/Promptink.git
cd Promptink
# Install dependencies
./scripts/install.sh
# Configure environment
cp .env.example backend/.env
# Edit backend/.env with your API keysEdit backend/.env:
# Required
OPENAI_API_KEY=sk-your-openai-api-key
JWT_SECRET=your-secure-random-string
# Optional (for TRMNL admin operations)
TRMNL_USER_API_KEY=your-trmnl-user-api-key
TRMNL_CUSTOM_PLUGIN_UUID=your-plugin-uuidNote: TRMNL device settings (Device API Key, MAC Address) are now configured per-user in the Settings page.
# Start all services
./scripts/start.sh
# Check status
./scripts/status.sh
# Stop all services
./scripts/stop.shServices:
- Main App: http://localhost:3000
- TRMNL Plugin Preview: http://localhost:4567
┌─────────────────────────────────────────────────────────────────┐
│ PromptInk │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │
│ │ Frontend │◄──►│ Backend │◄──►│ OpenAI DALL-E │ │
│ │ (React) │ │ (Bun) │ │ │ │
│ └──────────────┘ └──────┬───────┘ └──────────────────┘ │
│ │ │
│ ┌──────┴───────┐ │
│ │ SQLite DB │ │
│ │ - Users │ │
│ │ - Images │ │
│ │ - Settings │ │
│ └──────┬───────┘ │
│ │ │
│ /api/trmnl/webhook/:userId │
│ │ │
│ ┌──────┴───────┐ │
│ │ TRMNL │ │
│ │ Device │ │
│ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
PromptInk/
├── backend/ # Bun API server
│ ├── src/
│ │ ├── config/ # Environment configuration
│ │ ├── db/ # SQLite database & queries
│ │ ├── middleware/ # Auth middleware
│ │ ├── routes/ # API endpoints
│ │ ├── services/ # Business logic
│ │ └── utils/ # Utilities
│ └── package.json
│
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── pages/ # Page components
│ │ └── lib/ # Utilities
│ └── package.json
│
├── peekachoo-trmnl/ # TRMNL plugin
│ └── src/ # Liquid templates
│
├── scripts/ # Management scripts
├── Dockerfile # Docker deployment
├── railway.toml # Railway deployment config
└── ARCHITECTURE.md # Detailed architecture docs
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login user |
| GET | /api/auth/me |
Get current user |
| POST | /api/auth/logout |
Logout user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/images/generate |
Generate image from prompt |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/sync/trmnl |
Sync image to TRMNL (auth required) |
| GET | /api/trmnl/webhook/:userId |
Webhook for TRMNL polling |
| GET | /api/sync/status |
Get sync status |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/settings |
Get user settings |
| PUT | /api/settings |
Update user settings |
- Register/Login to PromptInk
- Go to Settings (gear icon)
- Enter your TRMNL Device API Key and MAC Address
- Copy your webhook URL:
https://your-domain/api/trmnl/webhook/{userId} - Configure your TRMNL plugin to poll this URL
cd peekachoo-trmnl
trmnlp login # First time only
trmnlp push # Upload to TRMNL server- Connect your GitHub repo to Railway
- Set environment variables in Railway dashboard:
JWT_SECRETOPENAI_API_KEYTRMNL_USER_API_KEY(optional)
- Add a volume mounted at
/app/datafor SQLite persistence - Deploy
docker build -t promptink .
docker run -p 3000:3000 \
-e JWT_SECRET=your-secret \
-e OPENAI_API_KEY=sk-... \
-v promptink-data:/app/data \
promptink| Layer | Technology |
|---|---|
| Runtime | Bun |
| Backend | Bun.serve + SQLite |
| Frontend | React 19 + Tailwind CSS + shadcn/ui |
| Auth | JWT + Argon2id |
| Database | SQLite (bun:sqlite) |
| AI | OpenAI DALL-E 3 |
| E-ink Display | TRMNL |
- Bun v1.0+
- Node.js (for some dev tools)
# Start development servers
./scripts/start.sh
# View logs
tail -f logs/backend.log
# Stop servers
./scripts/stop.shThe frontend is bundled by Bun's built-in HTML import feature. Changes hot-reload automatically.
- Create route file in
backend/src/routes/ - Export routes object
- Import and spread in
backend/src/routes/index.ts
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for DALL-E 3
- TRMNL for e-ink display platform
- shadcn/ui for UI components
- Bun for the runtime
Made with Claude Code