The application can be run in development or production mode by applying the following steps.
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
In order to run the application in development mode, apply the following steps:
- Run Docker desktop.
- Open command prompt window and clone the project from GitHub using the following command:
git clone https://github.com/yildizmy/e-wallet.git
- Change the current directory to the project directory where the
docker-compose.yml
file located in:
cd e-wallet
- 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
- After database container starts on Docker, open the project using
IntelliJ IDEA
or another IDE (opene-wallet\backend
folder rather thane-wallet
folder). Then selectJava 17
version viaFile > 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.
- Open another command prompt window/tab and change the current directory to the frontend project:
cd e-wallet/frontend
- 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.
username: johndoe
password: johnd@e
role: admin
username: lindacalvin
password: lindac@lvin
role: admin
username: jeffreytaylor
password: jeffreyt@ylor
role: user
In order to run the application in production mode, apply the following steps:
- Run Docker desktop.
- Open command prompt window and clone the project from GitHub using the following command:
git clone https://github.com/yildizmy/e-wallet.git
- Change the current directory to the project directory where the
docker-compose.yml
file is located:
cd e-wallet
- 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}>
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.