Coder Social home page Coder Social logo

jirawat070 / bkk-election-2022 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wevisdemo/bkk-election-2022

0.0 0.0 0.0 113.25 MB

Monorepo for Bangkok Election 2022 projects

Home Page: https://bkkelection2022.wevis.info

JavaScript 2.01% TypeScript 71.01% CSS 2.06% HTML 0.59% Vue 16.94% SCSS 0.13% Sass 0.28% Svelte 6.98%

bkk-election-2022's Introduction

🗳️ Bangkok Election 2022

Monorepo for Bangkok Election 2022 projects managed by Turborepo and Yarn

อ่านเบื้องหลังของโปรเจคได้ที่ กว่าจะมาเป็น BKK Election 2022: Monorepo, Tech Stack, กระบวนการทำงาน และสิ่งที่ได้เรียนรู้

🌳 Environments

Name URL process.env.BUILD_ENV
Production https://bkkelection2022.wevis.info PRODUCTION
Staging https://staging.bkkelection2022.wevis.info STAGING
Local http://localhost:3000 -

🍱 Project structure

  • /apps Framework independent subprojects

    • /landing Landing page (SvelteKit)
    • /socialtrend Social trend analysis (NuxtJS)
    • /candidate Candidates information (NextJS)
    • /map Election map of results in the past and realtime (Preact)
  • /moderator

    • Development server using Express with reverse proxy and static assets serving.
    • Build script to combine every apps build file in the root /build
  • /packages Shared packages used by apps

    • /tailwind Tailwind config and base stylesheet with shared design guideline
    • /ui Shared web component written by SolidJS and typography stylesheet from design system
    • /wordpress-api TypeScript library help fetching data from The Standard and WeVis Wordpress REST API
  • /static Static directory serving at /static eg. favicon and fonts

⚙️ Setup

Yarn 1 is required

Install the dependencies

yarn

Develop

To develop all apps and packages, run the following command:

yarn run dev

Each app will be started in development server in difference port

While moderator will run at http://localhost:3000 and

  • Forward / request to Landing dev server
  • Forward /socialtrend request to Social trend dev server
  • Forward /candidate request to Candidate dev server
  • Forward /map request to Map dev server
  • Serve files in /static at /static
  • Serve UI package built output at /ui

Each project can also be run individually (with moderator proxy and ui package)

yarn run dev:landing
yarn run dev:candidate
yarn run dev:socialtrend
yarn run dev:map

Build

To build all apps and packages, run the following command:

yarn run build

Each project will be built and combined in root /build folder

⚽ Working style

  • We use Trunk-based development.
    • No braches, we all push to main branch.
    • Pull rebase git pull --rebase often. Before you start coding and pushing.
    • Continuous integration: try not to leave your code without pushing overnight.
    • Use feature flag (with process.env.BUILD_ENV or other environment variable) to prevent unfinished feature to be deployed to the production.
  • Each time the code is pushed to main branch, Github Action will build and deploy to the staging environment.
  • Deploy to production is now done manually. Pipeline implementation is in the plan.

bkk-election-2022's People

Contributors

th1nkk1d avatar taepras avatar napatswift avatar mnutdanai avatar mixth avatar bariyard avatar wiput1999 avatar riflowth avatar

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.