> 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" %}
For production apps with real user data, review schema changes before applying them, and keep backups. GenVibe is careful with data, but you own the final call on important projects.
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
