Implementing Juraj Majerik's rides
I aim to walk through Juraj Majerik's implementation of a ride sharing app. I don't aim to add something new but to learn more about simulations and how they are implmented.
Since i aim to learn more about the simulation engine behind the app and not about the various microservices implemented I will implement this locally to avoid the costs and complexity of deploying to the web.
Reference : https://jurajmajerik.com/
Instructions to run
-
Clone the repository into your local computer
-
Make sure you have docker desktop installed
-
Run docker create volume app-db
-
Run docker-compose build
-
Run docker-compose up -d
-
Run the queries in db folder inside the db container that has been created
Run psql -U postgres CREATE TABLE customers (id SERIAL PRIMARY KEY, customer_id uuid UNIQUE, name VARCHAR(255) NOT NULL, active BOOLEAN, location VARCHAR(5) NOT NULL, destination VARCHAR(5) NOT NULL, driver_id uuid UNIQUE); CREATE TYPE status_enum AS ENUM ('idle', 'pickup', 'enroute'); CREATE TABLE drivers (id SERIAL PRIMARY KEY, driver_id uuid UNIQUE, name VARCHAR(255) NOT NULL, status status_enum NOT NULL, location VARCHAR(5) NOT NULL, path TEXT, path_index INTEGER, customer_id uuid UNIQUE, customer_name VARCHAR(255)); /dt to check if tables are created
-
Rerun simulation container
-
Go to http://localhost:8080/
Upon making any changes to frontend
- Delete build folder in frontend
- Run npm run build in frontend directory
- Change back to original directory
- Run docker-compose build
- Run docker-compose up -d
- Go to http://localhost:8080/
- If changes aren't reflected immediately refresh a few times