Thank you for investing your time in contributing to our project! Any contribution you make will be reflected live on dokurno.dev/ClashCalendar/ ❤️
If you spot a problem in the project or want to propose a improvement to the project. Search if an issue already exists. If a related issue doesn't exist, you can open a new issue.
Clash Calendar is not your typical web application. The regular backend and frontend terminology doesn't really apply here. Project is separated into two parts. Frontend is the website in docs
folder, running on the Github Pages - dokurno.dev/ClashCalendar/. It is made to simplify process of importing the Google Calendars. Second part is Updater which is a Typescript Node.js script running on my Raspberry Pi 4B with pm2. It handles all of the calendars and updates events. These updates are stored on set of Google Calendars. The only way these two communicate is docs/structure.json
file. This is generated once by updater and is used by website indefinitely.
- Fork the project and clone it to your local machine. Follow the setup guide.
- Before making any changes pull from the remote repository to update your main branch
git pull upstream master
- Create a branch on which you will be working.
git checkout -b update-button-color
- Commit your changes and push it to your fork of the repository.
- Make sure your changes are working locally. Run
npm run build
to check code style. - Create a Pull Request (PR). Make sure to describe the changes that you made and use the
Fixes: #number
keyword if you were working on a issue.
If you don't have Clash Calendar running locally please follow this setup guide:
- Fork this repository using Fork button. This will create a new
repository on your account named
<your username>/ClashCalendar
- Clone this repo to wherever you want:
git clone https://github.com/<your username>/ClashCalendar.git
- Navigate to Google Cloud Console. Create a new project under any name.
- Enable the
Google Calendar API
. This is free API that doesn't require billing account. - If you want to make contributions to the frontend or updater, follow applicable guide(s).
- Navigate to the
docs
directory. - Run this directory under any HTTP server. You can use VS Code Live Server, XAMPP or any other server. This website won't work by just opening the
index.html
in browser! - Navigate to Google Cloud Console. Go to the project that you have created in first setup guide.
- Create a new API Credential of type
API key
. - It is highly recommended to restrict this key. If you want to run this project locally select
IP addresses
and add your IP address. If you want to self-host this project on your domain useHTTP referrers
- Open website in your browser.
- Create a cookie named
GOOGLE_API_KEY
with your API key. You can do it by using any cookie editor extension for you browser.- Optionally you can edit
const DEFAULT_API_KEY
key inmain.js
- Optionally you can edit
- You should now be able to see calendar events from the calendars hosted by Clash Calendar.
- Install newest LTS release of Node.js, it has NPM package manager bundled with it.
- Navigate to Riot Developer Portal.
- Copy your Development API key. Remember that you need to regenerate this key every 24 hours.
- Paste this key into environment variables as
RIOT_API_KEY
. - Navigate to Google Cloud Console. Go to the project that you have created in first setup guide.
- Create a new API Credential of type
Service account
. You can select any name. You don't need to grant any special access for this account. This file is confidential and must not be shared with anyone. - Click on the new service account and select
Keys
tab - Create a new key of
JSON
type. - Save this key to
keys
directory underservice-account.json
name. - Go into the repo folder:
cd ClashCalendar
- Install dependencies:
npm install
- Build the project
npm run build
- Start the updater
npm start
You now have a running instance of Clash Calendar Updater. There are now couple of things that you need to have in mind.
- This app creates 55 calendars, Google puts in a limit of creating 25 calendars in span of couple of hours. That means building calendars structure can take up to a day. If structure is not complete,
structure.json
won't be generated. - Riot Development API key expires every 24 hours and needs to be regenerated.
- If you want to use calendars generated by your updater on website, replace
docs/structure.json
file with./structure.json
.