wevisdemo / parliament-watch

Citizens are watching πŸ‘€
https://parliamentwatch.wevis.info
47 stars 26 forks source link

πŸ‘€ Parliament Watch

Parliament Watch

Citizens are watching

Thank you for every contibutors who participated in the HACKTOBERFEST 2023 πŸŽ‰

Table of Content

⭐ Goal

We want to record and visualise the Thai parliament information including politicians, assemblies, bills, voting processes, and promises.

This project can be seen as a renovated combination of They Work for Us, Law Watch, and Promise Tracker which aim to support several election era.

🌎 Environments

Name URL
Production https://parliamentwatch.wevis.info
Staging (main branch) https://parliament-watch.pages.dev

🍱 Tech Stack

Front-end

Local development

Deployment pipeline

πŸͺ„ Useful Commands

Start SvelteKit

Start the project in development mode

yarn dev

Start Histoire

to see/develop custom components from Histoire's stories

yarn story:dev

Generate a new component

For a shared component

yarn gen:component

src/components/ComponentName/ directory will be created with the following files:

Log

Server-side logging for data warning and SvelteKit error can be enabled via environment variable process.env.LOG_TARGET by setting it to stdout or file. More details in logger.ts.

πŸ—ƒοΈ Directory Structure

🍭 Design System

The project design system is based on Carbon Design System v10 with some modification. Custom theme is defined with scss in src/styles/carbon/. To reduce overhead on development, we compile Carbon related stylesheet into src/styles/carbon/precompiled.css with yarn sass:build command.

Typography

Colors

Components

Icons

πŸ’Ύ Data Pipeline

Data is pre-process server-side during the build step as following

flowchart TD
    A[Google Sheets] -->|d3 fetch: fetch and parse| B(JS objects)
    B --> |Zod: validate and transform| C(Type-safe objects)
    C --> |used in| D(Svelte's routes)
    D --> |Svelte SSR/SSG| E(dev/prod website)
    C --> |used in| G(Scheduled GitHub Action)
    F(External data source) --> |fetched by| G
    G --> |build| H(JSON on GitHub Page)
    H --> |fetched by| E(GitHub Page)

🀝 Contributing Guideline

Please read CONTRIBUTING.md

πŸ“œ License and Terms of Use

Read more at WeVis's Terms of Use (in Thai)