Takeaways
By the end of this section, you will be able to:- Start the Next.js development server
- Test the basic application functionality
- Verify that your database and environment are working correctly
- Understand the current application structure
Start the Development Server
Now that you have your database and environment variables configured, let’s start the development server and test your application.1
Start the server
Multiple terminals: If you have Drizzle Studio running in your current
terminal, create a new terminal tab/window to run the development server. This
allows both services to run simultaneously for local development.
2
Check for success
You should see output similar to:
Terminal
3
Access the application
- Open your browser
- Navigate to
http://localhost:3000
- You should see the application homepage that says:
Hello, world!
Development URL: The application will be available at
http://localhost:3000
Hot Reload: Any changes you make to the code will automatically refresh
the browser
Troubleshooting Common Issues
Development server won't start
Development server won't start
Common solutions:
- Check port conflicts - Ensure port 3000 is not in use by another application
- Verify dependencies - Run
npm install
to ensure all packages are installed - Check environment variables - Ensure your
.env
file is in the project root - Check Node.js version - Ensure you’re using Node.js 18 or higher
Database connection errors
Database connection errors
Check these items:
- Verify DATABASE_URL - Ensure your connection string is correct in
.env
- Check database status - Verify your Vercel/Neon database is active
- Test connection - Try running
npm run db:studio
to test database connectivity - Check migrations - Ensure you ran
npm run db:migrate
successfully
Build or compilation errors
Build or compilation errors
Solutions:
- TypeScript errors - Check for missing dependencies or type definitions
- Import errors - Ensure all required packages are installed
- Syntax errors - Check for any syntax issues in your code
- Clear cache - Try deleting
node_modules
and runningnpm install
again
Reflection Questions
Take a moment to reflect on what you’ve learned. Think about it first and then use AI to refine your answers.Next Steps
Congratulations! You’ve successfully set up your development environment and verified that everything is working. In the next module, you’ll:- Understand the database schema and existing table structure
- Add vector storage capabilities to support embeddings
- Implement database migrations for the enhanced schema