Minimal Next.js App Router starter wired up with Chakra UI.
- Node.js 20.9.0 or newer
- Yarn
yarn install
yarn devLanify now supports manual background removal for uploaded profile photos.
The current flow is:
- upload a profile photo
- the image editor opens automatically
- click
Remove Background - the app posts the original image to
POST /api/remove-background - the Next.js route forwards the image to the internal
rembgservice - the transparent PNG is stored in
avatarTransparentUrl
The original upload remains in avatarUrl, so the app can always fall back safely if background removal fails.
Create a local env file from the example and point it at the rembg service you want the Next.js server to use:
cp .env.example .env.localDefault:
REMBG_SERVICE_URL=http://localhost:7000When running inside Docker Compose, the web container uses http://rembg:7000.
The repo includes:
Dockerfilefor the Next.js apprembg-service/Dockerfilefor the PythonrembgAPIdocker-compose.ymlfor local multi-container development
Build and start both services with:
docker compose up --buildFor day-to-day development, the web service mounts only src and a few Next.js config files. The rest of the app, including node_modules, stays inside the container image, which avoids the slow full-repo bind mount and the expensive node_modules volume population step.
If you change package.json or yarn.lock, rebuild the image:
docker compose up --buildPorts:
3000for the Next.js app7000is only exposed on the internal Compose network forrembg
The rembg service is intentionally private behind the Next.js route so the browser never talks to it directly.
