Skip to content

SSC-SDE/fs-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here's a project description for your Next.js-based OpenAPI chatbot using MongoDB and OpenAI's GPT:


AI Chatbot with OpenAPI & Next.js

Overview

This project is a full-stack AI-powered chatbot that utilizes OpenAI’s GPT model to generate dynamic responses based on user input. Built with Next.js, MongoDB, and OpenAPI, the chatbot processes user queries, interacts with OpenAI’s API using tokens, and delivers intelligent responses. The backend is designed to handle authentication, request throttling, and response caching efficiently.

Key Features

  • Next.js Frontend: Provides a seamless and interactive user interface for engaging with the chatbot.
  • MongoDB Integration: Stores user sessions, chat history, and API usage limits.
  • OpenAPI & OpenAI GPT: Uses OpenAPI specifications to communicate securely with OpenAI’s GPT models.
  • Token-Based Authentication: Ensures secure API calls using authentication tokens.
  • Rate Limiting: Prevents excessive API usage with configurable request limits.
  • Real-Time Chat Responses: Processes user input and delivers AI-generated responses instantly.

Tech Stack

  • Frontend: Next.js (React, TailwindCSS)
  • Backend: Node.js, Express, OpenAPI
  • Database: MongoDB (MongoDB Atlas)
  • Authentication: JWT-based security
  • AI Integration: OpenAI API (GPT models)

Project Structure

  • Frontend: Next.js app for user interaction
  • Backend: Express API handling requests & communication with OpenAI
  • Database: MongoDB for storing chat logs and user preferences
  • Authentication: Token-based API access control

Installation & Setup

  1. Clone the repository:
    git clone https://github.com/SSC-SDE/fs-backend.git
    cd fs-backend
  2. Install dependencies:
    npm install
  3. Set up environment variables in a .env file:
    OPENAI_API_KEY=your_openai_key
    MONGO_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret
    
  4. Start the development server:
    npm run dev

Future Enhancements

  • Implement WebSockets for real-time chat updates
  • Add user analytics and chat insights
  • Expand support for multiple AI models

Would you like me to add anything specific, like API route details or database schema? 🚀

Turborepo starter

This is an official starter Turborepo.

Using this example

Run the following command:

npx create-turbo@latest

What's inside?

This Turborepo includes the following packages/apps:

Apps and Packages

  • docs: a Next.js app
  • web: another Next.js app
  • @repo/ui: a stub React component library shared by both web and docs applications
  • @repo/eslint-config: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • @repo/typescript-config: tsconfig.jsons used throughout the monorepo

Each package/app is 100% TypeScript.

Utilities

This Turborepo has some additional tools already setup for you:

Build

To build all apps and packages, run the following command:

cd my-turborepo
pnpm build

Develop

To develop all apps and packages, run the following command:

cd my-turborepo
pnpm dev

Remote Caching

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

cd my-turborepo
npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

npx turbo link

Useful Links

Learn more about the power of Turborepo:

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published