WiChat is a project developed for the Software Architecture course (2024/2025). It is a distributed system composed of several services working together to build a question game application.
Meet the amazing team behind WiChat:
Contributor | Profile |
---|---|
Adrián Mahía | |
Andrés Carballo | |
Bruno Pérez | |
Miguel Gutiérrez |
- User Service: Manages user creation and storage.
- Auth Service: Handles user authentication.
- LLM Service: Interfaces with a Large Language Model.
- Gateway Service: Acts as a public proxy for the other services.
- Question Service: Gathers information from Wikidata and generates questions.
- Webapp: A React frontend that interacts with the backend via the gateway.
The user and auth services share a MongoDB instance accessed via Mongoose.
git clone [email protected]:arquisoft/wichat_es4c.git
In order to use the LLM integrations (Gemini and Empaphy), you must provide a valid API key in two .env
files:
- In the
webapp/
directory (fornpm start
):
REACT_APP_LLM_API_KEY="YOUR-API-KEY"
- In the project root (for Docker Compose):
LLM_API_KEY="YOUR-API-KEY"
Note: These files are ignored by Git and should not be committed. When deploying, the key must be added as a repository secret (
LLM_API_KEY
) to be used in GitHub Actions.
docker compose --profile dev up --build
Start the database:
docker run -d -p 27017:27017 --name=my-mongo mongo:latest
Or use services like MongoDB Atlas.
Then launch each service individually:
# Inside each service folder:
npm install
npm start
Finally, run the webapp the same way:
cd webapp
npm install
npm start
The application will be available at
http://localhost:3000
.
The application can be deployed using a virtual machine and GitHub Actions. The recommended setup includes:
- Ubuntu 20.04+ (preferably 24.04)
- Docker & Docker Compose
- Open ports:
3000
(webapp),8000
(gateway)
You can set up Docker on your VM using:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker ${USER}
A GitHub Actions workflow automatically deploys the app when a new release is published. It builds, tests, pushes images, and deploys via SSH.
Example of the deploy step:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
wget https://raw.githubusercontent.com/arquisoft/wichat_es4c/master/docker-compose.yml -O docker-compose.yml
docker compose --profile prod down
docker compose --profile prod up -d --pull always
Secrets required:
DEPLOY_HOST
DEPLOY_USER
DEPLOY_KEY