This Lenny-app is maintained by the ArchiveLabs. which is client app example for Lenny
Turborepofor monorepo management.Nextjsinside Turborepo.Tailwindcssfor styling.Dockerfor deployment and containerization.Nginxfor reverse proxy.
This monorepo contains two Next.js applications:
- Web (
apps/web/) - Main web application - Docs (
apps/docs/) - Documentation site
Each app has its own Dockerfile and runs independently. A single Nginx reverse proxy routes traffic to both apps on separate ports.
- Web: http://localhost:3000/
- Docs: http://localhost:3001/
- Web: http://localhost:8080/
- Docs: http://localhost:8081/
- web - Next.js app running on port 3000 inside container
- docs - Next.js app running on port 3001 inside container
- nginx - Reverse proxy with two server blocks:
- Port 80 → proxies to
web:3000(exposed as host port 8080) - Port 81 → proxies to
docs:3001(exposed as host port 8081)
- Port 80 → proxies to
- Location:
docker/nginx.conf - Purpose: Reverse proxy with two separate server blocks for web and docs apps
- Features:
- Standard proxy headers for proper request forwarding
- WebSocket upgrade support for Next.js hot reload
- Each app served at root path
/on its own port - Debug header
X-Proxyto identify the Nginx instance
Each app has its own optimized multi-stage Dockerfile:
- Web:
apps/web/Dockerfile - Docs:
apps/docs/Dockerfile
-
Install dependencies:
pnpm install
-
Start the development servers:
pnpm run dev
This will start both apps:
- Web: http://localhost:3000/
- Docs: http://localhost:3001/
-
Make sure you have your own Lenny setup running on your machine (installation guide)
git clone git@github.com:ArchiveLabs/lenny.git cd lenny ./run.sh --public --preloadThis will add 800+ books inside your Lenny. Feel free to check the Github Docs for Lenny.
- Docker Engine 20.10+
- Docker Compose v2.0+
Build and start all services (web, docs, and nginx):
docker compose up --buildOr run in detached mode:
docker compose up --build -d# Build all services
docker compose build
# Build specific service
docker compose build web
docker compose build docs# Start all services
docker compose up
# Start in detached mode (background)
docker compose up -d
# Stop all services
docker compose down
# Stop and remove volumes
docker compose down -v# View all logs
docker compose logs
# Follow logs in real-time
docker compose logs -f
# View logs for specific service
docker compose logs web
docker compose logs docs
docker compose logs nginxOnce the containers are running, test the endpoints:
# Test web app
curl http://localhost:8080/
# Test docs app
curl http://localhost:8081/
# Or open in browser
open http://localhost:8080/
open http://localhost:8081/To change the exposed ports, edit compose.yaml:
nginx:
ports:
- "8080:80"
- "8081:81"Make sure you have your own Lenny setup running on your machine (installation guide)
curl -fsSL https://raw.githubusercontent.com/ArchiveLabs/lenny/refs/heads/main/install.sh | sudo shThis will add 800+ books inside your Lenny. Feel free to check the Github Docs for Lenny.
If you want to use the Lenny web app outside the Docker container (for local development), you need to allow local network IP addresses to upload files.
Add the following code inside the is_allowed_uploader function in code/api.py within your Lenny instance:
if client_ip.startswith("172.") or client_ip.startswith("192.168."):
return TrueThis allows upload requests from Docker networks (172.x.x.x) and local networks (192.168.x.x) to bypass the uploader IP restrictions during development.
We're seeking partnerships with libraries who would like to try lending digital resources to their patrons.