Setting up Neon Database¶
Neon is a serverless Postgres platform that separates storage and compute. It offers branching, auto-scaling, and a generous free tier, making it perfect for Atlas ERP.
Setup Steps¶
- Create an Account: Sign up at Neon.tech.
- Create a Project:
- Name: Atlas ERP
- Database Name:
atlas_erp - Region: Choose the region closest to where your API will be deployed (e.g., US East if using Render in US East).
- Get Connection String:
- Once the database is created, copy the connection string from the dashboard.
- It will look like:
postgresql://user:password@ep-cold-surf-123456.us-east-2.aws.neon.tech/atlas_erp?sslmode=require
Configuring Atlas¶
- Paste this connection string into your
apps/api/.envfile asDATABASE_URL. - Because Neon uses PgBouncer internally for connection pooling, you usually do not need to append
&pgbouncer=truewhen using Prisma's default settings in recent versions, but keep it in mind if you experience connection exhaustion.
Applying the Schema¶
From your local machine, deploy the schema to the Neon database:
| Bash | |
|---|---|
Branching (Advanced)¶
Neon allows you to create branches of your database instantly. This is incredibly useful for testing PRs in CI/CD without touching the production database.