Code Monkey home page Code Monkey logo

journey's Introduction

Openmove Journey

OpenTripPlanner Responsive Web Interface

journey web app

Preamble

This project is an Openmove customization of the library otp-react-redux and otp-ui

initially forked from: trimet-mod-otp.

Development continued on the Mentor project.

cloned from V3.3.0 in branch

Development Setup and Configurations

  1. Ensure that Yarn (v1.9+) and Node.js (v8.9+) are installed locally.

  2. Clone the journey repository:

git clone https://github.com/openmove/journey.git

optionally you can run local instance of OpenTripPlanner and other services

docker-compose up -d otp

Nodejs compatibility

switch to project node version:

nvm install
nvm use
node --version

generation of config.yml

edit .env file if needed

API_HOST=https://tripplanner.openmove.com
API_PATH=/otp/routers/default
API_PORT=443
GEOCODER_BASEURL=http://localhost:8088

apply the new .env file:

source .env

after changed some env var restart using yarn genconfig && yarn start or rebuild journey docker image

yarn install

in JOURNEY_THEME path:

cd journey-customs/meridian
npm install

only first time generate src/config.yml from environment vars and base /config.yml file

npm run genconfig
yarn start

browse http://localhost:8081/

  1. Install dependencies using Yarn:
yarn install
  1. Update the configuration file, src/config.yml, as needed.
  • page title
  • base URL path,
  • OTP API,
  • map base layers and overlays,
  • enabled travel modes, and
  • other settings.

See config.yml comments for details.

Development:

Running a local test instance

Run the start command with Yarn to deploy the application locally for testing. This command uses webpack-dev-server and deploys to http://localhost:8080:

cd src
yarn start

Building a bundle for production deployment

Run the build command with Yarn to bundle the application for production deployment. This command uses webpack running in production mode and produces minified/optimized code:

cd src
yarn build

This will build three files in the dist/ directory: index.html, bundle.js, and styles.css. These files can then be deployed to any public-facing web server. Note: if deploying to a URL subdirectory, the path must match the reactRouter.basename property specified in config.yml.

Using custom index.html, css, and js

Both the yarn build and yarn start commands are equipped with the ability to override the default src/index.tpl.html, src/style.scss, and config.js (not to mention the config.yml). This can be handy for injecting some custom scripts/widgets into the html (in a pinch), overriding the default branding, or configuring pieces of config.js like the icons used for modes (e.g., car, bus, or trolley) and the disclaimers shown in the sidebar footer.

To override these files, run the start/build command with any of the options specified with an absolute file path to the file override. For example:

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.