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:

journey's People

Contributors

ghoster981 avatar stefanocudini avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

journey's Issues

Unify colors related functions

There are several functions related to choosing styles that can be unified: getModeColor, getMapColor, toModeColor, toModeBorderColor, toModeBorder.

It's possible that they aren't even used.

Two request are made to otp

dispatch(nonRealtimeRoutingResponse({ response: json, searchId }))
there's many things related to this non realtime response, and there are several implications in many parts of the code so it's not easy to remove all the related code. Once the implications of this are clear it should probably be removed.

Create history for main panel

Now main pannel goes back only to the initial state, it would be useful to keep track of the last open viewer and go back to that.
E: if you open the stop viewer and then go to the trip viewer pressing back would take you to the initial page

build with Node v18

docker fail at build:

> [6/9] RUN yarn install && yarn build:                                                                                                                                       
#10 0.425 yarn install v1.22.19                                                                                                                                                
#10 0.525 [1/4] Resolving packages...                                                                                                                                          
#10 1.128 [2/4] Fetching packages...                                                                                                                                           
#10 21.31 warning [email protected]: Invalid bin field for "mini-css-extract-plugin".                                                                              
#10 27.09 [3/4] Linking dependencies...
#10 27.09 warning " > [email protected]" has unmet peer dependency "react-addons-shallow-compare@>=0.14".
#10 27.10 warning " > [email protected]" has incorrect peer dependency "node-sass@^4.0.0".
#10 27.10 warning "semantic-release > @semantic-release/github > @octokit/rest > @octokit/[email protected]" has unmet peer dependency "@octokit/core@>=3".
#10 27.10 warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
#10 34.43 [4/4] Building fresh packages...
#10 36.78 error /journey/node_modules/node-sass: Command failed.
#10 36.78 Exit code: 1
#10 36.78 Command: node scripts/build.js
#10 36.78 Arguments: 
#10 36.78 Directory: /journey/node_modules/node-sass
#10 36.78 Output:
#10 36.78 Building: /usr/local/bin/node /journey/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
#10 36.78 gyp info it worked if it ends with ok
#10 36.78 gyp verb cli [
#10 36.78 gyp verb cli   '/usr/local/bin/node',
#10 36.78 gyp verb cli   '/journey/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js',
#10 36.78 gyp verb cli   'rebuild',
#10 36.78 gyp verb cli   '--verbose',
#10 36.78 gyp verb cli   '--libsass_ext=',
#10 36.78 gyp verb cli   '--libsass_cflags=',
#10 36.78 gyp verb cli   '--libsass_ldflags=',
#10 36.78 gyp verb cli   '--libsass_library='
#10 36.78 gyp verb cli ]
#10 36.78 gyp info using [email protected]
#10 36.78 gyp info using [email protected] | linux | x64
#10 36.78 gyp verb command rebuild []
#10 36.78 gyp verb command clean []
#10 36.78 gyp verb clean removing "build" directory
#10 36.78 gyp verb command configure []
#10 36.78 gyp verb find Python Python is not set from command line or npm configuration
#10 36.78 gyp verb find Python Python is not set from environment variable PYTHON
#10 36.78 gyp verb find Python checking if "python3" can be used
#10 36.78 gyp verb find Python - executing "python3" to get executable path
#10 36.78 gyp verb find Python - "python3" is not in PATH or produced an error
#10 36.78 gyp verb find Python checking if "python" can be used
#10 36.78 gyp verb find Python - executing "python" to get executable path
#10 36.78 gyp verb find Python - "python" is not in PATH or produced an error
#10 36.78 gyp verb find Python checking if "python2" can be used
#10 36.78 gyp verb find Python - executing "python2" to get executable path
#10 36.78 gyp verb find Python - "python2" is not in PATH or produced an error
#10 36.78 gyp ERR! find Python 
#10 36.78 gyp ERR! find Python Python is not set from command line or npm configuration
#10 36.78 gyp ERR! find Python Python is not set from environment variable PYTHON
#10 36.78 gyp ERR! find Python checking if "python3" can be used
#10 36.78 gyp ERR! find Python - "python3" is not in PATH or produced an error
#10 36.78 gyp ERR! find Python checking if "python" can be used
#10 36.78 gyp ERR! find Python - "python" is not in PATH or produced an error
#10 36.78 gyp ERR! find Python checking if "python2" can be used
#10 36.78 gyp ERR! find Python - "python2" is not in PATH or produced an error
#10 36.78 gyp ERR! find Python 
#10 36.78 gyp ERR! find Python **********************************************************
#10 36.78 gyp ERR! find Python You need to install the latest version of Python.
#10 36.78 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#10 36.78 gyp ERR! find Python you can try one of the following options:
#10 36.78 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#10 36.78 gyp ERR! find Python   (accepted by both node-gyp and npm)
#10 36.78 gyp ERR! find Python - Set the environment variable PYTHON
#10 36.78 gyp ERR! find Python - Set the npm configuration variable python:
#10 36.78 gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#10 36.78 gyp ERR! find Python For more information consult the documentation at:
#10 36.78 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#10 36.78 gyp ERR! find Python **********************************************************
#10 36.78 gyp ERR! find Python 
#10 36.78 gyp ERR! configure error 
#10 36.78 gyp ERR! stack Error: Could not find any Python installation to use
#10 36.78 gyp ERR! stack     at PythonFinder.fail (/journey/node_modules/node-sass/node_modules/node-gyp/lib/find-python.js:302:47)
#10 36.78 gyp ERR! stack     at PythonFinder.runChecks (/journey/node_modules/node-sass/node_modules/node-gyp/lib/find-python.js:136:21)
#10 36.78 gyp ERR! stack     at PythonFinder.<anonymous> (/journey/node_modules/node-sass/node_modules/node-gyp/lib/find-python.js:179:16)
#10 36.78 gyp ERR! stack     at PythonFinder.execFileCallback (/journey/node_modules/node-sass/node_modules/node-gyp/lib/find-python.js:266:16)
#10 36.78 gyp ERR! stack     at exithandler (node:child_process:427:5)
#10 36.78 gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
#10 36.78 gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
#10 36.78 gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
#10 36.78 gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
#10 36.78 gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
#10 36.78 gyp ERR! System Linux 5.15.0-71-generic
#10 36.78 gyp ERR! command "/usr/local/bin/node" "/journey/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
#10 36.78 gyp ERR! cwd /journey/node_modules/node-sass
#10 36.78 gyp ERR! node -v v18.15.0
#10 36.78 gyp ERR! node-gyp -v v7.1.2
#10 36.78 gyp ERR! not ok 
#10 36.78 Build failed with error code: 1
#10 36.78 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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.