Merger of this 2 repositories
https://github.com/ESDG3/dr_stocks-frontend
https://github.com/ESDG3/dr_stocks-backend
Prerequisite to run this project
- WAMPServer
- MySQL
- Python
- Docker
- Postman
How to setup the backend services?
-
Unzip the zip file into a folder on your desktop
-
Open the backend folder and navigate to the "dr_stocks-backend/database" folder
-
Start the WAMPServer
-
Open all the SQL files using MySQL (via phpmyadmin or not) and execute/run all the files
-
Next, Open the "docker-compose.yml" file and change the docker id for the images to your own docker id.
-
Make sure you have run the Docker application.
-
Open a cmd terminal and cd to the "dr_stocks-backend/microservices" folder.
-
After, proceed to type this command "docker-compose up -d" and hit enter to run it in the terminal. This will set up all the required services.
-
Wait for about 30 seconds after the containers have been created and started to let the services start up.
-
Next, type this URL "localhost:1337" in your browser to access the KONGA portal.
-
Create an admin account:
Name: admin
Email: Any email
Password: password
-
and set the default connection as this:
Name: default
Kong Admin URL: http://kong:8001
-
Next, proceed to the services page.
*It will be blank since no services has been added
-
Create all this services and routes as stated in the table
(can refer to the included word document: "KONG-Setup.docx"):
You will be redirected to the dashboard page which is the default page:
-
Next, go to the plugin tab for each service and add the Key Auth plugin for all services
EXCEPT LOGIN (userinfoapi-login).
For each Key Auth, under key names, add a key called "apikey" and hit enter and click add plugin at the bottom.
-
Next, navigate to the consumer tab (left nav bar) and create a consumer called "customer" and under the credentials tab, create an api key with the key as this "NTaKvMth2Syfjf30m9dmKWXzANDRqbzh".
-
With this, you can open Postman and test the connection using this URL: http://localhost:8000/api/v1/login?email=maryesther@gmail.com&password=dGVtcDE=
-
Lastly, once all has been configured or if you face any issues, please stop the all the microservices docker containers and start them again and wait for about 1 minute for all the services to complete starting up.
With this, you have successfully configured the backend services! You can proceed to setup the frontend services if you have not done so.
How to setup frontend services?
-
Unzip the zip file into a folder
-
Copy the frontend folder to the "www" folder in your "wamp64" folder on your C: drive eg. "C:/wamp64/www/"
-
Next, make sure that your WAMPServer is running. If it is not, please run it
-
Enter this URL in your browser: http://localhost/dr_stocks-frontend/index.html
-
You can then login using this account details:
Email: ezekieltheprophet55@gmail.com
Password: temp
-
Next, you will be redirected to this main page
*Note if you did not get redirected to the main/dashboard page, this may be due microservices still in the starting up process or KONG api gateway establishing the services and routes. Thus, please wait for around 1 minute before trying to log in again.
With this, you have successfully setup this project and please feel free to try out this project!