Quick Installation Using Docker

Prerequisite Knowledge

To understand this installation guide you dont need to be an expert but having some basic knowledge of linux terminal commands and Docker is Expected.

Steps for Installation

Step 1: Install docker and docker compose
Step 2: Download Docker file and run it
Step 3 : Assign a Domain name
Step 4 : Enter container and update instance configuration
Step 5 : Submit your market to Nearby Shops
Step 6 : Publish your app on Google Play (Optional)
Step 7 : Login as admin and update Market Configuration

We are assuming that you are installing on a ubuntu based cloud server with IP address & internet access. You can use hosting platforms like Digital Ocean and other such clould platforms. This installation guide will not work on localhost because you need to have real Internet access & IP address.

Step 1: Install docker and docker compose

If you dont have latest version of docker and docker compose please install them using the following official installation guides.

Install the latest version of docker using this link https://docs.docker.com/install/linux/docker-ce/ubuntu/
Install the latest version of docker Compose using this link https://docs.docker.com/compose/install/

Step 2: Download Docker Compose file and run it

Download the docker compose file and run it.

                     Commands
                  
    cd ~
    mkdir nearbyshops
    cd nearbyshops

    wget https://raw.githubusercontent.com/NearbyShops/Nearby-Shops-API/master/docker-compose.yml

    docker-compose up

    Exit container using Ctrl + C or Ctrl + Z  ... If nothing works close the terminal window & start a new terminal
      
                

This is optional. You can also edit the docker-compose.yml file and change the settings like port number, container name to suit your needs.

                    Optional Commands
                  
    sudo nano docker-compose.yml
                
                

Verify Successful Execution : In order to verify and test that we have a successful connection to the api. We will test the endpoints to see if we get any result. The url for the endpoint is
[IP:port]/api/ServiceConfiguration
Replace the IP and port number according to your installation. For example if you are running this jar file on your local computer at port address 80 your url will be localhost/api/ServiceConfiguration when you execute this url in your browser you should see some json output.
Having the output verifies successful execution.

Step 3 : Assign a Domain name

IP addresses can change and are not stable. For stable and long term access to your instance it is always a good idea to assign a domain name to your server. Based on the hosting provider you are using you have to follow their respective methods.

Step 4 : Enter container and update instance configuration

You need to change few api configuration settings like domain name & admin email to ensure that you are able to access your market Instance.

Enter your container and update api configuration.

                     Commands
                  

    docker start nbs_api_container
    docker exec -it nbs_api_container bash

    cd ~/nearbyshops/data 
    
    sudo nano api_config.properties

    Exit container using Ctrl + C or Ctrl + D
                
                

Things to Update

  • Admin Email
  • Domain Name
  • Market ID for FCM
  • admin_email is the field name. Admin email is the email of the market admin. Without providing this you wont be able to access your market and change settings.

    domain_name is the field name and you need to set this equal to your domain name

    market_id_for_fcm is the field name. It should be some unique id that uniquely identifies your market. It is used to enable push notifications.

    Everytime you make a change in the configuration file you need to restart the server in order to ensure that changes are reflected.

                        Commands : Restart Container
                      
      
        docker stop nbs_api_container
    
        docker start nbs_api_container
    
                    
                    

    Step 5 : Submit your market to Nearby Shops

    Save your marketing expenses by getting free access to existing customers of nearby shops app. When you submit your market to nearby shops. Your market gets free access to all the customers of nearby shops app.

    Download Nearby Shops android app from Google Play. Here you will find a + (plus) button on the market screen. Enter your market url (domain name) and make a submission.

    The sample market name could be Daily Supplies in Bali, Indonesia. In the next step we will see how can you change the market name and other settings.

    Step 6 : Publish your app on Google Play (Optional)

    You can customize our android app and connect the app to your Instance and publish it to Google Play. This is optional and isnt mandatory.

    Please note that commercial use of our android app is allowed under Single Market License. But there are few restrictions. Please read our license terms and conditions before any commercial use. https://blog.nearbyshops.org/single-market-license/

    To connect the app with your instance. Clone our android app repository. Then open it with latest stable release of android studio. And search for file "PrefGeneral.java" in the preferences folder. Set multi market mode to false and set default service url equal to your instance domain name.

    More information about how to customize your app and publish on Google Play is given in the article Customize apps.

    Step 7 : Login as admin and update Market Configuration

    Remember the email that you assigned as admin email in the configuration file. You will use this email to login to the nearby shops app.

    After login please select your market and you should be able to see Admin Dashboard in Markets screen. In your admin dashboard you will see Service Configuration. Enter that screen. Set all the fields appropriately & save the settings.

    Follow our tutorials to Learn more !

    To learn more about how to add vendors and use nearby shops. Please follow our tutorials given at this link https://blog.nearbyshops.org/tag/tutorials/

    Facing difficulty in understanding anything ? ... let us help you ! If you have any questions and queries do not hesitate to get in touch with us on our forum