This project aims to provide online shopping malls to Hong Kong merchants to sell their services and products, and to integrate the Faster Payment System (FPS) to facilitate online transactions, and offer extraordinary shopping experiences to customers.
This project will cover server, web and mobile applications. Currently, the server application have been being developed. Any interested persons are welcome, especially web and mobile developers.
To build and run the applications, make sure you have at least JDK 11 installed.
There are three ways to run the applications.
Note that the account used on local mode is root
(username) and P@55w0rd
(password).
Add the following adresses to the hosts file:
127.0.0.1 hohomalls
127.0.0.1 hohomalls-mongo
127.0.0.1 hohomalls-redis
-
Install MongoDB v4.4.x
-
Start MongoDB on port
27017
-
Enable access control with:
Username: root Password: P@55w0rd Auth database: admin
-
Install Redis v6.2.x
-
Start Redis on port
6379
-
Enable access control with:
# Update redis.conf requirepass P@55w0rd
Make sure port 8080
is available and then start with:
cd hohomalls/server
./gradlew bootRun --args='--spring.profiles.active=local'
-
Install Docker and start it
-
Build the Docker image
cd hohomalls/server ./gradlew clean bootBuildImage
-
Start and stop the containers
cd hohomalls # Create and start containers docker-compose -f docker/compose-local.yml up -d # Stop and remove resources docker-compose -f docker/compose-local.yml down
-
Install Kubernetes and start it
-
Install Docker and start it
-
Build the Docker image
cd hohomalls/server ./gradlew clean bootBuildImage
The following environment variables have to be set before starting the applications:
SPRING_REDIS_PASSWORD=actual_value_1;
SPRING_DATA_MONGODB_USERNAME=actual_value_2;
SPRING_DATA_MONGODB_PASSWORD=actual_value_3;
COM_HOHOMALLS_TOKEN_PUBLIC-KEY=actual_value_4;
COM_HOHOMALLS_TOKEN_PRIVATE-KEY=actual_value_5;
-
Configure the variables in a Docker environment file
cd hohomalls/docker touch .env.prod vi .env.prod
-
Set the correct values in the environment file
REDIS_PASSWORD=actual_value_1 MONGODB_USERNAME=actual_value_2 MONGODB_PASSWORD=actual_value_3 TOKEN_PUBLIC_KEY=actual_value_4 TOKEN_PRIVATE_KEY=actual_value_5
-
Create required directory and files
mkdir -p /opt/docker/mongo/data cp -r hohomalls/docker/mongo /opt/docker mkdir -p /opt/docker/redis/data cp -r hohomalls/docker/redis /opt mkdir /opt/docker/hohomalls
-
Start and stop the containers
cd hohomalls # Create and start containers using production configurations docker-compose --env-file docker/.env.prod -f docker/compose-prod.yml up -d # Stop and remove resources docker-compose --env-file docker/.env.prod -f docker/compose-prod.yml down
Note that if you are using Docker Swarm
, you may want to
use Docker Secrets to manage the above sensitive data. In this case,
you have to update the Docker compose files yourself.
If the applications will be running on the cloud, e.g. AWS VPC, the following is the recommended infrastructure: