First Step
Language
Section titled “Language”GamanJS is specifically designed to work with modernTypeScript
using the ECMAScript Module (ESM) system. This means all modules must be written using import
and export
syntax—CommonJS (require
, module.exports
) is not supported. If you’re building a project with GamanJS, make sure your environment and codebase are fully ESM-compatible.
Prerequisites
Section titled “Prerequisites”Please make sure that Node.js
(version >= 18.x) is installed on your operating system.
Create first application
Section titled “Create first application”GamanJS is a framework for backend applications, You can create it using your favorite package manager:
npm create gaman@latest
pnpm create gaman@latest
yarn create gaman
bun create gaman@latest
Project Structure
Section titled “Project Structure”After creating a new project, your file structure will look like this:
Directorysrc
Directorymodule
- …
- index.d.ts
- index.ts
- main.block.ts
- main.routes.ts
- main.service.ts
- package.json
- tsconfig.json
File | description |
---|---|
index.d.ts | Type declaration file for the app entry point. It defines global types. |
main.block.ts | Module for registers routes, services, and middleware.. |
main.routes.ts | Defines HTTP routes handler |
main.services.ts | Contains the business logic. |