TreeGPT is a branching conversation application that allows users to explore multiple AI responses to the same prompt, creating a tree-like conversation structure instead of a linear chat.
- Branching conversations with AI
- User authentication system
- Tree visualization of conversation paths
- Branch creation from any point in a conversation
- Conversation history management
- Responsive UI
- Next.js with TypeScript
- Tailwind CSS for styling
- Axios for API calls
- Vercel for deployment
- Node.js/Express server
- MongoDB database
- JWT authentication
- Claude integration
- Render for deployment
- Create a Render account at render.com
- Create a new Web Service
- Connect your GitHub repository
- Set the Root Directory to
backend(if in a subdirectory) - Build Command:
npm install - Start Command:
npm start - Add these environment variables:
MONGODB_URI: Your MongoDB connection stringJWT_SECRET: Secret for JWT token generationANTHROPIC_API_KEY: Your Anthropic API key (optional)FRONTEND_URL: Your frontend URL (e.g., https://treegpt-six.vercel.app)
- Create a Vercel account at vercel.com
- Connect your GitHub repository
- Set the Root Directory to
frontend(if in a subdirectory) - Add environment variables:
NEXT_PUBLIC_API_URL: Your Render backend URLNEXT_PUBLIC_SHARE_ENABLED: "true" (optional feature flag)NEXT_PUBLIC_EXPORT_ENABLED: "true" (optional feature flag)
- Deploy
cd backend
npm install
# Create a .env file with required environment variables
npm startcd frontend
npm install
# Create a .env.local file with NEXT_PUBLIC_API_URL=http://localhost:3001
npm run devIf you're experiencing connection issues between frontend and backend:
- Make sure your environment variables are set correctly
- Check that CORS is properly configured
- Ensure your frontend is using the correct API URL
- Backend: Create a
.envfile in the backend directory - Frontend: Create a
.env.localfile in the frontend directory
treegpt/
├── frontend/ # Next.js frontend
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ └── lib/ # Utility functions
│
└── backend/ # Express backend
├── controllers/ # API route controllers
├── models/ # MongoDB schemas
├── routes/ # API route definitions
├── middleware/ # Express middlewares
└── server.js # Main server file