Skip to content

An API for the AI coach chat app with real time messaging and database.

Notifications You must be signed in to change notification settings

bohdan-mykhailenko/api_ai-coach-chat

Repository files navigation

AgileGPT API

Overview

Description

This repository contains the source code for the AgileGPt project, which serves as the backend side for the application.

Features

The API provides the following features:

  • Get data: Get history of user messages and AI responses.
  • Real-time data transferring: Allow to send and get data in real-time.

Technologies

Getting Started

To get started with the API, follow these steps:

  1. Clone the repository:
https://github.com/<your-username>/ai_coach_backend.git
  1. Install dependencies:
npm install
  1. Set up PostgreSQL Database:
  • Open the src/config/database.config.ts file and add your PostgreSQL database configuration.
export const db = {
  DB_HOST: 'host',
  DB_NAME: 'name',
  DB_USERNAME: 'username',
  DB_PASSWORD: 'password',
};
  1. Run migration:
npm run migrate
  1. Set openAI secret key:
  • Open the src/config/api-key.config.ts file and add your secret key.
  • Add environment variable API_KEY with your key.
  1. Start the server:
npm run start

Endpoints and messages

The base URL for the API is: https://aicoachbackend-production.up.railway.app

HTTP
Method Endpoint Description Body
GET /messages Get all messages. NULL
Web Socket
Message Description Body
messageToOpenAI Send user input to open AI model
{
 role: string;
 content: string;
}
         
responseFromOpenAI Get response from open AI model null

About

An API for the AI coach chat app with real time messaging and database.

Topics

Resources

Stars

Watchers

Forks