Skip to content

Latest commit

 

History

History
172 lines (110 loc) · 4.55 KB

how_to_run.md

File metadata and controls

172 lines (110 loc) · 4.55 KB

How to run?

The application can be run in development or production mode by applying the following steps.

Prerequisites

The following apps should be installed before running the application:

  • A command line app
  • Docker Desktop

Note

For more information regarding the system requirements, etc. refer to the following pages:
Install on Mac
Install on Windows
Install on Linux


Running app in Development mode

In order to run the application in development mode, apply the following steps:

  1. Run Docker desktop.

  1. Open command prompt window and clone the project from GitHub using the following command:
git clone https://github.com/yildizmy/e-wallet.git

  1. Change the current directory to the project directory where the docker-compose.yml file located in:
cd e-wallet

  1. Run the following command to compose and start up database container of the application on Docker.

Note

If you want to use different environment variables than predefined, you can update them via .env file located in the project root before running this command.

docker compose up --build

  1. After database container starts on Docker, open backend project in using IntelliJ IDEA (open e-wallet\backend folder rather than e-wallet folder). Then select Java 17 version via File > Project Structure > Project > SDK menu and run the application.

Important

If Lombok requires enabled annotation processing dialog appears at this stage, click Enable annotation processing button.


  1. Open another command prompt window/tab and change the current directory to the frontend project:
cd e-wallet/frontend

  1. Run the following commands respectively:
npm install
npm start

At this step, the application starts on your default browser (http://localhost:3000/) and can be tested. By using Postman, etc. API endpoints can also be tested. For this purpose, see the details on How to test? section.


Tip

For logging into the application, the accounts given in the "User Accounts" section can be used or a new account can be created via sign up page.

User Accounts

username: johndoe
password: johnd@e
role: admin

username: lindacalvin
password: lindac@lvin
role: admin

username: jeffreytaylor
password: jeffreyt@ylor
role: user

Running app in Production mode

In order to run the application in production mode, apply the following steps:

  1. Run Docker desktop.

  1. Open command prompt window and clone the project from GitHub using the following command:
git clone https://github.com/yildizmy/e-wallet.git

  1. Change the current directory to the project directory where the docker-compose.yml file is in:
cd e-wallet

  1. Run the following command:

Warning

Before running this command, if exists, delete previously composed containers (db, backend, frontend), images (e-wallet-backend, e-wallet-frontend) and volumes (e-wallet_db-data) belonging to the application. On the other hand, if the app is running on IntelliJ IDEA, stop it to prevent a possible port error.

docker compose -f docker-compose.yml -f docker-compose.prod.yml up --build

By running this command, application and database containers are built and start up. After this process is completed, the application will be available on http://localhost:3000 and can be tested. By using Postman, etc. API endpoints can also be tested. For this purpose, see the details on How to test? section.


Tip

For connecting to the application database, the following url and the credentials given in the .env file can be used.

url: jdbc:postgresql://localhost:5432/<${db_name}>

Troubleshooting

If there is any process using the same port of the application, "ports are not available" or "port is already in use" errors might be encountered. In this situation, terminating that process and restarting the related containers will fix the problem. If the problem continues, delete the containers (db, backend and frontend) and re-run the docker compose command in the previous step.


Documentation

docker compose up