In order to build the project you'll need yarn and nodejs installed
Please refer to https://classic.yarnpkg.com/en/docs/install On windows, install chocolately when asked to
If you have nvm
installed on your system, you can simply nvm use
in the root directory to pick up the correct version provided in the .nvmrc
file.
# init submodules dependencies
git submodule update --init --recursive
# install dependencies
$ yarn install
# serve with hot reload at localhost:3000
$ yarn dev
# generate static project
$ yarn build
For detailed explanation on how things work, check out Nuxt.js docs.
To enable MSW change the value of your env. variable MSW
to 'enable'
Additionnal configuration examples for deployment are availables under /deploy_configurations
# Create your env. file
$ cp .env.example .env
Additionnal configuration examples for deployment are availables under /deploy_configurations
The .env
file must contain:
🚨 Mandatory API URLs
The location API
LOCATION_API=https://api3.geo.admin.ch/rest/services/api/SearchServer?searchText=yverdon-les-bains&type=locations
The main GeoCity API
GEOCITY_API=https://form-preprod.mapnv.ch/rest
🚀 For production
Needed if the application is not deployed on the root
PRODUCTION_PATH=/your-custom-path/
🔍 Filtering events from GeoCity API
📅 First event date
GEOCITY_API_EVENTS_START=2020-01-01
📅 Last event date
GEOCITY_API_EVENTS_END=2050-12-01
📅 Only display events that occure in the future
GEOCITY_API_SHOW_ONLY_FUTURE=true
🏢 Community / City / Office for which events are displayed
GEOCITY_API_ADMINISTRATIVE_ENTITES=3
🔗 Link to the Django app login page
CTA_LINK=
🌍 / 📆 Choose the default view, value can be 'calendar' or 'map'
DEFAULT_VIEW='calendar'
👀 Show or hide the header and footer
DISPLAY_FOOTER_AND_HEADER=true
📆 Choose the default calendar visualisation mode. Value can be : 'default', timeGridDay', 'timeGridWeek', 'dayGridMonth', 'listMonth'.
DEFAULT_CALENDAR_MODE='default'
The CHANGELOG.md
file is automatically update at the root of the project based on the commit messages as long as they follow the Angular commit guidelines. It will also bump the version number in the package.json
, run the generate command above, commit, tag and push the changes. This process is interactive and you’ll be able to skip steps manually if you like.
To release a new version run:
yarn release [patch|minor|major|version_number]
By default the version bump is automatically determined based on the commits messages.
Read more in the release-it documentation.
To deploy a build of the project, simply replace the blank command in the package.json
, under scripts -> deploy
. This will be automatically invoked at the end of the release process described above.
An example of a simple deploy command using rsync
:
"deploy": "rsync -avz --delete --exclude='.*' dist/ [email protected]:/var/www/html/my-project"
You can also deploy manually at any time by running:
yarn deploy
🚨 Notice the --delete
flag which means all files not present locally will be deleted on the remote server. Be careful, this can leads to data loss!
🚨 Make sure that the static server file is listed in the ALLOWED_CORS environment variable in the backend config https://github.com/yverdon/geocity/blob/main/env.demo#L45