> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.panicly.lol/llms.txt.
> For full documentation content, see https://docs.panicly.lol/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.panicly.lol/_mcp/server.

# Monorepo architecture

```txt title="panicly/"
apps/
  api/
  chatbot/
  web/
packages/
  auth/
  billing/
  db/
  logger/
  rules-engine/
  sdk/
  shared/
docs/
designs/
.panicly/
memory/
```

The repo is not perfectly separated. Backend behavior appears in `apps/api`, `apps/web/src/app/api/*`, and `apps/web/src/app/v1/[...path]/route.ts`.

## Applications

Main Next.js product app: marketing site, authenticated dashboard, API routes, and web gateway catch-all.

Express service with auth, billing, dashboard, projects, gateway, and health routes.

Separate Next.js chatbot app that integrates with Panicly through `@panicly/sdk`.

## Shared packages

Plan limits, credit packages, provider base URLs, shared types, geo mapping, key normalization, token/cost estimates, and trusted request utilities.

WorkOS client, sealed sessions, org/user actions, and workspace role inference.

Checkout, portal, webhook handling, plan definitions, credit grants, and subscription state.

Sentry Mode, burst protection, abuse detection, token guard, and loop guard.

Small helper for external clients to call Panicly as an OpenAI-compatible backend.

Route redirects encode live vocabulary shifts: IP Management to Network Controls, Geo-protection to Region Rules, and Panic Mode to Sentry Mode.