thaiclubhouse.web.app
Components
-
Backend worker
- Written using Node.js
- Fetches rooms and events from data sources (Facebook, Twitter, Google Forms)
- Saves to data store
- See: automation.js
-
Data store
- Contains information about room and events
- Automatically generated by backend (above)
- See clousehub/thaiclubhouse-data repository
-
Static site generator
- Written using PHP
- Generates a web page for each day
- See gen.php
-
Operational scripts
- Runs the backend, generates the static site, and uploads to Firebase Hosting
- Runs periodically via cron
- See cron.sh
-
Client-side JavaScript
- Enhances the experience of using the app
- See public/js/index.js
Website development
Clone data repository
# Clone data repository
git clone https://github.com/clousehub/thaiclubhouse-data.git data
Install PHP CLI and composeer
Ubuntu
sudo apt install -y php-7.4 php7.4-mbstring composer
Mac
MacOS has a default php version, so we need to run brew link
and append the installed version to path.
brew install [email protected] composer
brew link [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc # or ~/.bashrc
Install dependencies
composer install
Compile
php gen.php
Then open `public/index.html`