scripts/dev-stack.sh starts everything the app needs locally, in one command:
- An in-memory Redis on port
6379 smartdrop-backendon port4000- This frontend on port
3000
Run it when you work on pages that talk to the backend: /prices, /airdrops,
/webhooks and /alerts. For pages that only use Stellar RPC and Horizon (the
on-chain pages), npm run dev is enough and starts faster.
- Node.js 20+ and npm, with dependencies installed in this repo (
npm ci) smartdrop-backendcloned as a sibling directory (../smartdrop-backend), with its dependencies installedopensslandlsofavailable on yourPATH
No Docker or system Redis install is needed.
npm run dev:stack
# or
./scripts/dev-stack.shIf the backend lives somewhere else:
SMARTDROP_BACKEND_DIR=/path/to/smartdrop-backend npm run dev:stackPoint the frontend at the local backend in .env.local:
NEXT_PUBLIC_BACKEND_API_URL=http://localhost:4000/api/v1
Press Ctrl+C to stop all three processes.
- Admin API key. Generated once with
openssl rand -hex 32, saved to~/.smartdrop-dev/admin-api-key.txt, and reused on later runs. It is printed on startup; paste it into the/alertspage, which requires it. - In-memory Redis. On the first run it installs
redis-memory-serverunder~/.smartdrop-dev/redis-mem/and reuses it afterwards. If something is already listening on6379, that Redis is reused instead. - Backend. Starts
npm run devin the backend directory withPORT=4000,REDIS_URL=redis://localhost:6379,NODE_ENV=development, the admin key, andCORS_ALLOWED_ORIGINSallowinghttp://localhost:3000andhttp://localhost:3001. If something is already listening on4000, it is reused. - Frontend. Runs
npm run devin the foreground.
Everything the script creates lives under ~/.smartdrop-dev/:
| Path | Contents |
|---|---|
admin-api-key.txt |
The persisted admin API key |
redis-mem/ |
The in-memory Redis helper |
logs/redis.log |
Redis output |
logs/backend.log |
Backend output |
couldn't find smartdrop-backend: clone it next to this repo or setSMARTDROP_BACKEND_DIR.Redis didn't start in time/backend didn't start in time: read the matching log in~/.smartdrop-dev/logs/.- Port already in use by something unrelated: the script reuses whatever is
listening on
6379and4000, so stop the other process first.