City-of-Helsinki / open-city-helsinki

Mobile app for open cities built with React Native
Other
1 stars 1 forks source link

Open City Helsinki

Open City Helsinki is white-labeled application for City of Helsinki developed on open-city-skeleton repository.

Open City Helsinki has been developed using:

"react": "16.0.0"

"react-native": "0.50.3"

Usage

To start using codebase, clone this repository. It is advisable to keep Skeleton vanilla code in separate branch, named "skeleton" for example. This way it's easier to pull changes to skeleton and merge to feature/master branch of the product repo. Also bugfixes etc are easier to contribute upstream.

Step-by-step tutorial to develop Open City Helsinki

Pre-install requirements:

This step-by-step tutorial's purpose is to help developers to start developing Open City Helsinki application. Check instructios on open-city-skeleton repository how to develop new white-labeled application based on Open City Skeleton.

Architecture

Optional Text

Basic functionalities

Theming and UI customization

In src/config/colors.js change the max, med, min values of the colors object.

More colors can also be added to the object to be used in custom components and modules.

Configuration

Onboarding, tabs, headers, translations and navigation components can be configured with the above instructios and by modifying the App.js file.

To configure each module, check the default configuration for the module shown in open-city-modules documentation. In the file you can change module settings you wish to override by using for example configureFeedback function:

import feedbackConfig from './feedbackConfig.json'

configureFeedback(feedbackConfig)

Functionalities in Open City Helsinki

Onboarding

The Onboarding component holds the choices made in the steps so far in its state and passes it to each step among other props. It receives the steps as an array of React Components. After the last step, the onFinish is called with the final profile object as an argument. When a splash screen is provided, it is shown before the first step. The first step is shown when the splash screen calls the dismiss function.

The following props are passed to each step component:

An example configuration of the onboarding using the helper HoCs and components from open-city-modules repository can be found in the config/onboarding.js file.

Tab navigation

Each tab receives the screenProps props with the following properties:

City selection

The default header has a button that opens a list of other cities' apps.

Profile

The profile tab shows the choices made in the onboarding.

Tunnistamo

Skeleton layer provides functions to communicate with Tunnistamo API and saving authorization details to the device

Troubleshooting

Contributing to open-city-skeleton and open-city-modules

If you've built a new module or feature that you think would support the two base projects, you can merge the changes in the skeleton branch of your forked repository and send a pull request for your changes. If you want to build new modules to your application only, you could fork the modules repository and create a new module there or then just create the needed components straight to your forked project, just as in any other normal React Native project.

instructions to add vanilla skeleton branch: