GithubHelp home page GithubHelp logo

raksha-life / rescuekerala Goto Github PK

View Code? Open in Web Editor NEW

This project forked from biswaz/rescuekerala

671.0 70.0 573.0 5.12 MB

Website for coordinating rehabilitation of people affected in the Kerala Floods

Home Page: https://keralarescue.in

License: MIT License

Python 65.36% HTML 31.56% CSS 1.40% JavaScript 1.34% Dockerfile 0.13% Shell 0.22%
crowdsourcing open-source help django community flood rescue python hacktoberfest

rescuekerala's Introduction

KeralaRescue

Build Status - Travis Open Source Helpers

The Website for co-ordinating the rehabilitation of the people affected in the Kerala Floods.

Join Kerala Rescue Slack channel

Table of Contents


Requirements

^top

Docker

  • Check out this Wiki to see how to run docker for this project.

Setting up an S3 Account


Getting Started

^top

Setting up a development environment

1. Create database and user in Postgres for keralarescue and give privileges.
psql user=postgres
Password:
psql (10.4 (Ubuntu 10.4-0ubuntu0.18.04))
Type "help" for help.

postgres=# CREATE DATABASE rescuekerala;
CREATE DATABASE
postgres=# CREATE USER rescueuser WITH PASSWORD 'password';
CREATE ROLE
postgres=# GRANT ALL PRIVILEGES ON DATABASE rescuekerala TO rescueuser;
GRANT
postgres=# \q
2. Clone the repo.
git clone https://github.com/raksha-life/rescuekerala.git
cd rescuekerala
3. Copy the sample environment file and configure it as per your local settings.
    cp .env.example .env

Note: If you cannot copy the environment or you're facing any difficulty in starting the server, copy the settings file from https://github.com/vigneshhari/keralarescue_test_settings for local testing.

4. Install dependencies.
pip3 install -r requirements_debug.txt
5. Run database migrations.
    python3 manage.py migrate
6. Setup static files.
    python3 manage.py collectstatic
7. Run the server.
    python3 manage.py runserver
8. Now open localhost:8000 in the browser That's it!

Setup using docker-compose

Pre-requisites

Run the scripts in the root directory

  • docker-start.sh - to start the services.

  • docker-stop.sh - to stop the services.

  • docker-restart.sh - to rebuild and restart the services.

Creating migration files

^top

If your code changes anything in models.py, you might need to make changes in database schema, or other constraints. To create migrations files, run python3 manage.py makemigrations --settings=floodrelief.settings after making your changes. Also make sure to add these files in the commit.

Running tests

^top

When running tests, Django creates a test replica of the database in order for the tests not to change the data on the real database. Because of that, you need to alter the Postgres user that you created and add to it the CREATEDB privilege:

ALTER USER rescueuser CREATEDB;

To run the tests, run this command:

python3 manage.py test --settings=floodrelief.test_settings

Enable HTTPS connections

^top

Certain features (example: GPS location collection) only work with HTTPS connections. To enable HTTPS connections,follow the below steps.

Create self-signed certificate with openssl

$openssl req -x509 -newkey rsa:4096 -keyout key.key -out certificate.crt -days 365 -subj '/CN=localhost' -nodes

