Giter Site home page Giter Site logo

nqryn / seismic-risc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from code4romania/seismic-risc

0.0 0.0 0.0 2.47 MB

Let's save lives together!

License: Mozilla Public License 2.0

Python 30.54% CSS 5.22% HTML 2.46% JavaScript 54.64% Dockerfile 1.55% Makefile 5.21% Shell 0.39%

seismic-risc's Introduction

Seismic Risc

Datree GitHub contributors GitHub last commit License: MPL 2.0

code for romania twitter code for romania facebook

Un cutremur în București nu este o situație ipotetică. Este o certitudine că acest lucru se va întâmpla. În acest context, la mai bine de 40 de ani de la cutremurul din 1977, memoria colectivă a ascuns în profunzime amintirile acelui dezastru în încercarea de a-și înnăbuși teama. Dar realitatea este că, patru decenii mai târziu, Bucureștiul, la fel ca restul orașelor cu risc seismic ridicat, nu ar face față unui asemenea eveniment, iar pierderile de vieți omenești ar fi uriașe. Exercițiul Seism 2018, derulat de DSU arată că cel puţin 4.587 persoane şi-ar pierde viaţa, iar 8.585 ar fost rănite, 6 spitale vor fi distruse, 23 de unităţi spitaliceşti distruse parţial, iar 9 avariate, dar funcţionale O estimare, am spune noi, destul de optimistă.

Ce putem face pentru a deveni mai puțin vulnerabili? Să știm totul despre oraș, despre clădirile în care locuim astfel încât să putem cere consolidarea lor. Seismic Risc nu este doar "un nou site de informare", ci o platformă care colectează și validează apoi cu experți date despre clădirile din România, la nivel national, ajută asociațiile de proprietari să își consolideze clădirile, te ține la curent cu legislația și ți-o explică și are grijă să ai la îndemână informații utile la orice moment.

Let's save lives together.

Contributing

If you would like to contribute to one of our repositories, first identify the scale of what you would like to contribute. If it is small (grammar/spelling or a bug fix) feel free to start working on a fix. If you are submitting a feature or substantial code contribution, please discuss it with the team and ensure it follows the product roadmap.

Our collaboration model is described here.

We don't have a specific set of coding guidelines, so just follow the way the code was written until now, if in doubt, you can use Google's style guide.

Built With

Programming languages

Python 3 JavaScript

Frameworks

API: Django Client: React

Package managers

API: pip Client: npm

Database technology & provider

PostgreSQL

Getting started

Risc Seismic API is a Django application, built on top of Python 3.7+ with a PostgreSQL database, while the Client is a React single page application.

Pre-requisites

In order to run the project locally, you need to have Docker and docker-compose installed.

You can install the above mentioned packages manually or you can use our helper commands.

On Ubuntu 18.04+ run:

make install-docker-ubuntu

On MacOS run:

make install-docker-osx

On other platforms please follow the instructions described here:

The versions the Makefile was tested with are:

$ docker --version
Docker version 19.03.5, build 633a0ea
$ docker-compose --version
docker-compose version 1.24.1, build 4667896b

Initial set-up

Initialise the database and development fixtures:

make init-env

Starting the project

First check the .env file created by the init command and see if there are any environment variables that you might need to provide or change. This file is used by docker-compose to pass the environment variables to the container it creates.

Get the project up and running:

docker-compose up

You should be able to access the local environment site and admin at the following URLs:

If you have problems starting the project, first check out the FAQ and if that doesn't work, ask someone from the project's channel. Maybe the issue you just had is worth adding to the FAQ, wouldn't it?

In order to see all available commands run:

make

Development

When creating new models in Django, in order to make sure they are generated in a clean environment, it is recommended to generate the migration files using the make command:

make migrations

When you need to add/remove requirements or restrict the version of a requirement, edit the requirements.in (prod) and the requirements-dev.in (dev) files accordingly. After doing this run:

make update-requirements

This will create a clean environment where is uses the pip-tools library to compile a the corresponding requirements.txt files with the versions of the packages pinned. This is important as it guarantees that every environment this service runs in, has the same dependencies installed and minimizes the risk of works on my machine.

Testing

make test

Production

In order to get the container ready for production use we need to first build it:

$ docker build -t seismic-risc:latest ./api

Use the prod.env.dist template file and create a prod.env file with the correct environment variables and run like so:

$ docker run --env-file prod.env -p HOST_PORT:GUNICORN_PORT seismic-risc:latest

Or, you can provide all the environment variables at runtime:

$ docker run -e DJANGO_CONFIGURATION=Prod -e DJANGO_SECRET_KEY= -e DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/NAME -e GUNICORN_PORT=5000 -e GUNICORN_WORKERS=2 -p HOST_PORT:GUNICORN_PORT seismic-risc:latest

After testing the container runs properly, tag and upload the image to Docker hub:

docker tag seismic-risc:latest code4romania/seismic-risc:latest
docker push code4romania/seismic-risc:latest

Client Deployment

  • Change directory to ./client
  • Build the solution npm install
  • Start a development server npm start
  • Run the tests npm test
  • Build the solution npm run build

Feedback

  • Request a new feature on GitHub.
  • Vote for popular feature requests.
  • File a bug in GitHub Issues.
  • Email us with other feedback [email protected]

License

This project is licensed under the MPL 2.0 License - see the LICENSE file for details

About Code4Ro

Started in 2016, Code for Romania is a civic tech NGO, official member of the Code for All network. We have a community of over 500 volunteers (developers, ux/ui, communications, data scientists, graphic designers, devops, it security and more) who work pro-bono for developing digital solutions to solve social problems. #techforsocialgood. If you want to learn more details about our projects visit our site or if you want to talk to one of our staff members, please e-mail us at [email protected].

Last, but not least, we rely on donations to ensure the infrastructure, logistics and management of our community that is widely spread across 11 timezones, coding for social change to make Romania and the world a better place. If you want to support us, you can do it here.

seismic-risc's People

Contributors

tudoramariei avatar costibleotu avatar cnstlungu avatar danniel avatar iuliux avatar aramboi avatar aniri avatar catileptic avatar raducstefanescu avatar bogdanhopu avatar dependabot[bot] avatar vladplesu avatar

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.