Quick Start
This is a quick start guide to get something running fast. For a more robust project setup with TypeScript, Prisma, and full configuration, see the Installation Guide. Let's build your first Arkos application. You'll create a simple API server with one endpoint that returns "Hello World".
Installation
Create a new directory and install Arkos:
mkdir my-arkos-app
cd my-arkos-app
pnpm initpnpm add arkos
pnpm add -D tsx tsx-strictnpm install arkos
npm add -D tsx tsx-strictHello World
Create src/router.ts:
import { ArkosRouter } from "arkos";
const router = ArkosRouter();
router.get({ path: "/" }, (req, res) => {
res.json({ message: "Hello World" });
});
export default router;Then create src/app.ts:
import arkos from "arkos";
import router from "./router";
const app = arkos();
app.use(router);
app.listen();Create src/router.ts:
import { ArkosRouter } from "arkos";
const router = ArkosRouter();
router.get({ path: "/" }, (req, res) => {
res.json({ message: "Hello World" });
});
export default router;Then create src/app.ts:
import arkos from "arkos";
import router from "./router";
arkos.init({
use: [router],
});Create src/router.ts:
import { Router } from "express";
const router = Router();
router.get("/", (req, res) => {
res.json({ message: "Hello World" });
});
export default router;Then create src/app.ts:
import arkos from "arkos";
import router from "./router";
arkos.init({
routers: {
additional: [router],
},
});Run It
npx arkos devOpen http://localhost:8000 — you'll see:
{ "message": "Hello World" }This small app is already running with compression, rate limiting, CORS, JSON body parsing, cookie parsing, query parsing, request logging, and security headers — all on by default. Every one of them is configurable or replaceable through arkos.config.ts. See Global Middlewares for the full list and options.
Add Another Route
import { ArkosRouter } from "arkos";
const router = ArkosRouter();
router.get({ path: "/" }, (req, res) => {
res.json({ message: "Hello World" });
});
router.get({ path: "/ping" }, (req, res) => {
res.json({ pong: true });
});
export default router;import { ArkosRouter } from "arkos";
const router = ArkosRouter();
router.get({ path: "/" }, (req, res) => {
res.json({ message: "Hello World" });
});
router.get({ path: "/ping" }, (req, res) => {
res.json({ pong: true });
});
export default router;import { Router } from "express";
const router = Router();
router.get("/", (req, res) => {
res.json({ message: "Hello World" });
});
router.get("/ping", (req, res) => {
res.json({ pong: true });
});
export default router;The src/app.ts file stays the same — just add more routes to src/router.ts as your app grows.
What's Next
This was the minimum. A real Arkos app also auto-generates full CRUD endpoints from your Prisma models, has a built-in authentication system, request validation, file uploads, and a lot more — all with zero boilerplate. The Installation Guide walks through setting all of that up properly with TypeScript, Prisma, and a solid project structure. That's the right next step before building anything serious.
- Installation — Complete setup with TypeScript, Prisma, and configuration
- Project Structure — Organize your code as it grows
- Routing Concepts — Custom routes vs auto-generated routes