This service operates as middleware between Notion documentation and GitHub Copilot's AI assistant, enabling the following functions:
- Fetching documentation from Notion.
- Identifying the requesting GitHub user.
- Crafting a tailored system prompt.
- Communicating with the GitHub Copilot API to generate responses.
- Streaming AI-generated responses back to the client.
This configuration provides users with personalized assistance, harnessing both internal documentation and sophisticated AI capabilities.
Built on Express for efficient HTTP handling, it utilizes the Octokit library to seamlessly interact with the GitHub API and is set up for deployment on Vercel.
-
@octokit/core: A lightweight GitHub API client for Node.js, used for interacting with GitHub's API to authenticate users and retrieve user information.
-
Readable: A built-in Node.js stream interface for reading data, used in this service for efficiently streaming AI-generated responses back to the client.
-
express: A fast, unopinionated, minimalist web framework for Node.js, used for creating the server and handling HTTP requests and responses.
-
axios: A promise-based HTTP client for making requests to external APIs, used for communicating with the Notion API and GitHub Copilot API.
-
dotenv: A zero-dependency module that loads environment variables from a .env file into process.env, used for managing configuration settings securely.
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd notion-documentation-provider
-
Install the dependencies:
npm install
Create a .env
file in the root directory and add the following environment variables:
PORT=3000
Start the server:
npm start
The server will be running on the port specified in the .env
file (default is 3000).
This application is configured to be deployed on Vercel. The configuration is specified in the vercel.json
file.
Follow the step-by-step provided by Github:
This project is licensed under the ISC License. Feel free to customize this README further based on your specific needs.