Skip to content

Latest commit

 

History

History
171 lines (145 loc) · 5.03 KB

installation.md

File metadata and controls

171 lines (145 loc) · 5.03 KB

AshChat Installation Guide

Follow these steps to install the AshChat project on your local machine.

Prerequisites

Before you begin, ensure you have the following installed:

Installation Steps Locally and Manually

  1. Clone the Repository Open your terminal and run the following command to clone the repository:
    git clone https://github.com/Victor-Palha/AshChat.git
  1. Navigate to the Project Directory Change to the project directory:
    cd AshChat
  1. Install Dependencies - Auth Service Install the required dependencies of the backend using npm:
    cd ./AshChat/auth_service_spring
    ./mvnw clean install
  1. Install Dependencies - Email Service Install the required dependencies using npm:
    cd ./AshChat/email_service
    npm install
  1. Install Dependencies - Translate Service Install the required dependencies using pip:
    cd ./AshChat/translate_service
    source venv/bin/activate
    pip3 install -r requirements.txt
  1. Install Dependencies - Chat Service Install the required dependencies using npm:
    cd ./AshChat/chat_service
    mix deps.get
  1. Install Dependencies - Static Files Service Install the required dependencies using bun:
    cd ./AshChat/static_files_service
    bun install
  1. Configure Environment Variables Create a .env file in the root directory and add the necessary environment variables. Refer to .env.example for the required variables for the email service, chat service and translate service.

  2. Create key files for the JWT On the root directory, run the following command to create the key files for the JWT:

    cd scripts
    chmod +x gen_keys.sh
    source gen_keys.sh

This will create the private_key.pem and public_ket.pem files in AshChat/auth_service_spring/src/main/resources and AshChat/chat_service/priv/keys.

  1. Run Docker for Dependencies The dependencies for the project are run using Docker and they are defined in the AshChat/docker/docker-compose.yml file. To run the dependencies, run the following command:
    cd scripts
    chmod +x start.sh
    source start.sh

This will start:

  • Redis
  • RabbitMQ
  • MongoDB
  1. Run the Services To run the services, open a new terminal and run the following commands:
  • Auth Service
    cd AshChat/auth_service_spring
    ./mvnw spring-boot:run
  • Email Service
    cd AshChat/email_service
    npm run start:dev
  • Translate Service
    cd AshChat/translate_service
    source venv/bin/activate
    python3 main.py
  • Chat Service
    cd AshChat/chat_service
    chmod +x start.sh
    source start.sh
  • Static Files Service
    cd AshChat/static_files_service
    bun run src/index.ts

Automated Installation

If you don't want to install the project manually, you can use the automated installation script. The script will install the project and run the services for you. But be aware that the script was written for a MacOS environment and may not work on other operating systems.

    cd scripts
    chmod +x local_run.sh
    source local_run.sh

Up docker-compose services:

    cd scripts
    chmod +x start.sh
    source start.sh

Docker Installation

If you want to run the project using Docker, you can use the Dockerfile and docker-compose.yml files provided in the project. To run the project using Docker, follow these steps:

  1. Create the .env file in the root directory of each service and add the necessary environment variables. Refer to .env.example for the required variables for the email service, chat service and translate service.

  2. Create the key files for the JWT:

    cd scripts
    chmod +x gen_keys.sh
    source gen_keys.sh
  1. Start the dependencies using Docker:
    cd scripts
    chmod +x start.sh
    source start.sh
  1. Create a .env file in the root directory of the project and add these environment variables:
  • SMTP_EMAIL
  • SMTP_PASSWORD These variables are used to send emails using the email service, if you don't provide them, the email service will not work! If you do not have an SMTP email, you can create a new one following this Article!
  1. Run the project using Docker:
    cd AshChat
    docker-compose up --build

Troubleshooting

If you encounter any issues during installation, refer to the FAQ or open an issue on the GitHub repository.