Skip to content
David H. edited this page Oct 22, 2024 · 13 revisions

Get started

ℹ️ Try to follow GitHub flow branching strategy.

🧠 Blog GitHub Flow: A Quick 5-Step Process

When you edit the code, try not to edit within our repository.

  1. You should make a fork of the repository.
  2. You should create a branch from the edge branch:
    1. If you are fixing a bug, name the branch with fix/issue-<issue number>-<key word of issue> (e.g. git checkout edge && git branch -b fix/issues-25-display-button)
    2. If you are adding feature described in issues, name the branch with feature/<key word about feature>-issue-<issue number> (e.g. git checkout edge && git branch -b feature/a11y-module-issue-13)
  3. Work on your code and write clear commit message so we can verify the code easily
  4. Create pull request to edge-civictechto branch from your repository with changelog (so we know what you did, then we can verify your changes and test the code for integration test) in case changelog is too trivial for you, leverage AIs to write it is also a good idea.
  5. Wait for review and get merged. 🎉

ℹ️ edge branch only accept merge from upstream, and only merge into edge-civictechto branch. edge-civictechto do not accept commit, only accept merge from feature/issue/doc/edge other branches.

graph TD
    A[Edit Code] --> B[Fork Repository];
    B --> C[Create Branch from **edge**];
    C -- Bug Fix --> G;
    C -- New Feature --> G;
    G[Create Pull Request to **edge-civictechto**] --> H[🎉];

    classDef highlight fill:#f9f,stroke:#333,stroke-width:2px;
    class A,H highlight;
Loading

Develop with Docker Compose

Run the services with Docker Compose locally

  1. If it is your first time setup on the machine
# Get all code and configuration files
git clone https://github.com/compdemocracy/polis.git
# Enter the correct directory as working directory
cd polis
# Build all docker image and configurate environment for multiple docker instances using `docker compose`
docker compose --env-file example.env up --build 

⚠️ Usually it end up running into error in connection with database. Press and hold Ctrl and the press C until it stops. Then follow step 2 to restart the server.

  1. Start the server
docker compose --env-file example.env up
  1. Check the UI and behavior in browser

  2. Edit the code

  3. Restart the server

# Press and hold `Ctrl` and the press `C` now docker compose is stopping
#^C

# Start the server
docker compose --env-file example.env up

Tech stack

Backend:

  • Typescript
  • Express.js
  • PostgreSQL
  • Clojure (Math)

Frontend:

  • ReactJS

Deployment:

  • Docker
  • Docker compose
  • Docker swarm (we are testing)
  • Kubernetes (we plan to test)

Develop UI with storybook

The repository is https://github.com/CivicTechTO/polis-storybook

Requirements

  • NodeJS v18
  • Git

How to setup and run story book

  1. If you have not installed Node.js, install it
# Installing Node Version Manager
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# Use Node Version Manager to install version 18 of Node
nvm install 18
# Start using version 18 of Node
nvm use 18
  1. Clone the polis-storybook directory and enter the directory, pull all submodules from GitHub
git checkout https://github.com/CivicTechTO/polis-storybook
cd polis-storybook

git submodule update --init
  1. use npm command to run the UI
npm install
  1. use npm command to run the UI
npm run storybook