This project is a mock interviewing tool built with AI. It consists of a Go server and a React TypeScript client with Vite.
The server is built with Go 1.22 and is located in the server
directory. It requires the following environment variables:
OPENAI_API_KEY
: Your OpenAI API keyELEVENLAB_API_KEY
: Your ElevenLab API key for alternative speech engineDB_PATH
: Path to SQLite database
These configurations are optional:
PORT
: The port number for the server to runCORS_ALLOWED_ORIGINS
: Allowed origin to call the APIsCORS_ALLOWED_METHODS
: Allowed methods of the APIs callCORS_ALLOWED_HEADERS
: Allowed headers of the APIs call
The client is built using React TypeScript with Vite and Node.js 20. It is located in the client
directory. It has one optional environment variable:
VITE_BACKEND_URL
: URL of the backend server
To run the project using Docker and docker-compose, follow these steps:
-
Make sure you have Docker and docker-compose installed on your system.
-
Clone the repository and navigate to the project root directory.
-
Create a
.env
file in the root directory with the following content:OPENAI_API_KEY=your_openai_api_key_here ELEVENLAB_API_KEY=your_openai_api_key_here DB_PATH=your_database_path_here
-
Set the
VITE_BACKEND_URL
in client Dockerfile accordingly if you change the server's port mapping -
Run the following command to build and start the containers:
docker-compose up --build
This will start the MongoDB database, the Go server, and the React client.
-
Access the client application by opening a web browser and navigating to
http://localhost:3000
. -
To stop the containers, use the following command:
docker-compose down
When running the server using the provided docker-compose.yml
, the DB_PATH
is optional.
If there the server's port is changed or if client and server are deployed in separate domain, please update the BACKEND_URL
arguments on the client's Dockerfile.
For development purposes, you can run the server and client separately:
- Navigate to the
server
directory. - Run
go run main.go
to start the server.
- Navigate to the
client
directory. - Run
npm install
to install dependencies. - Run
npm run dev
to start the development server.
Remember to set the required environment variables when running the applications outside of Docker.
server
: Contains the Go server codeclient
: Contains the React TypeScript client codedocker-compose.yml
: Defines the multi-container Docker applicationDockerfile
in each directory: Defines how to build the Docker images for server and client