The goal of this project is to empower citizens to effectively organize for their quality of life in their cities and to ensure information about protests is accessible.
This project is under development and has three main parts - backend, frontend and crawler.
Things you need to install:
- Git
- Node.js (we currently support release 8.x)
- MySQL (required only for the backend & crawler)
Once you have these you can download the code and install dependencies:
$ git clone [email protected]:meirim-org/meirim.git
$ cd meirim/
$ npm installConnect to your MySQL instance:
$ mysql -uroot -pCreate a database for the project:
CREATE DATABASE meirim character set UTF8 collate utf8_bin;
exit;Edit the local configuration file (located at config/local.json) and set your database connection details and email smtp settings (if needed).
Install knex globally and run all migrations:
$ npm install knex -g
$ knex migrate:latestFinally, run the service:
$ npm run apiThe service will then be available on port 3001.
Nothing needs to be set up specifically for the frontend (however a working backend service would make it a bit more useful). It can be started using:
$ npm startAnd will then be available at http://localhost:3000
Both the api and the frontend need to be run separately when developing for the auto-reload capabilities of webpack-dev-server. The api will run on port 3001 by default, and the frontend will run on port 3000 and proxy requests destined to the api from any path beginning with "/api" to the service at port 3001 (proxy settings live in src/setupProxy.js).
$ npm run api
$ npm startTo run the crawler (for testing or just seeding the database with plan data) you must first install all dependencies required by Chromium (which is used by puppeteer) which vary from system to system.
If puppeteer is not working properly, check the project's troubleshooting information.
To run the crawler (can be killed at any time using Ctrl+C):
$ npm run crawlWe use pm2 to run the service in production.
First you must build the frontend react site, then the service (serving both the backend and frontend) can be started:
$ npm run build
$ pm2 start ecosystem.config.js --env productionSet up cron to schedule two jobs - crawling for new data and emailing alerts to users:
$ crontab -e
0 0 * * * cd /path_to_code/meirim/ && NODE_ENV='production' /usr/bin/node /path_to_code/meirim/bin/iplan >> /path_to_code/meirim/logs/combined.log 2>&1
* * * * * cd /path_to_code/meirim/ && NODE_ENV='production' /usr/bin/node /path_to_code/meirim/bin/send_emails >> /path_to_code/meirim/logs/combined.log 2>&1You can find more technical info about the project under the docs folder.
We are thankful for any comments, suggestions, issue reports and pull requests anyone might wish to help with. We will do our best to acknowledge, review and reply to these contributions to the best of our abilities (we are all volunteers).
For methods of communicating with us, please see our website.
See the list of contributors who participated in this project <3.
This project is licensed under the MIT License - see the LICENSE.md file for details. The rest is licensed under a Creative Commons Attribution 4.0 International License.