https://github.com/schooloffreelancing/docker-child-protection
Docker application designed to help child protection workers and social workers in humanitarian and development contexts manage data on vulnerable children and survivors of violence
https://github.com/schooloffreelancing/docker-child-protection
child-protection docker humanitarian primero social-workers survivors-of-violence vulnerable-children
Last synced: about 1 month ago
JSON representation
Docker application designed to help child protection workers and social workers in humanitarian and development contexts manage data on vulnerable children and survivors of violence
- Host: GitHub
- URL: https://github.com/schooloffreelancing/docker-child-protection
- Owner: SchoolOfFreelancing
- License: other
- Created: 2020-05-02T11:07:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T18:42:00.000Z (over 2 years ago)
- Last Synced: 2025-03-29T19:11:31.706Z (2 months ago)
- Topics: child-protection, docker, humanitarian, primero, social-workers, survivors-of-violence, vulnerable-children
- Language: Ruby
- Homepage:
- Size: 167 MB
- Stars: 1
- Watchers: 1
- Forks: 13
- Open Issues: 41
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Primero based software platform for humanitarian protection and social welfare workers :rocket:
========
[](https://travis-ci.org/primeroIMS/primero/branches)## Development
To develop the application locally, we recommend that you install [Docker](https://docs.docker.com/install/)
and [Docker Compose](https://docs.docker.com/compose/install/). This is needed to start your pre-configured
PostgreSQL and Solr images, if you don't want to install and configure these dependencies by hand.All command below assume that you are starting in the Primero root directory.
### Build and Start Postgres and Solr
$ cd docker
$ cp local.env.sample.development local.env
$ ./build.sh postgres
$ ./build.sh solr
$ ./compose.local.sh up -d postgres
$ ./compose.local.sh run solr make-primero-core.sh primero-test
$ ./compose.local.sh up -d solrNote that on Linux, where Docker runs as root by default,
you will need to run the build and the compose scripts as `sudo`.### Install RVM and Ruby
$ #Install RVM
$ gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ \curl -sSL https://get.rvm.io | bash
$ echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
$ source ~/.rvm/scripts/rvm
$
$ #Install Ruby
$ rvm install `cat .ruby-version`### Install Node and NPM
On MacOS, with [Homebrew](https://brew.sh):
$ #Install Node
$ brew install nodeOn Ubuntu:
$ #Install Node 12.x
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt-get install -y nodejsOn Fedora:
$ #Install Node 12.x
$ sudo dnf install -y gcc-c++ make
$ curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
$ sudo dnf install nodejs### Install binary dependencies
On MacOS:
$ #If xcode-select is not installed yet, install it.
$ xcode-select --install
$ brew install libpq imagemagick postgresql libsodium p7zipOn Ubuntu:
$ sudo apt-get install -y libpq imagemagick libsodium-dev p7zip
On Fedora:
$ sudo dnf install postgresql-devel ImageMagick libsodium-devel p7zip
### Starting development
Install gems, packages:
$ bundle install
$ npm installPrepare development configuration. Review the created configurations files and alter as needed:
$ cp config/database.yml.development config/database.yml
$ cp config/locales.yml.development config/locales.yml
$ cp config/mailers.yml.development config/mailers.yml
$ cp config/sunspot.yml.development config/sunspot.ymlSet development environment variables:
$ echo "export PRIMERO_SECRET_KEY_BASE=PRIMERO_SECRET_KEY_BASE" >> ~/.bashrc
$ echo "export DEVISE_SECRET_KEY=DEVISE_SECRET_KEY" >> ~/.bashrc
$ echo "export DEVISE_JWT_SECRET_KEY=DEVISE_JWT_SECRET_KEY" >> ~/.bashrcIf you use a different shell, add these environment variables to the rc file for that shell.
You may be pedantic about the secrets in development, and set them to something truly secret.
Optionally use the command below to generate a random secret:$ rails secret
Set this enviroment variable with a 32 bytes secret value:
$ echo "export PRIMERO_MESSAGE_SECRET=PRIMERO_MESSAGE_SECRET" >> ~/.bashrcMake sure that the secrets we set earlier are in your environment (replace .basharc with the rc file for your shell if you use a shell other than bash):
$ source ~/.bashrc
Prepare the database
$ rails db:create
$ rails db:migrate
$ rails db:seedGenerate the i18n translation files
$ bin/rails primero:i18n_js
You may start the development Rails server on port 3000:
$ rails s
And in a separate terminal window, the development Rails Webpacker server:
$ npm run dev
Alternatively, to bring everything up together you can use:
$ foreman start -f Procfile.dev
***Note:*** The first time webpack runs, it takes a very long time to compile.
It's better to keep Rails as a separate process if you want to restart it for some reason.You should now be able to access your development server in the browser on [http://localhost:3000](http://localhost:3000).
You can login with a preseeded admin account with credentials `primero`/`primer0!`.For more on making code contributions, have a look at the file [CONTRIBUTING.md](CONTRIBUTING.md).
## Notes
- It is known that a few npm packages will throw a `requires a peer of` warning. Examples: Mui-datatables is behind on updating dependecies. Jsdom requires canvas, but we are mocking canvas. Canvas also requires extra packages on alpine, which is the reason for mocking canvas.
## Contributing
- If contributing to the UI, make sure to read over the [UI/UX Development](doc/ui_ux.md) documents.## Production
For deploy in production using Docker visit detailed Docker instructions exist in the file [docker/README.md](docker/README.md)