Documentation Index
Fetch the complete documentation index at: https://mintlify.com/amanvarshney01/create-better-t-stack/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Better-T-Stack supports automated setup for popular database providers. Choose a managed provider for production or Docker for local development.Setup options by database type
SQLite
- Turso
- Cloudflare D1
- None (Manual)
Turso - SQLite for Production, powered by libSQLFeatures:What you get:
- Edge-replicated SQLite
- HTTP API
- Branching support
- Generous free tier
- Turso CLI installation helper
- Connection string template
- Environment variable configuration
- Sign up at turso.tech
- Create a database:
turso db create my-app - Get connection URL:
turso db show my-app --url - Get auth token:
turso db tokens create my-app - Add to
.env:
PostgreSQL
- Neon
- Supabase
- Prisma Postgres
- PlanetScale
- Docker
- None (Manual)
Neon Postgres - Serverless Postgres with branchingFeatures:Next steps:
- Serverless, scale-to-zero
- Database branching (like Git)
- Instant read replicas
- Generous free tier
- Sign up at neon.tech
- Create a project
- Copy connection string from dashboard
- Add to
.env:
MySQL
- PlanetScale
- Docker
- None (Manual)
PlanetScale - MySQL on Vitess with NVMe storageSetup:See PostgreSQL > PlanetScale tab for details.
MongoDB
- MongoDB Atlas
- Docker
- None (Manual)
MongoDB Atlas - Fully managed cloud MongoDBFeatures:Next steps:
- Global clusters
- Automated backups
- Monitoring and alerts
- Free tier (512MB)
- Sign up at mongodb.com/cloud/atlas
- Create a cluster
- Create a database user
- Whitelist your IP address
- Get connection string
- Add to
.env:
Connection strings
Each database type uses a specific connection string format:SQLite
PostgreSQL
MySQL
MongoDB
Environment variables
Location
Database URLs are typically stored in:Required variables
Standard setup:alchemy.run.ts. No connection string needed.
For Alchemy deployments
If using Cloudflare deployment with Alchemy:Applying schema
After setting up your database:With Drizzle
Push schema (development):With Prisma
Push schema (development):With Mongoose
Mongoose doesn’t require migrations - schemas are applied automatically on first connection.Switching providers
To switch database providers after creation:Update connection string
Replace
DATABASE_URL in your .env files with the new provider’s connection string.Update ORM configuration (if needed)
Some ORMs require provider-specific configuration:Drizzle:Prisma:
Troubleshooting
Connection refused
Connection refused
Issue: Cannot connect to databaseSolutions:
- Verify connection string format
- Check database is running (
docker psfor Docker) - Confirm firewall/network access
- For cloud providers, whitelist your IP address
SSL/TLS errors
SSL/TLS errors
Issue: SSL certificate validation failsSolutions:
- Add
?sslmode=requireto PostgreSQL URLs - Add
?sslaccept=strictto MySQL URLs - For self-signed certificates, use
?sslmode=disable(dev only)
Authentication failed
Authentication failed
Issue: Username/password rejectedSolutions:
- Verify credentials are correct
- Check database user has proper permissions
- For cloud providers, ensure database user is created
- URL-encode special characters in passwords
Migrations fail
Migrations fail
Issue: Schema migrations don’t applySolutions:
- Check connection string is valid
- Ensure database exists
- Verify migration files are in correct location
- For Drizzle, run
bun run db:generatefirst
Next steps
Project structure
Learn where database code lives
Examples
See database usage in Todo example
Deployment
Deploy with database providers
Compatibility
Database and ORM compatibility