Prerequisites
Before you begin, ensure you have the following installed on your machine:- Node.js (v18 or higher)
- npm, yarn, or bun package manager
- Git
Installation
Install dependencies
Install the required dependencies using your preferred package manager:
The project includes these key dependencies:
- Next.js 13.5.6 (React framework)
- Clerk for authentication
- Pinecone for vector database
- OpenAI for AI capabilities
- Stripe for payments
- AWS SDK for S3 storage
- Drizzle ORM with Neon database
Configure environment variables
Set up your environment variables by creating a Add all required API keys and configuration values to this file.
.env file in the root directory. See the Environment Variables page for detailed configuration.Set up the database
Run the database migrations using Drizzle Kit:This will create the necessary tables in your Neon database.
Development Scripts
The following npm scripts are available:| Script | Command | Description |
|---|---|---|
dev | npm run dev | Starts the development server with increased memory allocation |
build | npm run build | Creates an optimized production build |
start | npm start | Runs the production build locally |
lint | npm run lint | Runs ESLint to check code quality |
Project Structure
Troubleshooting
Memory Issues
If you encounter memory errors during development, the project already includes increased memory allocation in the dev script. If you still face issues, you can increase it further:Database Connection
If you have issues connecting to the database:- Verify your
DATABASE_URLis correctly set in.env - Ensure your Neon database is accessible
- Check that you’ve run the Drizzle migrations
API Key Errors
If you see authentication or API errors:- Double-check all API keys are correctly set in
.env - Ensure there are no extra spaces or quotes around the values
- Restart the development server after changing environment variables