https://github.com/entur/lamassu
Mobility hub
https://github.com/entur/lamassu
ror
Last synced: 9 months ago
JSON representation
Mobility hub
- Host: GitHub
- URL: https://github.com/entur/lamassu
- Owner: entur
- License: eupl-1.2
- Created: 2020-11-23T14:45:48.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-21T13:31:19.000Z (9 months ago)
- Last Synced: 2025-04-21T14:44:47.981Z (9 months ago)
- Topics: ror
- Language: Java
- Homepage:
- Size: 2.02 MB
- Stars: 9
- Watchers: 7
- Forks: 8
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Lamassu
[](https://sonarcloud.io/dashboard?id=entur_lamassu)

Mobility aggregation service based on the [General Bikeshare Feed Specification (GBFS)](https://github.com/MobilityData/gbfs).
### Configuration
`resources/feedproviders.yml` lists GBFS feeds which will be polled by this application:
lamassu:
providers:
- systemId: mysystem
operatorId: MFM:Operator:myoperator
operatorName: My operator
codespace: MFM
url: https://myfavoritegbfsfeeed.com/gbfs.json
language: en
This will use the GBFS auto-discovery at `url` and poll `en` language feeds.
NOTE: codespace is relevant when aggregating entities across systems, to avoid conflicts between IDs.
Every ID (except systemId, which (by GBFS convention) should already be globally unique) is prefixed by this codespace.
At least every operator should be assigned its own unique codespace, assuming operators already maintain data / ID separation accross their feeds.
The codespaced operatorId should comply with the following format `:Operator:`.
#### Configuring Authentication
Some providers may require authentication, e.g. via bearer token, OAuth2 or custom http-headers.
lamassu:
providers:
- systemId: my_oauth2_secured_system
authentication:
scheme: OAUTH2_CLIENT_CREDENTIALS_GRANT
properties:
tokenUrl: "https://mytokenurl.example/"
clientId: my-client-id
clientPassword: my-client-password
scope: optional-scope
...
- systemId: my_bearer_secured_system
authentication:
scheme: BEARER_TOKEN
properties:
accessToken: my-access-token
...
- systemId: my_http_headers_secured_system
authentication:
scheme: HTTP_HEADERS
properties:
x-client-id: my-client-id
# you can use a system variable or an environment variable here
x-api-key: ${my-systemproperty-provided-secret-api-key}
...
Note: Keep in mind you should be cautious about storing your credentials in plain text ! Instead of providing credentials in the feedproviders.yml, it might be more appropriate to provide them via ENV variables/system properties.
### End-points
#### `/gbfs`
List all GBFS feeds available via this API
#### `/gbfs/{system}/{feed}`
GBFS feeds for a specific feed system:
E.g.
/gbfs/boltoslo/free_bike_status
will return the free_bike_status feed for Bolt's scooter service in Oslo.
#### `/graphql`
GraphQL endpoint targeted at end-user clients. Documentation can be explored at `/graphiql`.
#### Consuming
Lamassu supports consuming v2.x and v3.x. The version has to be marked in the feedprovider
config, e.g.:
- systemId: testozon
operatorId: OZO:Operator:testozon
operatorName: Ozon
url: http://test.com/gbfs
version: 3.0
codespace: OZO
language: en
Version defaults to 2.3.
#### Versions
Lamassu produces both v2.3 and v3.0.
v3.0 feeds can be found in the manifest: `/gbfs/v3/manifest.json`.
`manifest.json` replaces the proprietary system discovery endpoint, which will
is now deprecated.
### Development
Requires a locally running redis instance. E.g.:
docker run -p 127.0.0.1:6379:6379 -d redis redis-server
## Codestyle
Lamassu uses [Prettier Java](https://github.com/jhipster/prettier-java). Use `mvn prettier:write` to reformat code before
pushing changes. You can also configure your IDE to reformat code when you save a file.