Follow these steps to install the AshChat project on your local machine.
Before you begin, ensure you have the following installed:
- Java (version 23 or higher)
- Node.js (version 18 or higher)
- npm (version 10 or higher)
- Bun (version 1.0.27 or higher)
- Git
- Python
- Elixir
- Docker
- Docker Compose
- Clone the Repository Open your terminal and run the following command to clone the repository:
git clone https://github.com/Victor-Palha/AshChat.git
- Navigate to the Project Directory Change to the project directory:
cd AshChat
- Install Dependencies - Auth Service Install the required dependencies of the backend using npm:
cd ./AshChat/auth_service_spring
./mvnw clean install
- Install Dependencies - Email Service Install the required dependencies using npm:
cd ./AshChat/email_service
npm install
- Install Dependencies - Translate Service Install the required dependencies using pip:
cd ./AshChat/translate_service
source venv/bin/activate
pip3 install -r requirements.txt
- Install Dependencies - Chat Service Install the required dependencies using npm:
cd ./AshChat/chat_service
mix deps.get
- Install Dependencies - Static Files Service Install the required dependencies using bun:
cd ./AshChat/static_files_service
bun install
-
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. -
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.
- 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
- 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
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
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:
-
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. -
Create the key files for the JWT:
cd scripts
chmod +x gen_keys.sh
source gen_keys.sh
- Start the dependencies using Docker:
cd scripts
chmod +x start.sh
source start.sh
- 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!
- Run the project using Docker:
cd AshChat
docker-compose up --build
If you encounter any issues during installation, refer to the FAQ or open an issue on the GitHub repository.