3.7 KiB
GreenLens
Expo app for plant scanning, care tracking, billing, and profile management, backed by an Express API.
App development
npm install
npm run start
Backend development
The backend now targets PostgreSQL instead of SQLite.
cd server
npm install
npm run start
Required backend environment:
DATABASE_URLorPOSTGRES_HOST+POSTGRES_PORT+POSTGRES_DB+POSTGRES_USER+POSTGRES_PASSWORDJWT_SECRET
Optional integrations:
OPENAI_API_KEYSTRIPE_SECRET_KEYSTRIPE_PUBLISHABLE_KEYSTRIPE_WEBHOOK_SECRETREVENUECAT_WEBHOOK_SECRETPLANT_IMPORT_ADMIN_KEYMINIO_ENDPOINTMINIO_ACCESS_KEYMINIO_SECRET_KEYMINIO_BUCKETMINIO_PUBLIC_URL
Docker Compose
For backend-only local infrastructure use docker-compose.yml.
For the production-style self-hosted stack with landing page, Caddy, API, PostgreSQL, and MinIO use greenlns-landing/docker-compose.yml.
Server deployment
Run the commands in this section from the repo root on your server:
cd /path/to/GreenLns
Example:
cd /var/www/GreenLns
1. Prepare environment
cp .env.example .env
Then fill at least:
SITE_DOMAINSITE_URLPOSTGRES_PASSWORDJWT_SECRETMINIO_SECRET_KEY- optional:
OPENAI_API_KEY,STRIPE_*,REVENUECAT_*
2. Start the full production stack
docker compose up --build -d
When you run this from the repo root, Docker Compose uses docker-compose.yml.
What gets built:
landingis built from./greenlns-landing/Dockerfileapiis built from./server/Dockerfile
What is not built locally, but pulled as ready-made images:
postgresusespostgres:16-alpineminiousesminio/minio:latestcaddyusescaddy:2.8-alpine
So yes: docker compose up --build -d builds the landing page container and the API container, and it starts PostgreSQL as a container. PostgreSQL is not "built" from your code, it is started from the official Postgres image.
This starts:
caddylandingapipostgresminio
3. Useful server commands
Check running containers:
docker compose ps
Follow all logs:
docker compose logs -f
Follow only API logs:
docker compose logs -f api
Follow only landing logs:
docker compose logs -f landing
Restart one service:
docker compose restart api
docker compose restart landing
Rebuild and restart after code changes:
docker compose up --build -d
Stop the stack:
docker compose down
Stop the stack and remove volumes:
docker compose down -v
4. Health checks after deploy
curl https://greenlenspro.com/health
curl https://greenlenspro.com/
curl https://greenlenspro.com/sitemap.xml
5. Production compose file location
If you want to run the same stack from inside the landing directory instead:
cd greenlns-landing
docker compose up --build -d
In that case Docker Compose uses greenlns-landing/docker-compose.yml.
There, too:
landingis built fromgreenlns-landing/Dockerfileapiis built from../server/Dockerfilepostgres,minio, andcaddyare started from official images
iOS TestFlight
npx eas-cli build:version:set -p ios
npx eas-cli build -p ios --profile production
npx eas-cli submit -p ios --latest