Skip to content

Tech Stack & Setup

This page describes the technology stack and setup instructions for the Gami API.


Technology Stack

ComponentTechnology
RuntimeNode.js (TypeScript)
FrameworkFastify
DatabasePostgreSQL
ORMPrisma
ValidationZod
DocumentationSwagger / OpenAPI
ContainerizationDocker & Docker Compose

Prerequisites

  • Node.js v18+
  • Docker & Docker Compose

Environment Variables

Create a .env file in the root directory:

env
DATABASE_URL="postgresql://user:password@localhost:5432/gamibot?schema=public"

Installation

Start both the API and PostgreSQL database:

bash
docker-compose up -d --build

The API will be available at http://localhost:3000.

Local Development

  1. Install Dependencies:

    bash
    npm install
  2. Run Migrations:

    bash
    npx prisma generate
    npx prisma migrate dev
  3. Start Server:

    bash
    npm run dev

Testing

The project uses Vitest for integration testing:

bash
npm test

Test Suites

SuiteCoverage
XP TestsXP awarded correctly based on quiz scores
Topic TestsTopic progress calculated accurately
Badge TestsAll badges awarded when conditions are met
Stats TestsUser statistics aggregation and initialization

Next Steps

Released under the MIT License.