Cette page est affichée en anglais. Une traduction française est en cours.
MCP ConfigsApr 2, 2026·3 min de lecture

PocketBase — Backend in One File for AI Apps

Open-source backend with database, auth, file storage, and admin UI in a single executable. Perfect for AI app backends. 57K+ stars.

Introduction

PocketBase is an open-source backend with 57,300+ GitHub stars that packages a real-time database, authentication, file storage, and admin dashboard into a single executable file — zero external dependencies. Written in Go with an embedded SQLite database, it's the fastest way to build a backend for AI applications, chatbots, agent dashboards, or any project that needs a quick, reliable API. Create collections in the admin UI, and PocketBase auto-generates REST and real-time APIs. Used as the backend for countless AI projects, RAG apps, and LLM-powered tools.

Works with: Any frontend (React, Vue, Svelte, Next.js), any AI framework, Go (as a library). Best for developers who need a production backend in minutes, not weeks. Setup time: under 1 minute.


PocketBase Architecture

Single File = Complete Backend

pocketbase (single binary, ~40MB)
├── SQLite Database (embedded)
├── REST API (auto-generated)
├── Real-time Subscriptions (SSE)
├── Authentication (email, OAuth2)
├── File Storage (local or S3)
└── Admin Dashboard (built-in web UI)

Auto-Generated REST API

Create a collection in the admin UI → API endpoints are instantly available:

Method Endpoint Description
GET /api/collections/{name}/records List records
POST /api/collections/{name}/records Create record
GET /api/collections/{name}/records/{id} Get record
PATCH /api/collections/{name}/records/{id} Update record
DELETE /api/collections/{name}/records/{id} Delete record

Authentication

Built-in auth with zero configuration:

# Register a user
curl -X POST http://localhost:8090/api/collections/users/records \
  -d '{"email": "user@example.com", "password": "12345678", "passwordConfirm": "12345678"}'

# Login
curl -X POST http://localhost:8090/api/collections/users/auth-with-password \
  -d '{"identity": "user@example.com", "password": "12345678"}'
# Returns JWT token

OAuth2 providers: Google, GitHub, Facebook, Apple, Discord, Microsoft, and more.

Real-Time Subscriptions

import PocketBase from 'pocketbase';

const pb = new PocketBase('http://localhost:8090');

// Subscribe to changes
pb.collection('messages').subscribe('*', (e) => {
  console.log('New message:', e.record);
});

Use Cases for AI Apps

Use Case How PocketBase Helps
AI Chat App Store conversations, user accounts, file attachments
RAG Dashboard Store documents, embeddings metadata, query logs
Agent Platform Store agent configs, execution logs, user sessions
LLM Playground Store prompts, responses, model configs
API Backend REST API for any AI frontend in seconds

Extend with Go

package main

import (
    "github.com/pocketbase/pocketbase"
    "github.com/pocketbase/pocketbase/core"
)

func main() {
    app := pocketbase.New()

    app.OnServe().BindFunc(func(se *core.ServeEvent) error {
        se.Router.GET("/api/custom/ai-status", func(e *core.RequestEvent) error {
            return e.JSON(200, map[string]string{"status": "running"})
        })
        return se.Next()
    })

    app.Start()
}

FAQ

Q: What is PocketBase? A: PocketBase is an open-source backend with 57,300+ GitHub stars that packages database, auth, file storage, and admin UI into a single executable. Zero dependencies, instant REST APIs.

Q: Why use PocketBase for AI projects? A: AI apps need user auth, data storage, file handling, and real-time updates. PocketBase provides all of these in a single binary you can deploy anywhere — no Docker, no database setup, no infrastructure.

Q: Is PocketBase free? A: Yes, fully open-source under MIT license.


🙏

Source et remerciements

Created by Gani Georgiev. Licensed under MIT.

pocketbase — ⭐ 57,300+

Thanks to Gani Georgiev for building the simplest path from zero to production backend.

Discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.