Setting Up Your Database ⚡️
Learn how to set up your database with popular providers for your Indie Kit project
Setting Up Your Database ⚡️
Indie Kit supports multiple database providers. Choose the one that best fits your needs! 🚀
Setting up Neon (PostgreSQL) 🎯
-
Create a Neon Account 👤
- Go to neon.tech
- Click "Sign Up" and create your account
- You can use GitHub for quick signup
-
Create a New Project 📦
- Click "New Project" in your Neon dashboard
- Choose a name for your project
- Select the region closest to your users
- Click "Create Project"
-
Get Your Connection String 🔗
- Find the connection string in your project dashboard
- Make sure to use the full connection string with your credentials
💡 Pro Tip
Neon offers a generous free tier perfect for development and small projects. You can always upgrade as your project grows!
Configuring Your Project 🛠️
- Set Up Environment Variables 📝
- Open your
.env
file - Add your database connection string:
- Open your
Syncing Database Schema 🔄
-
Push Schema to Database 🚀
This command will:
- Connect to your database
- Create all necessary tables
- Sync your schema changes
-
Verify Setup ✅
- Start your development server
- Your app should now connect to the database
- Check the console for any connection messages
Note: Indie kit uses "JWT" session strategy by default, though you can use "Database" session strategy if you want to. Read more about it here.
If you want to use your own hosted postgresql database, you may need to set following in db.ts
file.
Troubleshooting 🔍
If you encounter any issues:
-
Connection Issues 🌐
- Verify your connection string is correct
- Check if your IP is allowed in database settings
- Ensure your database user has proper permissions
-
Schema Sync Issues 📊
- Check if
drizzle.config.ts
is properly configured - Verify your schema files are correctly exported
- Look for any console errors during schema push
- Check if
Next Steps 🎯
- Set up your database indexes for better performance
- Configure database pooling if needed
- Consider setting up database backups
- Explore your database provider's dashboard for monitoring
Now your Indie Kit app is connected to your chosen database! Ready to start building? 🚀