🧑💼 Name | GitHub Username |
---|---|
Daniel Alberto Alonso Fernández | |
David Álvarez Cabezas | |
Alejandro Fernández García | |
Mario García Prieto |
This is a base project for the Software Architecture course (2024/2025). It is a basic application composed of several components:
- User Service: Handles the insertion of new users in the system.
- LLM Service: Communicates with the LLM (Language Learning Model).
- Gateway Service: Acts as a intermediary proxy for the above services.
- Webapp: A React-based web application for login and user management.
- User Registration and Login: Allows users to securely register and authenticate.
- ChatBot: Provides users with hints for game questions.
- Profile Management: Users can update their personal information.
- Rankings: Includes a global ranking of all users' games and a personal ranking where users can access their answers and the correct ones for each game.
- User Management: Administrators have access to a menu to view all registered users and delete any user if needed.
git clone [email protected]:arquisoft/wichat_es1c.git
To enable LLM communication, configure an API key for either Gemini or Empathy. Follow these steps:
-
Create a
.env
file in the webapp directory:REACT_APP_LLM_API_KEY="YOUR-API-KEY"
-
Create another
.env
file in the root directory (next todocker-compose.yml
):LLM_API_KEY="YOUR-API-KEY"
Note: These files are excluded from version control via
.gitignore
. For deployment, add the API key as a repository secret (LLM_API_KEY
).
To start the application using Docker Compose:
docker compose --profile dev up --build
-
Start the database:
docker run -d -p 27017:27017 --name=my-mongo mongo:latest
Alternatively, use a cloud service like MongoDB Atlas.
-
Start the services:
- Navigate to each service directory (
auth
,user
,gateway
) and run:npm install npm start
- Navigate to each service directory (
-
Start the webapp:
- Navigate to the
webapp
directory and run:npm install npm start
- Navigate to the
The app will be available at http://localhost:3000
.
- OS: Linux (Ubuntu 20.04 or higher, recommended 24.04).
- Docker: Installed.
- Ports: Open ports (3000 for the webapp, 8000 for the gateway).
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}
Deployment is automated using GitHub Actions. The process is triggered when a new release is created. The workflow includes:
- Running unit and e2e tests.
- Pushing Docker images to GitHub Packages.
- Deploying the application via SSH.
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice, docker-push-authservice, docker-push-llmservice, docker-push-gatewayservice, docker-push-webapp]
steps:
- 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_es1c/master/docker-compose.yml -O docker-compose.yml
docker compose --profile prod down
docker compose --profile prod up -d --pull always
- DEPLOY_HOST: IP address of the remote machine.
- DEPLOY_USER: User with SSH access.
- DEPLOY_KEY: SSH private key for authentication.
- Frontend: React
- Backend: Node.js, Express
- Database: MongoDB
- Containerization: Docker
- CI/CD: GitHub Actions
- Code Coverage: SonarCloud
- Load Testing: Gatling
- Deployment: Azure