This repository contains the core StackFox platform apps as a single npm workspaces monorepo.
It includes:
- the dashboard app
- the API app
Looking for the SDKs? Check out the stackfox-sdks repository.
@stackfox/api: Express + Prisma backend for auth, events, records, and dashboard data@stackfox/dashboard: TanStack Start dashboard app for project management and data inspection
- Node.js and npm
- a local Postgres instance for the API
npm installRun the API and dashboard together from the monorepo root:
npm run devRun a single workspace:
npm run dev:api
npm run dev:dashboardThe root dev runner starts:
@stackfox/api@stackfox/dashboard
npm run prisma:generate
npm run typecheck
npm run build
npm run lint
npm run testWe deploy StackFox services on Railway with config-as-code so build and start behavior lives in the repo instead of in a dashboard form.
apps/api/railway.jsonapps/dashboard/railway.json
Each railway.json file tells Railway:
- which builder to use
- which command builds the service
- which command starts the service
- which path to healthcheck after deploy
For this monorepo, each service uses a root-level script:
- API build:
npm run build:api - API pre-deploy:
npm run predeploy:api - API start:
npm run start:api - Dashboard build:
npm run build:dashboard - Dashboard start:
npm run start:dashboard
This avoids Railpack guessing the wrong runtime shape for the dashboard and keeps the API startup tied to the same workspace command we run locally.
For Prisma on the API:
build:apirunsprisma generateso the Prisma client is baked into the built imagepredeploy:apirunsprisma db pushso the database schema is synced before the new deployment goes live
Do not move prisma generate into pre-deploy. Railway runs pre-deploy in a separate step, so generated files from that phase are not the right place to prepare runtime artifacts.
-
Import this repository into Railway.
-
Create one service for the API and point its Railway config path at
/apps/api/railway.json. -
Create one service for the dashboard and point its Railway config path at
/apps/dashboard/railway.json. -
Add a PostgreSQL service and expose its connection string to the API as
DATABASE_URL. -
Set API variables:
PORT=8080 DATABASE_URL= APP_ORIGIN=https://dashboard.your-domain.com ROBLOX_OAUTH_CLIENT_ID= ROBLOX_OAUTH_CLIENT_SECRET= ROBLOX_OAUTH_REDIRECT_URI=https://api.your-domain.com/auth/roblox/callback ROBLOX_OAUTH_SCOPES=openid profile
-
Set dashboard variables:
VITE_STACKFOX_API_URL=https://api.your-domain.com
-
Attach domains after both services are healthy.
The API health endpoint is GET /health. The dashboard healthcheck is /.
Keep both services building from the monorepo root so npm workspaces and the shared lockfile are available. Do not use Add Root Directory for this repo unless each app gets its own independent lockfile and install flow.
If you want to disable Railway autodeploys on commit but still keep a deploy control surface, use .github/workflows/deploy-production.yml.
That workflow:
- runs only when you trigger it from the GitHub Actions tab
- lets you deploy
api,dashboard, orall - lets you choose the git ref to ship
Required GitHub repository secret:
RAILWAY_TOKEN: a Railway project token scoped to the production environment for this project
Required GitHub repository variables:
RAILWAY_PROD_PROJECT_ID: the Railway project ID for the StackFox monorepo projectRAILWAY_PROD_ENVIRONMENT: the Railway environment name, usuallyproductionRAILWAY_PROD_API_SERVICE: the Railway service ID or exact service name for the APIRAILWAY_PROD_DASHBOARD_SERVICE: the Railway service ID or exact service name for the dashboard
Recommended GitHub environments:
production-apiproduction-dashboard
Those environments are optional, but they give you a real deployment history in GitHub and let you add required reviewers before a production deploy runs.
Contributions are welcome! Please open an issue or submit a pull request with your changes. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.