# Projects
Source: https://sovaria.in/docs/projects

Creating a project, its id, reference and URL, region, what each project contains, environments, health and deleting a project.

A **project** is one backend: its own Postgres database, document store, app users, storage buckets, functions, realtime channels, policies and keys. Projects never share data, users or keys with each other.

## Create a project

1. **Organization › Projects › New project** — Owners and admins can create projects.
2. **Choose the plan** — The organization's plan decides how many projects you may have and their compute — see [Plan limits](https://sovaria.in/docs/plan-limits).
3. **Region** — Every project runs in Mumbai (ap-south-1), the only region today; a project's region can't be changed later.
4. **Name it** — The name can be changed any time in Project Settings › General.

Sovaria creates the database, the anon and service role keys and default settings; the project home shows the project as healthy once they are ready.

## Identifiers and URL

|  | Looks like | Used for |
|---|---|---|
| Project id | a UUID | The CLI (`--project`), the management API, support. |
| Reference (`ref`) | 12 hex characters | The project URL. |
| Project URL | `https://<ref>.sovarias.in` | Everything your app calls: auth, SQL, REST, storage, functions, realtime. Shown under **Connect**. |
| Database host | `db.<org-id>.sovarias.in:5432` | Direct Postgres connections ([Database: connection, compute, disk and backups](https://sovaria.in/docs/settings-database)). |

The URL already names the project, so apps never send a project id. Older URLs on `<ref>.sovaria.in` keep working.

CLI:
```bash
sov orgs            # your organizations
sov projects        # projects in the current organization
sov link            # writes sovaria.config.json for this folder
```

JavaScript:
```js
const ref = await sovaria.api.org.getProjectRef()   // the client's project
```

## What a project contains

| Part | Docs |
|---|---|
| Postgres database and the Table / SQL editors | [Database](https://sovaria.in/docs/database) |
| Document store (collections) | [Documents](https://sovaria.in/docs/documents-overview) |
| App users and sign-in | [Authentication overview](https://sovaria.in/docs/auth-overview) |
| Storage buckets | [Storage](https://sovaria.in/docs/storage-overview) |
| Functions, triggers and workflows | [Functions](https://sovaria.in/docs/functions-overview) |
| Realtime channels | [Realtime](https://sovaria.in/docs/realtime-overview) |
| Access policies | [How access is decided](https://sovaria.in/docs/access-model) |
| API keys and secrets | [Keys, tokens and credentials](https://sovaria.in/docs/credentials) |
| Settings | [General settings](https://sovaria.in/docs/settings-general) |

## Environments

Every project starts with **production**. You can add **staging** and versioned environments that get their own URL and their own copy of rules, functions and schema changes, and promote changes to production when they are ready — [Environments, staging and deploying to production](https://sovaria.in/docs/environments-and-staging). The production environment can't be deleted.

## Status and health

- The project home shows the database, its region and compute, and request and error counts.
- On plans with idle pause, an unused database pauses and starts again on the next request (the first request can take a few seconds) — [Database: connection, compute, disk and backups](https://sovaria.in/docs/settings-database).
- Errors carry a `trace_id` you can open in **Logs & Audit** and give to support.

## Delete a project

Only owners and admins can delete a project (Project Settings › General › Delete project, or the project's menu on the organization's Projects page).

1. **It stops at once** — The project leaves the organization's lists and no longer counts against your plan. Its apps, sites, API keys, app users' sign-in, functions and schedules stop, and its URL answers `404 PROJECT_DELETED`. Its databases are paused within a minute or two: a Free database is copied to encrypted off-site storage and leaves the shared server, a dedicated one is stopped, and so are its environments' databases. Nothing wakes them while the project is deleted. Nothing is deleted yet.
2. **You can restore it** — For your plan's recovery window — Free 3 days, Pro 7, Ultra 14, Team and Enterprise 30 (`project.recovery_days`) — an owner or admin can restore it from Organization › Projects › Deleted projects. Everything comes back as it was, if your plan has room for one more project; its databases start again by themselves (a Free one is restored from its copy, which takes up to a minute).
3. **Then it is deleted everywhere** — When the window ends, every service deletes the project and its environments: databases and their containers, backups and point-in-time recovery archive, stored files, functions, hosted sites and domains, Sovariq conversations, realtime keys, version history, analytics and logs, access policies, usage, API keys and settings. The organization's own records (its audit log, invoices) stay.

> **Warning:** After the recovery window there is no undo. Export what you need first ([Backups and recovery](https://sovaria.in/docs/backups-and-recovery)).
