Event calendar implementation for Varsinais-Suomi
This React based app is designed to work on any web page as an embedded plugin. There's a bunch of data-attributes that we can use to configure the initial settings for the app. This includes settings for the overall app appearance and also query parameters for the event data fetching.
There needs to be two deployed instances of the app. One for the list view and other for showing single event's details. By default when running the npm run build
(or npm start
for dev) command, it will build the list view. The distinctive setting between these two is the data-is-detail-view=""
attribute. For the listing view, this should be set to false
and for the detail page it needs to be set to true
.
Node v16 or newer
Install required NPM packages for both React UI and Embed examples
cd react-ui && npm install && cd ..
cd embed-examples && npm install && cd ..
npm run start-react
npm run start-embed
Note:
- Dev server for react must be running before embed examples can be seen
- To be able to see event detail pages, the embed-examples server must be running
Make a copy of the react-ui/.env
to react-ui/.env.local
. Make sure the .env.local
variables are set correctly:
PORT
: the port where the app is served on.REACT_APP_EMBED_BASE_URL
: URL of your domain where the app will be served on.REACT_APP_EMBED_ENTRY_FILE
: Name of the js file that handles getting correct js and css files for embedding.REACT_APP_LINKEDEVENTS_BASE_URL
: URL of the Linkedevents backend API.REACT_APP_EVENT_DETAIL_BASE_URL
Base URL of your domain for a page with single event's details. Trailing slash is required.
docker compose up
- In the
react-ui/embedEntry.js
file, set correctbaseUrl
variable which should match with yourreact-ui/.env.local
file'sREACT_APP_EMBED_BASE_URL
value. - Create production build:
cd react-ui && npm run build
- Use something like serve to serve the app.