Skip to content

NachoToast/FoundationX

Repository files navigation

FoundationX

Centralised API for the FoundationX server network.

codecov CI Deploy CodeQL

Table of Contents

Technologies

Bun Typescript Express.js PostgreSQL Docker

Installation

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 .env

Now 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 db

The API should be ready to start now, which can be done using:

bun run start

To see other scripts you can run using the bun run <script name> syntax, see the script reference.

Documentation

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.

Script Reference

  • start - Starts the API with hot reloading enabled.
  • lint - Runs biome linting checks.
  • lint:fix - Same as lint but fixes the found issues.
  • typecheck - Runs type checking.
  • test - Runs unit and integration tests.

Dependency Reference

  • 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-docs route.

Secret Reference

About

Centralised API for the FoundationX server network.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages