AI-powered image generation and chat studio supporting Gemini, OpenAI-compatible, and Anthropic models.
π§π· Leia em PortuguΓͺs
- Bun (v1.3.11+)
- One or more API keys for supported providers (Gemini, OpenAI-compatible, Anthropic)
-
Clone the repository:
git clone <repo-url> cd mangostudio
-
Install dependencies:
bun install
-
Start the development servers:
bun run dev
This starts:
- API at
http://localhost:3001(Elysia + Kysely/SQLite) - Frontend at
http://localhost:5173(Vite + React)
- API at
MangoStudio has a flexible multi-connector system for managing multiple API keys with different persistence levels.
- OS Secret Store β Native secure storage via
Bun.secrets. Recommended for maximum security. - config.toml β Stores keys in
~/.mango/config.toml. Ideal for sharing keys across instances or CLI tools. - .env file β Adds variables to the
.mango/.envfile.
Go to the Settings page in the MangoStudio interface to add and manage connectors.
For each connector, you can enable or disable specific models (e.g., Gemini 2.5 Flash, Gemini 2.0 Flash Image). MangoStudio automatically selects the correct connector based on the active model in the chat.
You can manually add keys to ~/.mango/config.toml:
[gemini_api_keys]
personal = "your-key-here"
work = "another-key-here"MangoStudio will sync these keys automatically the next time the Settings page is loaded or a generation is requested.
mangostudio/
βββ .mango/ # Example configuration
β βββ config.toml.example
βββ apps/
β βββ api/
β β βββ src/
β β βββ routes/ # Elysia endpoints (chats, messages, settings, authβ¦)
β β βββ services/ # Business logic (gemini, secret-store)
β β βββ plugins/ # Reusable middlewares (auth, rate-limit)
β β βββ db/ # Kysely + SQLite + migrations
β βββ frontend/
β β βββ src/
β β βββ components/
β β β βββ ui/ # Design system (Button, Input, Card, Spinner, Toast)
β β βββ features/ # Feature modules (chat, galleryβ¦)
β β βββ hooks/ # React hooks (use-i18n, use-app-stateβ¦)
β β βββ routes/ # TanStack Router pages
β βββ shared/
β βββ src/
β βββ contracts/ # Request/response DTOs
β βββ types/ # Domain types
β βββ i18n/ # pt-BR / en dictionaries + useI18n hook
β βββ test-utils/ # Shared mock factories
βββ docs/
β βββ pt-br/
β β βββ README.md # Portuguese documentation
β βββ TESTING.md # Testing strategy and guide
βββ package.json # Bun workspace root
βββ tsconfig.json # Base TypeScript configuration
| Command | Description |
|---|---|
bun install |
Install all workspace dependencies |
bun run dev |
Start all dev servers concurrently |
bun run build |
Build the frontend for production |
bun run build:binary |
Generate standalone binaries with embedded frontend |
bun run format |
Apply Prettier across all workspaces |
bun run format:check |
Check formatting across all workspaces |
bun run lint |
ESLint across all workspaces |
bun run lint:fix |
ESLint autofix across all workspaces |
bun run typecheck |
TypeScript type-check across all workspaces |
bun run fix |
Apply lint autofix and Prettier across workspaces |
bun run check |
Format check + lint + typecheck + tests |
bun run verify |
Check + coverage + build |
bun run test |
Run all unit and integration tests |
bun run test:coverage |
Frontend coverage via Vitest/v8 |
bun run migrate |
Run SQLite database migrations |
| Layer | Technologies |
|---|---|
| Frontend | React 19, Vite 8, Tailwind CSS v4, TanStack Router/Query |
| API | Elysia, Better Auth, native rate limiting |
| Database | SQLite via Kysely (type-safe query builder) |
| AI | Multi-provider (Gemini, OpenAI-compatible, Anthropic) |
| Runtime | Bun β no Node.js dependency |
| i18n | Pure TypeScript dictionary in @mangostudio/shared/i18n |
The frontend ships with a built-in design system under apps/frontend/src/components/ui/:
Buttonβ variantsprimary,secondary,ghost;loadingpropInputβ label, error message, spread ofInputHTMLAttributesCardβ variantsglass(glassmorphism) andsolidSpinnerβ loading indicator with sizessm,md,lgToastβ non-blocking notifications viauseToast()hook
UI strings are centralized in @mangostudio/shared/i18n. Supports pt-BR (default) and en, with automatic detection via navigator.language.
import { useI18n } from '@/hooks/use-i18n';
function MyComponent() {
const { t } = useI18n();
return <h1>{t.auth.loginTitle}</h1>;
}The Messages type is inferred directly from the pt-BR.ts dictionary (as const). Adding a key without translating it in en.ts is a compile-time error.
The bun run build:binary command compiles the API into platform-specific binaries under .mango/out/<platform>/.
- The database is persisted at
~/.mangostudio/database.sqliteby default. - Frontend assets are served from the
public/directory next to the executable.
This project is licensed under the MIT License.

