Centralised API for the FoundationX server network.
This assumes you have git, Bun, and Docker installed already.
git clone https://github.com/NachoToast/FoundationX.git
cd FoundationX
bun install
cp .env.example .envNow fill out the .env file with the correct values.
If you are using Docker for hosting the PostgreSQL database, you can now start it up using the following command:
docker compose up --build --detach dbThe API should be ready to start now, which can be done using:
bun run startTo see other scripts you can run using the bun run <script name> syntax, see the script reference.
Overall architecture is outlined in the developer Figma design document. If you are a developer and do not have access to this, please contact NachoToast.
start- Starts the API with hot reloading enabled.lint- Runs biome linting checks.lint:fix- Same aslintbut fixes the found issues.typecheck- Runs type checking.test- Runs unit and integration tests.
cors- CORS policy management for routes.discord.js- Discord bot API library, used by our main bot and stats bots.express- Web server library, hosts routes.express-openapi-validator- API request and response validation.express-rate-limit- Rate limiting for API routes.jsonwebtoken- Session management helper.swagger-ui-express- Standard spec definitions and/api-docsroute.
CODECOV_TOKENis used by the CI workflow to upload code test coverage to Codecov.- The deployment workflow uses
HOST,USERNAME,PASSWORD,PORT, andDIRECTORYsecrets for SSH.