Crypto Intel Papertrade is a Next.js + TypeScript platform for:
- official Binance and OKX market ingestion
- exchange announcement and RSS/news aggregation
- email-code onboarding
- spot and perpetual paper trading
- user-level AI execution settings
- an admin console with script-based updates
- public auth is split into:
/auth/login/auth/register/auth/forgot-password
/authnow redirects to/auth/login- the public header only exposes
Sign inandRegister - the admin entry is hidden from public navigation and must be opened manually at
/admin - the homepage and alerts page are now intel-first, instead of dumping raw
market_tickevents - a server command exists to force-reset the admin account
web: frontend, admin pages, API routes, SSEworker: market ingestion, intel collection, AI execution, simulation loopspostgres: application databaseredis: event bus and realtime fan-out
On a clean Ubuntu server:
curl -fsSL https://raw.githubusercontent.com/weige0831/crypto-intel-papertrade/main/scripts/quickstart-ubuntu.sh -o quickstart-ubuntu.sh
chmod +x quickstart-ubuntu.sh
ADMIN_EMAIL=admin@example.com ADMIN_PASSWORD='ChangeThisPassword123!' ./quickstart-ubuntu.shThe quickstart script installs missing dependencies, clones the repo, creates .env, generates secrets, seeds the database, resets the admin account, and starts the stack.
Default install directory:
$HOME/crypto-intel-papertrade
sudo apt update
sudo apt install -y git
git --versionsudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo docker version
sudo docker compose versionOptional, allow the current user to run Docker without sudo:
getent group docker || sudo groupadd docker
sudo usermod -aG docker $USER
newgrp dockergit clone https://github.com/weige0831/crypto-intel-papertrade.git
cd crypto-intel-papertrade
git config core.fileMode falseADMIN_EMAIL=admin@example.com ADMIN_PASSWORD='ChangeThisPassword123!' sh scripts/install.shinstall.sh will:
- create
.envfrom.env.examplewhen missing - generate
AUTH_SECRET - generate
APP_ENCRYPTION_KEY - set GitHub/GHCR defaults
- start PostgreSQL and Redis
- retry GHCR pulls before falling back to local builds
- run
prisma migrate deploywhen migrations exist - fall back to
prisma db pushwhen they do not - seed system defaults
- force-create or reset the admin account with
npm run admin:reset - start
webandworker - configure all services with
restart: unless-stoppedso they auto-start after a server reboot
cd ~/crypto-intel-papertrade
sh scripts/update.shupdate.sh now:
- pulls the latest
main - updates
IMAGE_TAG - retries GHCR pulls before local build fallback
- syncs the embedded PostgreSQL password from
.env - runs Prisma migrations or
db push - restarts the stack
- keeps services auto-starting after host reboot
- checks
/api/health - rolls back on failure
Use this on the server when the admin email or password needs to be recovered:
cd ~/crypto-intel-papertrade
ADMIN_EMAIL=admin@example.com ADMIN_PASSWORD='ChangeThisPassword123!' sh scripts/reset-admin.shThis command updates .env, ensures the user is ADMIN, marks the email as verified, and ensures a primary paper portfolio exists.
git clone https://github.com/weige0831/crypto-intel-papertrade.git
cd crypto-intel-papertrade
cp .env.example .envMinimum useful values:
AUTH_SECRET=local-dev-secret
APP_ENCRYPTION_KEY=local-dev-encryption-secret
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=admin123456docker compose up -d postgres redisnpm install
npm run db:generate
npm run db:push
npm run db:seed
npm run admin:resetnpm run devIn another terminal:
npm run worker//market/market/[instrument]/alerts/paper-trading/ai-settings/auth/login/auth/register/auth/forgot-password/admin
npm run dev
npm run worker
npm run lint
npm run test
npm run build
npm run db:generate
npm run db:push
npm run db:migrate
npm run db:seed
npm run admin:reset
sh scripts/install.sh
sh scripts/update.sh
sh scripts/reset-admin.sh