Skip to content

rembish/rembish_org

Repository files navigation

README

I'm not sure if somebody will want to create a fork or participate in development of this project, but at least we save a few comments for myself: how to bootstrap this application. Nothing to tough, but still good to know.

Step by step project setup

  1. Check if you have python 3.8+ (check deadsnakes if not: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa)
python -V
  1. Install nvm: https://github.com/nvm-sh/nvm#install--update-script:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.1/install.sh | bash
  1. Install latest node
nvm install node
  1. Install node modules
npm install
  1. Install poetry: https://python-poetry.org/docs/#installation
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
  1. Setup poetry to use local virtual environment
poetry config virtualenvs.in-project true
  1. Create virtualenv and install project dependencies
poetry install
  1. Create development SSL certificates (install make if don't have it, like sudo apt install make)
make devssl
  1. Create a secrets file (see further instructions in the example comments):
cp secrets.example secrets
vi secrets
  1. Initialize database (make sure, that you have working docker: https://docs.docker.com/engine/install/ubuntu/)
poetry run docker-compose up database
  1. Apply database migrations (or restore a dump if you have one)
poetry run flask db upgrade
# or if dump
cat dump.sql | poetry run docker-compose exec -T database mysql -p<root-password> rembish_org
  1. Check if you have the right localhost alias:
sudo vi /etc/hosts
# Add dev.rembish.org to 127.0.0.1

Starting dev environment

  1. Using flask WSGI server:
env $(cat secrets | xargs) poetry run flask run
# Server will be spawned on https://dev.rembish.org:5000
  1. Using docker:
poetry run docker-compose up
# Server will be started on standard HTTPS port: https://dev.rembish.org

Contributing and deploying

  1. Don't forget to add your changes to CHANGELOG.md
  2. To deploy new version:
    • increase version: poetry run flask version -i [patch|minor|major]
    • commit changes: git commit -a -m "Release X.Y.Z
    • tag 'em: git tag vX.Y.Z
    • and push: git push --tags origin main
  3. Github Actions will deploy the application automatically
  4. Check it on https://rembish.org