forked from compdemocracy/polis
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Development
David H. edited this page Oct 22, 2024
·
13 revisions
ℹ️ Try to follow GitHub flow branching strategy.
When you edit the code, try not to edit within our repository.
- You should make a fork of the repository.
- You should create a branch from the
edge
branch:- 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
) - 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
)
- If you are fixing a bug, name the branch with
- Work on your code and write clear commit message so we can verify the code easily
- 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. - Wait for review and get merged. 🎉
ℹ️
edge
branch only accept merge from upstream, and only merge intoedge-civictechto
branch.edge-civictechto
do not accept commit, only accept merge from feature/issue/doc/edge
other branches. Loadinggraph 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;
Run the services with Docker Compose locally
- 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 holdCtrl
and the pressC
until it stops. Then follow step 2 to restart the server.
- Start the server
docker compose --env-file example.env up
-
Check the UI and behavior in browser
-
Edit the code
-
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
Backend:
- Typescript
- Express.js
- PostgreSQL
- Clojure (Math)
Frontend:
- ReactJS
Deployment:
- Docker
- Docker compose
- Docker swarm (we are testing)
- Kubernetes (we plan to test)
The repository is https://github.com/CivicTechTO/polis-storybook
- NodeJS v18
- Git
- 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
- 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
- use
npm
command to run the UI
npm install
- use
npm
command to run the UI
npm run storybook