Link

Incident Management System Documentation

An Incident Management System specialized for Elections.

Get started now View it on GitHub


Getting started

Quick Start Local Setup For Developers

Dependencies

BACKEND

  • Language: Python
  • Framework: Django

FRONTEND

  • Language: Javascript
  • Framework: ReactJS

Quick start: Use Docker-Compose

BACKEND

  1. Make sure Docker is installed and running.
  2. Navigate to /backend directory on terminal.
  3. Build the docker image
    $ docker-compose build
    
  4. Create and run a new docker container instance.
    $ docker-compose up
    

    At the very first run django will start before mysql by which will result an error for django to start. Stop (ctrl + c) and re-run.

  5. Open a new terminal (window/tab), navigate to backend folder
  6. Run the migration to populate the data tables
    $ docker-compose exec djangoapp python manage.py migrate
    
  7. Create superuser account and enter information when prompted.
    $ docker-compose exec djangoapp python manage.py createsuperuser
    
  8. Run the seeder to populate data on the DB.
    $ docker-compose exec djangoapp python manage.py loaddata category channel province district police politicalparty segment
    
  9. In order to add predefined users, run users seeder.
    $ docker-compose exec djangoapp python manage.py loaddata users
    

    You may skip this step to implement you own user hierarchy.

  10. Server now runs at http://localhost:8000/.

FRONTEND

  1. Make sure backend server is running.
  2. Navigate to /frontend directory on terminal.
  3. Build the docker image
    $ docker-compose build
    
  4. Create and run a new docker container instance.
    $ docker-compose up
    
  5. Server now runs at http://localhost:3000/.

This is production build, runs locally, therefore not development friendly. For development purposes try Local Installation.

Local installation: for Development

BACKEND

  1. Make sure you have Python 3 and Mysql 8 installed. (for multiple versions you can use multiple environments with virtualenvwrapper).
  2. Navigate to /backend directory on terminal.
  3. Create new database and update database connection data on /backend/src/settings.py or /backend/.env/ file (you can change the values in .env.example and rename the file to .env)
  4. Install all necessary python packages along with Django.
    $ pip install -r requirements.txt
    
  5. Run migrations for populate tables to DB.
    $ python manage.py migrate
    
  6. Create superuser account and enter information when prompted.
    $ python manage.py createsuperuser
    
  7. Run the seeder to populate data on the DB.
    $ python manage.py loaddata category channel province district police politicalparty segment
    
  8. In order to add predefined users, run users seeder. You may skip this step to implement you own user hierarchy.
    $ python manage.py loaddata users
    
  9. Run the server locally on port 8000 and point your web browser to http://localhost:8000 to view swagger view for API implementation.
    $ python manage.py runserver 0.0.0.0:8000
    

    Here you will now see only the public API list. You need to login on admin panel and visit back to baseurl (locally its: http://localhost:8000/) to see all API Endpoints

  10. Visit http://localhost:8000/admin and login using credentials of the superuser you created.

You may also use the Docker-Compose implementation for development, instead of these steps.

FRONTEND

  1. Make sure Node is installed and then backend API server is running.
  2. Set required configurations Check configuration options.
  3. Navigate to /frontend directory on terminal.
  4. Install required packages
    npm install
    
  5. Run the frontend server.
    REACT_APP_API_BASE_URL=http://localhost:8000 npm start
    
  6. Server now runs at http://localhost:3000/.

Configure


About the project

An Incident Management System specialized for Elections specifically designed for and managed by Election Commission of Sri Lanka.

License

Incident Management System is distributed by an APACHE-2.0 license.

Contributing

When contributing to this repository, please first discuss the change you wish to make, by commenting on a particular issue, by email or by joining our mailling list via https://groups.google.com/forum/#!forum/lsf-elections before making a change.

Thank you to the contributors of Incident Management!

  • MrClemRkz
  • ManZzup
  • lahiru94
  • aijdissanayake
  • umayangag
  • jdc91
  • YujithIsura
  • kosalag
  • ramdesh
  • samisa-abeysinghe
  • thivi
  • dinushara
  • agentmilindu
  • imesh94
  • mohamednizar
  • tharindu99
  • pavan168
  • hsvikum
  • nilesh93
  • pasanchamikara

Code of Conduct

Incident Management System is committed to fostering a welcoming community for betterment and growth.

View our Code of Conduct on our GitHub repository.