# Spica > Spica is an open-source backend development engine: data modeling with auto-generated REST, GraphQL and realtime APIs, cloud functions, identity and access management, storage and a customizable admin panel. Every page is also available as Markdown by appending `.md` to its URL. The full documentation in one file: https://docs.spicaengine.com/llms-full.txt ## Get started - [Introduction](https://docs.spicaengine.com/get-started/introduction.md): Spica is an open-source backend development engine that gives you data APIs, cloud functions, identity and access management, storage and an admin panel out of the box. - [Quickstart](https://docs.spicaengine.com/get-started/quickstart.md): Start a Spica project on your machine, create your first bucket, read data over REST and serve your first function, in about ten minutes. - [Core concepts](https://docs.spicaengine.com/get-started/core-concepts.md): The building blocks of a Spica project and how they fit together, from buckets and functions to identities, users, policies and API keys. - [How Spica runs](https://docs.spicaengine.com/get-started/architecture.md): The processes and services that make up a Spica deployment, what each one is responsible for and how requests travel between them. - [MCP server](https://docs.spicaengine.com/ai/mcp-server.md): Connect Claude, Cursor, VS Code and other AI agents to a Spica instance with @spica/mcp, so they can manage buckets, data, functions, access and storage. - [Docs for AI agents](https://docs.spicaengine.com/ai/docs-for-agents.md): Give AI coding agents accurate Spica context with Markdown pages, llms.txt and llms-full.txt, and combine them with the MCP server. ## Build - [Buckets](https://docs.spicaengine.com/buckets.md): Buckets are schema-defined collections of documents with ready-made REST, GraphQL and realtime APIs, validation, rules, localization and history. - [Schema & property types](https://docs.spicaengine.com/buckets/schema.md): Define a bucket's properties, validation, defaults, relations and translations, and every bucket-level setting. - [Data API](https://docs.spicaengine.com/buckets/data-api.md): Create, read, replace, patch and delete bucket documents over REST, with the permissions each endpoint needs and the responses it returns. - [Querying](https://docs.spicaengine.com/buckets/querying.md): Filter, sort, paginate, resolve relations and localize bucket data with expression and JSON filters. - [Rules](https://docs.spicaengine.com/buckets/rules.md): Use read and write rules to control which documents each end user can see and change, and field rules to hide individual properties. - [Realtime](https://docs.spicaengine.com/buckets/realtime.md): Subscribe to bucket data over WebSocket, receive inserts, updates and deletes as they happen, and write documents through the same connection. - [History](https://docs.spicaengine.com/buckets/history.md): Keep previous versions of bucket documents, list them and see how a document looked at any point. - [GraphQL](https://docs.spicaengine.com/buckets/graphql.md): Turn on the GraphQL endpoint to query and mutate bucket data with a schema generated from your buckets. - [Indexes, limits & performance](https://docs.spicaengine.com/buckets/advanced.md): Add database indexes, cap the number of documents, cache responses and keep bucket queries fast. - [Functions](https://docs.spicaengine.com/functions.md): Write Node.js functions in JavaScript or TypeScript, connect their handlers to triggers, and run your business logic next to your data. - [HTTP functions](https://docs.spicaengine.com/functions/http.md): Serve HTTP endpoints from functions, with routing, CORS, authentication, authorization and per-IP rate limiting. - [Bucket and database triggers](https://docs.spicaengine.com/functions/bucket-and-database.md): Run a function whenever documents are inserted, updated or deleted, either through the bucket APIs or anywhere in the database. - [Scheduled functions](https://docs.spicaengine.com/functions/schedule.md): Run functions on a cron schedule in the time zone of your choice, for reports, cleanups, syncs and reminders. - [System, firehose, gRPC and RabbitMQ triggers](https://docs.spicaengine.com/functions/other-triggers.md): Run functions when the API starts, exchange low-latency messages over WebSocket, serve gRPC methods and consume RabbitMQ queues and streams. - [Dependencies & builds](https://docs.spicaengine.com/functions/dependencies.md): Install npm packages into functions, write functions in TypeScript, share code between functions and choose how sources are built. - [Environment variables & secrets](https://docs.spicaengine.com/functions/environment.md): Give functions configuration and credentials through environment variables and encrypted secrets, and reference them in trigger options. - [Logs](https://docs.spicaengine.com/functions/logs.md): Write logs from functions with the console, browse and filter them in the panel or over the API, and send them to stdout for your log platform. - [Runtime & scaling](https://docs.spicaengine.com/functions/runtime.md): How function workers run your code, and how timeouts, warm workers and concurrency settings affect latency and throughput. - [Function best practices](https://docs.spicaengine.com/functions/best-practices.md): Practical guidelines for writing functions that are fast, secure, observable and easy to change. - [Authentication & access](https://docs.spicaengine.com/auth.md): How Spica authenticates identities, users and API keys, and how policies and rules decide what each of them may do. - [Identities](https://docs.spicaengine.com/auth/identities.md): Create accounts for the people who build and operate your backend, give them policies, and log them in to the panel and the API. - [Users](https://docs.spicaengine.com/auth/users.md): Manage your product's end users with Spica, from sign-up and login to email and phone verification, password reset, passwordless login and bans. - [Tokens & sessions](https://docs.spicaengine.com/auth/tokens.md): How Spica issues and verifies JWTs for identities and users, how refresh tokens extend sessions, and how to revoke them. - [API keys](https://docs.spicaengine.com/auth/api-keys.md): Create API keys for servers, functions, scripts and CI, attach policies to them, and rotate them safely. - [Policies](https://docs.spicaengine.com/auth/policies.md): Write policies that grant identities, users and API keys exactly the actions and resources they need, and use the built-in policies. - [Login strategies](https://docs.spicaengine.com/auth/strategies.md): Let identities sign in with SAML single sign-on, and users with Google, GitHub, Facebook, Okta, Auth0 or any custom OAuth 2.0 provider. - [Two-factor authentication](https://docs.spicaengine.com/auth/two-factor.md): Protect identity and user accounts with time-based one-time passwords from apps such as Google Authenticator or 1Password. - [Password & login security](https://docs.spicaengine.com/auth/security.md): Enforce password rules, prevent password reuse, lock accounts after failed logins and rate-limit sensitive user endpoints. - [Storage](https://docs.spicaengine.com/storage.md): Upload, organize, serve and protect files with the storage module, on local disk, Amazon S3 or Google Cloud Storage, including resumable uploads. - [Environment variables & secrets](https://docs.spicaengine.com/platform/env-vars-and-secrets.md): The modules that store configuration values and encrypted credentials for functions, and the endpoints that manage them. - [Webhooks](https://docs.spicaengine.com/platform/webhooks.md): Send an HTTP POST to any URL when documents change, with a body built from a Handlebars template, and inspect every delivery. - [Dashboards](https://docs.spicaengine.com/platform/dashboards.md): Build dashboards for your team in the panel, with charts, tables, statistics and forms fed by your own HTTP functions. - [Activity stream](https://docs.spicaengine.com/platform/activity.md): See who created, changed or deleted what, when, across buckets, functions, storage, identities and the rest of the API. - [Configuration & preferences](https://docs.spicaengine.com/platform/config.md): Change runtime settings such as password policies, verification channels and rate limits with the config module, and bucket languages with preferences. - [Mailer & SMS](https://docs.spicaengine.com/platform/mailer-and-sms.md): Configure SMTP and Twilio so that Spica can send verification codes, magic links, password resets and passwordless logins by email and SMS. - [Status & observability](https://docs.spicaengine.com/platform/observability.md): Health checks, usage statistics, access logs, request tracing and the panel's observability pages for running Spica in production. - [Batch requests](https://docs.spicaengine.com/platform/batch.md): Send many API requests in one round trip with the batch endpoint, and control how many run at the same time. - [Assets](https://docs.spicaengine.com/platform/assets.md): Package buckets, functions, dashboards and other resources into installable assets, with configurable values, previews and exports. - [Replication](https://docs.spicaengine.com/platform/replication.md): Run several API replicas behind a load balancer, keep them in sync, and make sure triggered work runs exactly once. ## Panel - [Admin panel](https://docs.spicaengine.com/panel.md): A tour of Spica's admin panel, the back office where developers configure the backend and content teams manage data. - [Buckets & entries](https://docs.spicaengine.com/panel/buckets.md): Design bucket schemas and manage entries in the panel, with tables, filters, translations, relations and history. - [Functions](https://docs.spicaengine.com/panel/functions.md): Write and deploy functions in the panel's editor, configure triggers, imports, dependencies and environment, and browse logs. - [Access management](https://docs.spicaengine.com/panel/access.md): Manage identities, users, policies, login strategies, API keys, refresh tokens, secrets and user activity from the panel. - [Storage](https://docs.spicaengine.com/panel/storage.md): Upload, organize, preview and delete files in the panel's storage browser. - [Dashboards](https://docs.spicaengine.com/panel/dashboards.md): Create dashboards in the panel and add charts, tables, statistics and cards backed by your functions. - [Webhooks](https://docs.spicaengine.com/panel/webhooks.md): Create, pause and debug webhooks from the panel. - [Secrets & variables](https://docs.spicaengine.com/panel/secrets-and-variables.md): Manage the secrets and environment variables that functions use, from the panel. - [Configuration](https://docs.spicaengine.com/panel/config.md): Change password policies, verification channels, passwordless login and rate limits for users and identities from the panel. - [Observability & activity](https://docs.spicaengine.com/panel/observability.md): Check bucket health, profile slow queries and follow what happened in your instance from the panel. - [Diagram](https://docs.spicaengine.com/panel/diagram.md): See your buckets and the relations between them as an interactive diagram. ## CLI - [Spica CLI](https://docs.spicaengine.com/cli.md): Install @spica/cli to run Spica locally with Docker, manage resources as code, and automate deployments from CI. - [Contexts](https://docs.spicaengine.com/cli/contexts.md): Save the URL and API key of each Spica instance as a named context, and switch between local, staging and production. - [Local projects](https://docs.spicaengine.com/cli/local-projects.md): Run complete Spica projects on your machine with Docker, on MongoDB or PostgreSQL, and upgrade or remove them. - [Resources as code](https://docs.spicaengine.com/cli/resources-as-code.md): Keep buckets, functions, policies, environment variables and secrets in a git repository, and fetch, plan, apply and live-sync them with the CLI. - [Values per environment](https://docs.spicaengine.com/cli/values.md): Keep environment variable and secret values out of git, set them per CLI context, and provide them from CI with SPICA_VALUE_ variables. - [Assets](https://docs.spicaengine.com/cli/assets.md): Upload a folder of resources as an asset with spica asset apply, preview it with --dry-run, and remove it with spica asset delete. - [Project sync](https://docs.spicaengine.com/cli/project-sync.md): Copy buckets, bucket data, functions, API keys, policies and environment variables directly from one Spica instance to another. - [Code generation](https://docs.spicaengine.com/cli/orm.md): Generate a typed client for your buckets and typed callers for your HTTP functions from a live instance. - [Command reference](https://docs.spicaengine.com/cli/reference.md): Every Spica CLI command with its arguments and options. ## Devkit - [Devkit](https://docs.spicaengine.com/devkit.md): Typed JavaScript packages for calling Spica from functions, browsers, Node.js services, CI and tests. - [@spica-devkit/bucket](https://docs.spicaengine.com/devkit/bucket.md): Manage bucket schemas and read, write and stream bucket data with a typed client. - [@spica-devkit/auth](https://docs.spicaengine.com/devkit/auth.md): Sign users up and in, manage sessions, verify emails and phone numbers, reset passwords and log users in without passwords. - [@spica-devkit/identity](https://docs.spicaengine.com/devkit/identity.md): Log identities in, handle two-factor challenges, and manage identities, their policies and login strategies. - [@spica-devkit/storage](https://docs.spicaengine.com/devkit/storage.md): Upload, download, list, rename, replace and delete storage objects from browsers, Node.js and functions. - [@spica-devkit/database](https://docs.spicaengine.com/devkit/database.md): Get a native MongoDB connection inside Spica functions for advanced queries, and understand why the APIs are usually the better choice. - [@spica-devkit/sync](https://docs.spicaengine.com/devkit/sync.md): Plan and apply Spica resource files from your own services, such as a deployment service that syncs a project from a git commit. - [@spica-devkit/testing](https://docs.spicaengine.com/devkit/testing.md): Start a disposable Spica instance from your test suite, install your project's resources, reset data between tests and tear it down. ## Self-hosting - [Self-hosting](https://docs.spicaengine.com/self-hosting.md): Choose how to run Spica in production, what every deployment needs, and where to find the configuration reference. - [Docker Compose](https://docs.spicaengine.com/self-hosting/docker.md): Run Spica in production on a single machine with Docker Compose, a MongoDB replica set and an nginx gateway. - [Kubernetes with Helm](https://docs.spicaengine.com/self-hosting/kubernetes.md): Install Spica on Kubernetes with the official Helm chart, configure database, secrets, ingress and storage, and scale and upgrade it. - [MongoDB and PostgreSQL](https://docs.spicaengine.com/self-hosting/databases.md): Run Spica on MongoDB or PostgreSQL, set each one up correctly, and know the differences your applications will see. - [API configuration reference](https://docs.spicaengine.com/self-hosting/configuration.md): Every startup option of the Spica API, grouped by area, with defaults, environment variables and validation rules. - [Helm values reference](https://docs.spicaengine.com/self-hosting/helm-values.md): Every value of the Spica Helm chart for the application, database, images and ingress, with defaults. - [Production checklist](https://docs.spicaengine.com/self-hosting/production-checklist.md): Security, reliability, performance and operations items to check before and after you put a Spica instance in front of real users. ## Recipes - [Recipes](https://docs.spicaengine.com/recipes.md): End-to-end scenarios that combine buckets, functions, authentication, storage, the CLI and the devkit to solve common problems. - [Headless CMS for a blog](https://docs.spicaengine.com/recipes/headless-cms-blog.md): Model posts and authors, let editors manage content in the panel, serve published posts to your website and trigger a rebuild on every change. - [User sign-up with email verification](https://docs.spicaengine.com/recipes/user-signup-verification.md): Build a public sign-up endpoint, verify users' email addresses with one-time codes, and enable password reset. - [Welcome email for new users](https://docs.spicaengine.com/recipes/welcome-email.md): Send a welcome email whenever a user is created, with a database trigger, nodemailer and secrets. - [Scheduled cleanup job](https://docs.spicaengine.com/recipes/scheduled-cleanup.md): Delete expired documents every night with a schedule trigger, processing them in batches that fit in a function's timeout. - [CI/CD with GitHub Actions](https://docs.spicaengine.com/recipes/ci-cd-github-actions.md): Review Spica changes as plans on pull requests and apply them to staging and production when they merge, with GitHub Actions and the Spica CLI. - [End-to-end tests](https://docs.spicaengine.com/recipes/e2e-testing.md): Test your buckets, rules and functions against a disposable Spica instance with @spica-devkit/testing and Vitest. - [User uploads on Amazon S3](https://docs.spicaengine.com/recipes/s3-media-uploads.md): Store files on Amazon S3 and let signed-in users upload avatars through an HTTP function that checks their token.