Fullmetal Chat Example

Try Fullmetal Chat—a cool chat demo on the web! It uses FullMetal for instant, smart conversations. Easy and fun—experience it now! Dive into the demo—unleash the power of Fullmetal Chat now Github🌐✨
  1. 1.
    Clone the following repository
    git clone https://github.com/m0dE/fullmetal-chat-example.git
    Clone the repository to your local machine, then create the .env file in the root directory of the project
  2. 2.
    Install NPM Packages
    npm install
  3. 3.
    Enter your API key (How to obtain it) Create the FULLMETAL_API_KEY variable in it, and pass your private FULLMETAL key
    // .env
    FULLMETAL_API_KEY=YOUR_API_KEY
  4. 4.
    How to run the project Start frontend server with vite.
    npm run dev:frontend
    Start backend server with nodemon.
    npm run dev:backend
    To use the app with https server, you need to configure the key in vite.config.js file and use following command
    ./vite.config.js
    1
    import { defineConfig } from 'vite';
    2
    import react from '@vitejs/plugin-react-swc';
    3
    4
    // https://vitejs.dev/config/
    5
    export default defineConfig({
    6
    plugins: [react()],
    7
    server: {
    8
    port: '443',
    9
    https: {
    10
    key: 'key.pem',
    11
    cert: 'cert.pem',
    12
    },
    13
    proxy: {
    14
    '/socket.io': {
    15
    target: 'YOUR_WEBSOCKET_LINK', // This is chat backend websocket address. As we are using websocket connection between chat-frontend and chat-backend, we need to configure this proxy in order to make it work
    16
    ws: true,
    17
    },
    18
    },
    19
    },
    20
    });
    21
    npm run dev:secure:backend
    For this chat app, we have used socket.io in backend and socket.io-client on frontend. You need to configure the /socket.io/ proxy in vite.config.js file.
  5. 5.
    Enjoy using the app!
    👍
    If everything goes as planned, the app should be running at http://localhost:5173 and the following page should load.