# Where Is the Main Entry Point for the Kaneo Application?

> Discover the main entry points for the Kaneo application. Find the API server entry at apps api src index ts and the web client entry at apps web src main ts within the TurboRepo structure.

- Repository: [kaneo.app/kaneo](https://github.com/usekaneo/kaneo)
- Tags: internals
- Published: 2026-08-04

---

**Kaneo has two main entry points: [`apps/api/src/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts) for the API server and [`apps/web/src/main.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/main.tsx) for the web client, both defined in a TurboRepo monorepo structure.**

Kaneo is an open-source project management platform built as a TypeScript monorepo. Because it separates the backend API from the frontend UI, each runtime has its own dedicated entry point that handles bootstrapping, configuration, and request handling.

## API Server Entry Point: [`apps/api/src/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts)

The backend API is a **Hono**-based HTTP server that exposes REST endpoints and WebSocket support. Its main entry point lives at [`apps/api/src/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts).

### What This File Does

- Creates a `Hono<AppVariables>` application instance
- Registers global middleware (CORS, authentication, request logging)
- Mounts feature routers for tasks, projects, workspaces, and integrations
- Starts the Node.js HTTP server via `@hono/node-server`

```typescript
// apps/api/src/index.ts (excerpt)
import { serve } from "@hono/node-server";
import { Hono } from "hono";

export function createApp() {
  const app = new Hono<AppVariables>();
  // …middleware & route registration…
  return app;
}

// Entry point execution
if (import.meta.main) {
  const app = createApp();
  serve(app, { port: Number(process.env.PORT) ?? 1337 });
}

```

The `createApp()` function is exported separately to enable testing without starting the server. When the file runs directly (`import.meta.main`), it invokes `serve()` with the configured port (defaulting to **1337**).

### Database Initialization

Before the server accepts traffic, [`apps/api/src/database/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/database/index.ts) initializes the **Drizzle ORM**, runs migrations, and establishes the database connection used throughout the API.

## Web Client Entry Point: [`apps/web/src/main.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/main.tsx)

The frontend is a **Vite-powered React application** using **TanStack Router** for client-side navigation. Its entry point is [`apps/web/src/main.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/main.tsx).

### What This File Does

- Mounts the React tree onto the DOM root element
- Configures the TanStack Router provider
- Initializes global UI providers (theme, state management, etc.)

```tsx
// apps/web/src/main.tsx (excerpt)
import { createRoot } from "react-dom/client";
import { RouterProvider } from "@tanstack/react-router";
import { router } from "./tanstack/router";

const root = createRoot(document.getElementById("root")!);
root.render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
);

```

Route definitions are loaded from [`apps/web/src/tanstack/router.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/tanstack/router.tsx), which exports the `router` instance passed to `RouterProvider`.

## How Entry Points Are Invoked

Kaneo uses **TurboRepo** to orchestrate both runtimes. The root [`package.json`](https://github.com/usekaneo/kaneo/blob/main/package.json) defines scripts that launch the entry points:

| Script | Command | What It Runs |
|--------|---------|--------------|
| `pnpm dev` | `turbo run dev` | Starts both API and Web dev servers concurrently |
| `pnpm build` | `turro run build` | Compiles production bundles for both apps |
| `pnpm lint` | `turbo run lint` | Runs linting across the monorepo |

Individual workspace scripts are defined in [`apps/api/package.json`](https://github.com/usekaneo/kaneo/blob/main/apps/api/package.json) and [`apps/web/package.json`](https://github.com/usekaneo/kaneo/blob/main/apps/web/package.json), then aggregated at the monorepo root.

## Key Entry Point Files Reference

| Runtime | Path | Purpose |
|---------|------|---------|
| API Server | [[`apps/api/src/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts)](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts) | Main server bootstrap |
| API Database | [[`apps/api/src/database/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/database/index.ts)](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/database/index.ts) | ORM and migration setup |
| Web Client | [[`apps/web/src/main.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/main.tsx)](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/main.tsx) | React DOM mounting |
| Web Router | [[`apps/web/src/tanstack/router.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/tanstack/router.tsx)](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/tanstack/router.tsx) | Client-side route definitions |
| Monorepo Scripts | [[`package.json`](https://github.com/usekaneo/kaneo/blob/main/package.json)](https://github.com/usekaneo/kaneo/blob/main/package.json) | TurboRepo orchestration |

## Summary

- **Kaneo has two main entry points** due to its split architecture: one for the API backend, one for the React frontend.
- **[`apps/api/src/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts)** bootstraps the Hono server with middleware, routes, and HTTP listener.
- **[`apps/web/src/main.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/main.tsx)** mounts the React application with TanStack Router.
- Both entry points are invoked through **TurboRepo scripts** defined in the root [`package.json`](https://github.com/usekaneo/kaneo/blob/main/package.json).
- The `createApp()` export pattern enables testable server initialization without side effects.

## Frequently Asked Questions

### How do I start Kaneo in development mode?

Run `pnpm dev` from the repository root. This executes TurboRepo, which starts both the API server (port 1337 by default) and the Vite dev server for the web client concurrently.

### Can I run the API server standalone?

Yes. Navigate to `apps/api/` and run `pnpm dev` or `pnpm start`. The entry point at [`apps/api/src/index.ts`](https://github.com/usekaneo/kaneo/blob/main/apps/api/src/index.ts) will bootstrap the Hono application and begin listening on the configured port.

### Where are the route definitions for the web client?

Client-side routes are defined in [`apps/web/src/tanstack/router.tsx`](https://github.com/usekaneo/kaneo/blob/main/apps/web/src/tanstack/router.tsx). This file creates the `router` instance imported by [`main.tsx`](https://github.com/usekaneo/kaneo/blob/main/main.tsx) and maps URLs to React components using TanStack Router's file-based or programmatic routing.

### What framework powers Kaneo's API?

The API uses **Hono**, a lightweight, edge-ready web framework for JavaScript/TypeScript. The entry point creates a Hono instance, registers middleware via `app.use()`, mounts sub-routers with `app.route()`, and starts the server with `@hono/node-server`'s `serve()` function.