> For the complete documentation index, see [llms.txt](https://docs.genvibe.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.genvibe.pro/guides/database-and-auth.md).

# Add a database & login

Most real apps need to store data and let users sign in. In GenVibe, you do both through [Supabase](/integrations/supabase.md) — just by asking.

## Before you start

Connect Supabase and select a project. GenVibe needs this to create tables and wire up auth.

{% content-ref url="/pages/LNQS6LZtFOfqTVsS4gTz" %}
[Supabase (database & auth)](/integrations/supabase.md)
{% endcontent-ref %}

## Add a database

Describe the data you want to store and what the app should do with it:

> Use Supabase to store blog posts with a title, body, and created date. Add a page to create a post and a homepage that lists all posts newest-first.

GenVibe creates the table(s) and writes the code to read and write them.

## Add user login

> Add email/password sign up and login with Supabase. After logging in, take the user to their dashboard.

You can also scope data to each user:

> Make it so each user can only see and edit their own posts.

## Common patterns

* **User-owned data:** "each user sees only their own \[items]."
* **Public + private:** "anyone can read posts, but only the author can edit theirs."
* **File uploads:** "let users upload a profile picture" (uses Supabase storage).

## Safety with real data

{% hint style="warning" %}
GenVibe applies schema changes to the project you connected and saves each one in `supabase/migrations/`. For an app that already has real users and data, connect a separate development project while you build, keep backups, and apply finished migrations to production yourself.
{% endhint %}

## Verifying it works

Use the live preview to sign up a test user and create some data, then confirm it appears. If something errors, tell GenVibe exactly what happened and it will fix it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.genvibe.pro/guides/database-and-auth.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
