A simple travel assistant where users can query a given city and get relevant information about the desired location.
Frontend: the simple UI was built using React
Backend: Node, Express
Below are some stuff you need to ensure before running the project:
- Node
git clone https://github.com/AlmeidaJoao/optimus-travel
To run the backend successfully, you will need to add the following environment variables to your config/.env file
DB_USER
, DB_PASSWORD
, DB_HOST
, DB_PORT
, DB_NAME
, JWT_SECRET
, RATE_API
, OPEN_WEATHER_API
, MAP_BOX_API
But don't worry if you have those, I've got you covered and included them so that you can test things on the go.
Check the Dockerfile
, I left them there just for you 🤫.
Go to the project directory
cd backend
Install dependencies
npm install
Start the server
node src/index.js
To run the frontend successfully, you will need to add the following environment variables to your .env file
REACT_APP_APIHOSTPORT
, this will normally be the URL and PORT where your backend is running.
Go to the project directory
cd frontend
Install dependencies
npm install
Start the server
npm start
For demonstratation purposes the App was deployed on Kubernetes, but you can of course deploy it anywhere. To enable deployment on Kubernetes container images had to be built and pushed to a container registry(DockerHub). Below are the links for the images:
- Build production ready files - instead of running the frontend as a node app, a better approach is building the static files using the command
npm run build
- Dockerfile - contains the instructions to build the container image.
frontend/Dockerfile
For the backend it was straight forward approach, the backend/Dockerfile
has the instructions to build the image - I've included the the environment variables there for
demonstration purposes(🤫 this is our secret)
Having the images built and pushed to the container registry of your choice, write your manifest files and just kubectl
them.
The deployment
directory contains the manifest files used for this specific project.
For each component of the application I've written continuous integration workflows that simplify, the process of image creation and building.
The workflow definitions are on the .github/workflows
directory.
flowchart TD
A[On code push or manual dispatch] -->|Trigger Workflow| B(Build Docker Image)
B --> |Push Image to DockerHub| C[Docker registry]
Manual Dispatch - to allow running the workflow manually whenever needed. This was applied for the frontend
.
If you are just curious to see a running version of the App, check the following link:
- Frontend: Optimus Travel
- API: Optimus Travel API
Documentation regarding the API can be found on the link below: Documentation