# Folder structure

```bash
├── db # db related files (Not compiled with source code)
│   ├── categories # questions json
│   ├── queries
│   │   └── quizdb.sql # db create sql
│   ├── create.js # create db script
│   └── seed.js # seed db script
├── src # main directory
│   ├── app.ts # main app entry
│   ├── events # socket event handlers
│   │   ├── answer.ts # receive user answers and score them
│   │   ├── waitlist.ts # return game wait list to user
│   │   ├── join.ts # join user to a game room
│   │   ├── start.ts # start game and game loop
│   │   └── index.ts
│   ├── middleware
│   │   └── auth.ts # auth middleware with Telegram initData
│   ├── routes # rest api routes
│   │   ├── categories.ts # get list of categories
│   │   ├── games.ts # game info and creating a new game
│   │   ├── users.ts # update user info in db
│   │   ├── home.ts # home page
│   │   └── index.ts
│   ├── types # returned data interfaces
│   │   ├── game-info.ts
│   │   ├── leaderboard.ts
│   │   └── user.ts
│   ├── tests # tests folder
│   │   ├── calculate-score.test.ts
│   └── util # app util and setup
│       ├── bot-util.ts # handle sending inline query result with bot
│       ├── cache.ts # init node-cache
│       ├── game-loop.ts # game loop handler util
│       ├── game-util.ts # game info and leaderboard util
│       ├── pool.ts # database pool init
│       └── setup.ts # setup express middlewares
├── .gitignore
├── .env # env variables
├── package.json
├── pnpm-lock.yaml
└── tsconfig.json

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yasdpt.gitbook.io/instaquiz/server/folder-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
