boltQuickstart

Arcend is designed to get your backend running with minimal setup. This guide shows how to start a server, load routes, and handle your first request — without boilerplate or configuration overhead.

Installation using Arcend CLI

PowerShell / Terminal
npm install -g @arcend/cli
arcend create <projectname>

Installation and project structure

  1. Install main package

    npm install typescript ts-node @types/node @arcend/core
  2. Setup project

    npx tsc --init
    *
    ├── tsconfig.json
    ├── package.json
    └── src
        ├── index.ts
        └── routes
            └── index.ts
  3. Edit your tsconfig.json (Example below)

    {
        "compilerOptions": {
            "module": "nodenext",
            "target": "esnext",
            "types": ["node"],
            "sourceMap": true,
            "declaration": true,
            "declarationMap": true,
            "noUncheckedIndexedAccess": true,
            "exactOptionalPropertyTypes": true,
            "strict": true,
            "jsx": "react-jsx",
            "verbatimModuleSyntax": true,
            "isolatedModules": true,
            "noUncheckedSideEffectImports": true,
            "moduleDetection": "force",
            "skipLibCheck": true,
    
            "rootDir": "src",
            "outDir": "dist"
        },
        "include": ["src/*", "src/**/*"]
    }
  4. Edit your package.json (Example below)

    {
      "name": "test",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "dev": "npx ts-node ./src/index.ts",
        "build": "npx tsc",
        "start": "node ./dist/index.js"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "type": "module",
      "dependencies": {
        "@arcend/core": "^1.0.1",
        "@types/node": "^25.0.10",
        "ts-node": "^10.9.2",
        "typescript": "^5.9.3"
      }
    }
  5. Make some code in src/index.ts

    src/index.ts
    import { Server } from '@arcend/core';
    
    const port: number = 4000;
    const sv: Server   = new Server({port: port, cors: 'http://localhost:3000'});
    sv.listen(async() => {
        await sv.loadRoutes('routes');
        console.log('API listening on: http://localhost:' + port);
    });
  6. Create your first route in /routes

    src/routes/route.ts
    import type { ArcRequest, ArcResponse } from "@arcend/core";
    
    const GET = async(req: ArcRequest, res: ArcResponse) =>
    {
        return {
            query: req.query,
            body: req.body,
            headers: req.headers,
            method: req.method,
            path: req.path
        };
    };
    export { GET };
  7. Run dev script and test it

    npm run dev
    PS dir> npm run dev
    
    > @test@1.0.0 dev
    > npx ts-node ./src/index.ts
    
    API listening on: http://localhost:4000
  8. Build it and run

    npm run build
    npm run start

Last updated