Skip to content

Repository files navigation

penr-oz-gpt-chat

GPT Chat Client leveraging Neural Network Service

API Contract

See API.md for the full request/response contracts between the React client, Express proxy, and Neural Network service.

Quickstart Guide

  1. Clone the Repository:

    git clone https://github.com/derinworks/penr-oz-gpt-chat.git
    cd penr-oz-gpt-chat
  2. Setup:

    • Install dependencies:
      npm install
    • Configure environment by copying the example file and editing it:
      cp .env.example .env
      Update .env with your Neural Network service URL:
      VITE_PREDICTION_SERVER_URL=http://localhost:8000
  3. Neural Network Service:

    • Follow instructions on Quick Start Guide
    • Deployed remotely then use a .env file as such to configure url:
    VITE_PREDICTION_SERVER_URL=http://???:8000
  4. Run:

    • Launch React client (Vite dev server only):
      npm start
      App running at http://localhost:3000
    • Build for production (type-check + Vite bundle):
      npm run build
    • Start the proxy server (Express on port 3001):
      npm run server
    • Run client and server together (recommended for development):
      npm run dev
      React client at http://localhost:3000, proxy server at http://localhost:3001 (auto-restarts on server file changes)
    • Preview the production build:
      npm run preview
  5. Testing:

    • Run all unit tests:
      npm test
    • Run tests with coverage report (requires ≥ 80% line/function coverage on core modules):
      npm run test:coverage
    • Tests live alongside source files (src/api.test.ts) and in the server directory (server/index.test.ts).
    • The test stack uses Vitest with Supertest for HTTP assertions and built-in vi.fn() mocks for dependency isolation.

Releases

Packages

Contributors

Languages