Coder Social home page Coder Social logo

ong-zijian / esd_tour_project Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.88 MB

Merlion Tour is part of our group's ESD project. We are tasked to create backend architecture with Flask microservices and SOA framework. The project is implemented with a MySQL database and completed with Vue.js as the frontend.

Home Page: https://www.youtube.com/watch?v=8vRbRofNPfQ

JavaScript 2.62% Python 69.07% HTML 2.73% Vue 22.45% Dockerfile 2.31% CSS 0.79% Ruby 0.02%
flask flask-sqlalchemy mysql vue vuejs

esd_tour_project's Introduction

ESD Merlion Tour Project

Merlion Tours is a web platform that operates on a Microservice-oriented architecture. This enterprise solution aims to connect prospective tourists with tour guides.

The project uses a local MySQL database with the source file attached to the SQL_Scripts folder. The file is called tourDBdata.sql.

To import the file:

1. Start up wamp server
2. Go to localhost 
3. Select phpmyadmin
4. On the tabs above, select import
5. Select the add button and attach the <folder> and click go
6. Check that the import is done properly by finding the database on the left side menu.
7. You should see "tourdb" imported with 4 number of tables

Troubleshoot:

Before starting the service:

  • Mac users should check their root account if a password is required. If password is required, use root:<your Wamp password in the urls for .env and docker-compose.yml
  • If any of the files give you any issues like npm modules not installed, run npm install to install all the dependencies.

Running the microservices:

  • The microservices are running on docker-compose containerised.
  • To start, make the changes to the docker-compose.yml file:
    1. change all the image from /ESDtour... to /ESDtour....
    2. check the MySQL port to be your port
    3. check your WAMP root access or user is213 access. If the access is not set, use

Frontend:

The frontend is a simple Vue.js cli frontend. To start the frontend, it is as simple as starting up the Vue local server.

  1. Run npm run serve to start up the Vue.js frontend.
  2. If it doesn't work, you can follow the Vue troubleshoot:
    • Ctrl + c to stop vue services
    • Run npm run build to build the local Web application
    • Start up Vue again using npm run serve

Packages

The projects uses some packages and libraries to make it work. In the event that npm install and the requirements.txt failed to install everything, here is a list of commands to install the other packages beyond the lab.

pip install python-dotenv python -m pip install requests python -m pip install request python -m pip install pyTelegramBotAPI python -m pip install python-telegram-bot python -m pip install -U Werkzeug

esd_project_template

First, run the following statements in your

terminal to install the following python packages

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

Encodes DateTimes into a numeric format

npm install moment from 'moment'

Stripe API support

npm install stripe

Kong API Gateway and Konga setup

Konga

  1. Access http://localhost:1337 in a browser to create an admin user for Konga Username: admin Email: Password: adminadmin

  2. Sign in

  3. Connect Konga to Kong by creating a new connection Name: default Kong Admin URL: http://kong:8001

Kong

  1. Add a new service Name: tourapi Url: http://tour.v1.service:5002 Leave the defaults for the rest Then, click “SUBMIT SERVICE” button at the end of the page.

  2. Click on the “bookapi” service, then the Routes tab.

  3. Add a new route. Paths: /api/v1/tour (ensure no space before or after; MUST press “Enter”) Methods: GET (MUST press “Enter”) Then, click “SUBMIT ROUTE” button at the end of the page.

  4. Open the UPSTREAMS page

  5. Create an upstream (a virtual hostname) Name: tour.v1.service Then, click “SUBMIT UPSTREAM” button at the end of the page.

  6. Click DETAILS, then the Targets tab

  7. Add a target Target: tour-service-1:5002 Then, click “SUBMIT TARGET” button.

  8. Add another target Target: tour-service-1:5003 Then, click “SUBMIT TARGET” button.

Telegram Bot

insert the API token in the .env file in backend_log "6017383619:AAGCxlw36LUABFUBsbEdJ-48qWm9VsvpTak"

go to backend_log and run py telegram.py and py bot2.py

go to the route https://t.me/ESD_Tours_bot to start and input the booking ID to get the tour info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.