[https://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl#10176685]

Install django-sslserver

$pip3 install django-sslserver

Update INSTALLED_APPS with sslserver by editing the file floodrelief/settings.py (diff below)

 INSTALLED_APPS = [
+    'sslserver',
     'mainapp.apps.MainappConfig',
     'django.contrib.admin',

Note: Make sure that this change is removed before pushing your changes back to git

Run the server

python3 manage.py runsslserver 10.0.0.131:8002  --certificate /path/to/certificate.crt --key /path/to/key.key

In the above example the server is being run on a local IP address on port 8002 to enable HTTPS access from mobile/laptop/desktop for testing.


How can you help?

^top

Verification of Rescue Requests

You can help us with verifying user submitted request from our Ushahidi volunteer portal. Please follow the usermanual available in either English or Malayalam

Contribution Guidelines

Check out this Wiki for our contribution guidelines.

Please find issues that we need help here. Go through the comments in the issue to check if someone else is already working on it. Don't forget to drop a comment when you start working on it.

Testing PRs

We have a lot of Pull Requests that requires testing. Pick any PR that you like, try to reproduce the original issue and fix. Also join #testing channel in our slack and drop a note that you are working on it.

Testing Pull Requests

Note: If you have cloned a fork of raksha-life/rescuekerala, replace origin with upstream

  1. Checkout the Pull Request you would like to test by
    git fetch origin pull/ID/head:BRANCHNAME`
    git checkout BRANCHNAME
    
  2. Example
    git fetch origin pull/406/head:jaseem
    git checkout jaseem1
    
  3. Run Migration
Submitting Pull Requests

Please find issues that we need help here. Go through the comments in the issue to check if someone else is already working on it. Don't forget to drop a comment when you start working on it.

Always start your work in a new git branch. Don't start to work on the master branch. Before you start your branch make sure you have the most up-to-date version of the master branch then, make a branch that ideally has the bug number in the branch name.

  1. Before you begin, Fork the repository. This is needed as you might not have permission to push to the main repository

  2. If you have already clone this repository, create a remote to track your fork by

    git remote add origin2 [email protected]:tessie/rescuekerala.git
    
  3. If you have not yet cloned, clone your fork

    git clone [email protected]:tessie/rescuekerala.git
    
  4. Checkout a new branch by

    git checkout -b issues_442
    
  5. Make your changes.

  6. Ensure your feature is working as expected.

  7. Push your code.

    git push origin2 issues_442
    
  8. Compare and create your pull request.


Flood Map

You can find the repo for the Flood Map here : https://github.com/aswinmohanme/kerala-flood-map

rescuekerala's People

Contributors

ajnas avatar amalkarunakaran avatar anushbmx avatar arunkrishnan avatar biswaz avatar bjacobt avatar bodhish avatar cibingeorge avatar gotham13 avatar irshadshalu avatar ja8zyjits avatar jaseemkm avatar kracekumar avatar muneebkattody avatar namboodiri avatar qburst-jino avatar r3dsm0k3 avatar remedcu avatar renjithraj2005 avatar saleehk avatar shahidhk avatar shajith avatar shameelsadaka avatar shanavas786 avatar subins2000 avatar tesssie avatar theryecatcher avatar tomahawk-pilot avatar vigneshhari avatar xaneem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rescuekerala's Issues

Need an API end point

We are working on an app to fetch all the data of people who need help with click of a single button, thinking of merging with the rescue kerala website, Can we get an API end point for the same , in case if we are pushing details to this server from the mobile app ?

Caching on pages

It looks like some pages do not have caching enabled.

For example https://www.keralarescue.in/requests/?district=alp. It takes a second or two to load the page. And I do not see any proper cache control headers on the response.

It will be better if we can cache these pages for a minute so that sudden spike in traffic won't fry the servers.

Immediate short-term fix, and related questions

I read that the site is currently hosted on Heroku. As we work on optimizing the site, here are some suggestions for immediate fix:

  1. Dial up the numbers of hosts/dynos on Heroku
  2. Dial up the numbers of processes per dyno, via the WEB_CONCURRENCY param. We need to be careful and look at CPU and memory usage metrics before increasing WEB_CONCURRENCY
    https://devcenter.heroku.com/articles/python-concurrency-and-database-connections

Two related questions

  1. Has someone created a list of issues the site is facing? What specific problems need to be solved?
  2. What traffic and performance metrics are available?

Hi all

Hello, the number of PRs and issues just exploded. And we're running short of time.
Please list below, how us the devs can improve the communication with the community and improve the workflow

Please mention super important PR's issues too

Write tests so that it doesn't break with new merges

There should be tests written that makes sure that the core functionalities are unaffected. Ideally, a CI should be setup which will run all tests on open PRs to make sure that the merge doesn't break the app

Wrong location co-ordinates

Guys, noticed that many of the request raised are by friends or family of the affected and not by themselves, and hence the co-ordinates might not help. If passing the coordinates to the rescue team, please verify the co-ordinates and mentioned location.

In this case, features like #96 could slow the rescue process down. Please double check.

remove irrelvant information from the top of the landing page

image

Issue Description: The text content being loaded on the top of the page is irrelvant to any one trying to request rescue. Note that Even I don't have network coverage. Those unwanted text can be moved to a about link to not to hurt anyone feelings.

Severity: High

Accepted behavior: The home page should show only relevant information

Testing : Tested only with Safari on iOS on iPhone 7. Used a high speed internet. No mobile coverage.

Feature request - 'Update request' for 'requestee'

After creating request store the request IDs in cookie (ID hashed with salt)
Provide an interface to list out the requests by using this cookie and also an edit button to mark as accomplished/close.

Frontend changes for faster page loading

  1. Avoid all other CSS files except bootstrap
  2. Use standard browser font. Remove 'raleway'
  3. Put request for help in home page and give other links on right side. two column layout
  4. Load logos on top asynchronously.
  5. If possible remove bootstrap and use table layout for faster loading.

#83 #84

Need Help in Django Rest API

We need to setup Django REST API in the branch "app" in our repo,
We need to disable CORS and CSRF in order for the API to work,
The base model is written, please test and verify the code before submitting a pull request

Issue and PR templates

Relating this to the idea of issue and PR template from discussion #92

Any criteria you guys wish to have or mandate on the template.
Am currently preparing a template, let me know what you guys have in mind

Include 1077 number in home page

Include 1077 number in home page.
1077 number has the technology to identify the location of the caller, which will be helpful to the rescue team.

Infrastructure

Our team has a 3000 dollar credit in our google cloud, so we are ready to help with hosting, effective caching using cloud flare, Nginx hosting and scaling of the application if needed.

Log request ip and request id.

Saw this post regarding spammy requests. We could log the ips and issue a warning to deter people from such activities.

Contributions

Hi guys,

It's great that we all are coming together to help this website, every helping hand is required and appreciated, but before you make any contribution, below are some points that you should keep in mind.

  • Select an issue that you want to work upon and comment on the same so that no other person takes up the same issue
  • If the issue your PR is solving is not mentioned in the issues tab, first open the issue and then solve it so that other people know what you are working upon and hence we reduce the number of duplicates.

PS: Will incorporate this in Readme, afk for now

Load balancing and other aspects with website

I'm here from social media posts such as this.

What is current situation like? I see cloudflare being used. What's the current plan? Where are things being hosted in backend and what database is being used?

Also, what is feature wise status of the website? Is there much more to be done? I think it might be best to use Eden from the Sahana Foundation projects because it is well tested in disaster scenarios and provides lots of features. Additionally, they do provide hosted Eden instances too so we can simply contact them and get it done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.