IANDAI is a backend service that serves as an API, connecting to a MongoDB database and the ChatGPT API. It provides data to a Next.js frontend. This README provides information on setting up and using the IANDAI backend service.
Make sure you have Node.js installed on your machine.
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd iandai
- Install dependencies:
npm install
Create a .env file in the project root and configure the following variables:
# MongoDB Connection String
MONGO_URI=your-mongodb-connection-string
# ChatGPT API Key
OPENAI_API_KEY=your-chatgpt-api-key
# Port for the server
PORT=3000
- app.js: Entry point for the application.
- controllers/: Contains controllers handling business logic.
- routes/: Defines API routes.
- config/: Configuration files (e.g., database connection).
- models/: MongoDB schema models.
- utils/: Utility functions.
To start the server, run the following command:
npm start
The server will start at the specified port in the .env file (default is 3000).