FightForms is a web application consisting of three modules: frontend, backend, and admin.
Frontend app is a nextjs app that allows users to submit demo application using AI assistant. It uses the backend server to interact with the AI assistant with GraphQL API.
Backend app is a NestJS app that provides a GraphQL API to interact with the AI assistant. It also provides a WebSocket server to interact with the Twilio API or Admin app.
Admin app is a fork of the OpenAPI Realtime Console modified to interact with the backend WebSocket server. That allows users to interact with the AI assistant without the need of the real call for testing purposes.
- Run it and go to the frontend app.
- Submit a demo application.
- You will receive a call from the AI assistant.
- Answer the call and interact with the AI assistant.
You can also use the admin app to interact with the AI assistant without the need of the real call. You need to copy session id from the frontend app and paste it in the admin app and start the conversation.
The application requires several environment variables to be set. These variables are described in detail in the docs/environment.md file.
You need to have OpenAI and Twilio API credentials to run the app. You can sign up for these services and get the required credentials.
Also you need ngrok to expose the WebSocket server to the internet or your own domain with SSL certificate.
To run the FightForms app locally, follow these steps:
-
Clone the repository
git clone [email protected]:433ventures/fightforms.git cd fightforms
-
Install dependencies
npm ci
-
Database
Use your own instance of PostgresSQL or run a Docker container with docker compose:
docker compose up -d
-
Set up environment variables
Create a
.envfile in the root directory and add the required environment variables as described in the docs/environment.md. -
Start the frontend
npm run start:frontend
-
Start the backend
npm run start:backend
-
Start the admin interface
npm run start:admin
The application should now be running locally. You can access the frontend at http://localhost:3001, the backend at http://localhost:3002, and the admin interface at http://localhost:3000.
To run the FightForms app in production using Docker Compose, follow these steps:
-
Prepare Environment Variables: Ensure you have a
.envfile in the root directory containing all the required environment variables as described in the docs/environment.md. -
Build and Start the Application:
docker compose -f docker-compose.deploy.yml up --build -d
This command will build the Docker images and start all the services (frontend, backend, and admin) in detached mode.
-
Access the Application:
- Frontend:
http://<your-domain-or-server-ip>:${FRONTEND_PORT} - Backend:
http://<your-domain-or-server-ip>:${BACKEND_PORT} - Admin Interface:
http://<your-domain-or-server-ip>:${ADMIN_PORT}
- Frontend: