The backend of this project is built using Express and Node.js, written in TypeScript. It utilizes the Typegoose library for MongoDB database management. The API enables CRUD operations on articles and queries. Articles store summaries, content, and timestamps for efficient retrieval and management of information.
To install the project dependencies, ensure you have Yarn installed and follow these steps:
- Clone this repository to your local machine.
- Navigate to the project directory.
- Run yarn to install all dependencies
Important: Ensure you have Node.js version >18.17 installed on your system.
- Create a
.env
file in the project directory. - Inside the
.env
file, define the necessary environment variables as per your configuration.
PORT = 4000
API_VERSION_ROUTE = /api/v1
OPENAI_API_KEY = sk-proj-<Your API KEY>
MONGO_DB_URI = mongodb+srv://<Username>:<Password>@...mongodb.net
It's important to set the variables PORT
and API_VERSION_ROUTE
as i show you to for proper usage.
- Run the development server with the following command:
yarn dev
While this backend is deployed on Render, it's recommended to use it locally for optimal interaction with the frontend. However, if you wish to explore the deployed version, you can access it via the provided link.