Giter Site home page Giter Site logo

promise-tracker's Introduction

🤞 WeVis Promise Tracker

Thai politicians and parties promise tracker

🌎 Environment

💻 Tech stack

📐 Architecture

The project use static site generator (SSG) strategy. In the pipeline, API is called once before the build time, which mean no API will be called after the static site is generated. To update the site after the data is updated, site needed to be built and deployed again.

flowchart TD
    A[NocoDB] -->|yarn fetch-data| B[JSON files in /data]
    B -->|yarn dev| C[Nuxt dev environment]
    B -->|yarn build| D[Static site generated by Nuxt]
Loading
  • Promises and related data is store on WeVis's NocoDB which allow non-dev to maintain the data
  • Use yarn fetch-data to download data from NocoDB, transform into JSON files in /data
  • JSON files then will be loaded by Nuxt from yarn dev and yarn build command

📂 Directory structure

Use pascal-case for every file name since Linux (eg. Github Action runner) is not case-incensitive, in contrary to Mac and Windows.

  • /components Vue components
    • Put on the root if it's shared between pages
    • Put in the /components/<page>/ if it's only used in that page
    • If components is too big or getting duplicated, you should split into several component which can also be group in sub-folder
  • /data JSON promises and related data, including example one before fetching script is implemented.
  • /models Data types (interface, enum, etc.) sharing across the project
  • /pages Represent Nuxt routing
  • /static Static assets such as images
    • Before adding new assets, check first if it's already exist here.
    • $config.path.base can be used to reference static path (or base path)
    • $config.path.images can be used to reference static/images path
      <img :src="`${$config.path.images}/status/nodata.png`"
    • For SVG that can change the color (eg. button icon on hover), recommend in use inline svg with currentColor and Tailwind color preset
  • /tests Test file
    • Recommend to mimick project structure eg. /tests/components/component-name.test.ts

💅 Styling and design system

  • We used WeVis Design System which provide
    • Utility classes for typography
    • Vue component
  • For other styling customization beyond WeVis design system, use Tailwindcss
    • Color is defined in tailwind.config.css which naming should be related to Figma
    • Configuration is also available on http://localhost:3000/\_tailwind/ when dev server is running

⚽ Working style

  • We use Github issue to track the progress.
    • Please assign yourself to the issue you are working on.
    • I don't want to force "HOW" to implement the issue and we can discuss everything on the issue.
    • Communication language doesn't matter. Feel free to use Thai or English.
  • We use Trunk-based development.
    • No braches, we all push to main branch.
    • If the commit is related to a specific issue, add issue id in the commit message eg. #21 Add button components
    • Pull rebase git pull --rebase often. Before you start coding and pushing.
    • Continuous integration: don't leave your code without pushing overnight, push as much as you can without breaking the build.
    • Linter and formater will be run on commit, while test and build will be run on push so you can't push if it fail.
  • Encourage to write component test with TDD (Test driven development) but it's not mandatory.
  • Each time the code is pushed to main, Github Action will build and deploy to the staging environment.
  • Use asynchonous communication. Let's try not to have meeting if not necessary.
    • For issue related discussion, please use Github issue
    • Other discussion can be done in slack

🤝 License and Terms of Use

Please read WeVis's Terms of Use

THANK YOU FOR ALL THE CONTRIBUTION ❤️

promise-tracker's People

Contributors

dependabot[bot] avatar mixth avatar nathakits avatar palminister avatar th1nkk1d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

promise-tracker's Issues

[component] Filter Panel

image

Idea

  • Can be a stateless component
  • Get current active filters from props (PromiseStatus and PromiseStatus is available in model/promise.ts)
  • When the apply button is clicked, fire change event with new active filters
  • When the clear button is clicked, fire clear event

Used by

[page] Promise

image

Idea

  • Use Nuxt's dynamic route with promise Id
  • Provide custom head on each promise, link to OG image based on status

Depends on

[other] OG image generation

image

Idea

  • Use Nuxt's dynamic route with promise id param
  • Use a headless browser script to take a screenshot. Example here
  • Add to existing promise page

Depends on

[component] Topic Group

image

Idea

  • Receive a list of promises, title text, and number of promises to show per page as a prop
  • Use state to store a current page for pagination function
  • ดูประเด็นนี้ทั้งหมด just need to emit event on click

Depends on

Used by

[component] Promise Card

image

Idea

  • Only use the state to store collapsed-expanded state.
  • Collapse-expand button can be hidden using prop (for separated promise page)
  • Can use sharer from the design system; with url to /promises/:id

Used by

[component] Promises Overview

image
image

Idea

  • This is a huge issue. Can be split into several components such as Chart, Tab, ActiveFilter, StatusExplanationDialog, etc. as you preferred
  • Only use the state to store active tab and is status dialog open (Open by ข้อมูลเพิ่มเติม button), the rest is passed through props
  • Fire the event when the filter is changed (user click remove active filter)

Depends on

Used by

[component] Party Card

image

  • Stateless component, all data can be provided with props
  • Since the link to explore page will also apply filter, filters must be able to pass by query parameters

Depends on

Used by

[component] Link Banner

image
image

Idea

  • Stateless
  • Have props for the icon image and every text
  • Have a prop for 2 styles of background-color

Depends on

Used by

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.