Giter Site home page Giter Site logo

ecomap's Introduction

Ecomap project (by LV-164.UI)

About this project

This repository is source code of the small web project, which is named 'EcoMap'. This website allows you to publish information about ecological issues around Ukraine to dynamic map. Officials of the Ministry of Environment use this website to collect info about problems and contact with citizens, who publish info to this website.
Website's url - ecomap.org

Ecomap Rest Api docimentation lhalam.github.io/EcoMap/

Dependencies

We're assumming that you're using bash & you already have installed such packages:

  • apt-get
    • sudo apt-get install mysql-server

Setupping database locally

  1. Clone this repository to your local machine
  2. Open file /etc/mysql/my.conf with following command: nano /etc/mysql/my.cnf
  3. Add following options to this file:
        [mysqld]
        default-character-set = utf8
        init_connect=‘SET collation_connection = utf8_unicode_ci’
        character-set-server = utf8
        collation-server = utf8_unicode_ci
    
    [client]
    default-character-set = utf8
    </pre>
    </li>
    <li>Go to 'path/to/repo/ecomap/DB/ecomap/' directory</li>
    <li>Run mysql shell: <code>mysql -u -p</code></li>
    <li>Run following command: <code>CREATE DATABASE ecomap_db CHARACTER SET utf8 COLLATE utf8_unicode_ci;</code> - this command will create database if it's not created yet. Put the name you want instead of 'ecomap_db'</li>
    <li>Run following command: <code>USE ecomap_db;</code> - this command will set the database you've created earilier as current. 
        Instead of ecomap_db put the name you've chosen earlier</li>
    <li>Run following command: <code>SOURCE CREATE_DB.sql;</code> - this command will create all tables for database</li>
    <li>Run following command: <code>SOURCE INSERT_DATA.sql;</code> - this command will populate all data you need for the beginning of work</li>
    <li>Now you have working Database!</li>
    

Database scheme

Ecomap application runs on Apache Web Server v2.4

This is a short manual, which tells how to configure WSGI-Flask application and Apache server on your server or local machine.

  1. Install Apache 2 and mod_wsgi lib:
    sudo apt-get install -y apache2
    sudo apt-get install libapache2-mod-wsgi
    sudo apt-get install libapache2-mod-wsgi python-dev
  2. Enable wsgi mod:
    sudo a2enmod wsgi
  3. Edit your hosts file to create server name alias
    sudo gedit /etc/hosts
    Add this line to th your host file: 127.0.1.2 ecomap.new
  4. Run following command:
    sudo gedit /etc/apache2/sites-available/ecomap.conf
    This command will create file ecomap.conf - this is config file of your site. You can set any name you want!
    Add content from apache.conf file, which is situated in - ecomap/etc/apache.conf to /etc/apache2/sites-available/ecomap.conf.
  5. Enable your site:
    sudo a2ensite ecomap
  6. Make your own copy of ecomap.wsgi (situated in ecomap/www/ecomap.wsgi). Also read comments in that file, since they are important! This is your main wsgi script which apache will use to run application. It has already configured for our project structure. You can set your own path to templates folder and you'll see test site.
  7. views.py - this is main flask application file. All backend code will be written there. You can change everything right now!

ENVIRONMENT VARIABLES

insert to bashrc

  • export PRODROOT=${PRODROOT:-/home/padalko/ss_projects/Lv-164.UI/ecomap}
  • export PYSRCROOT=${PYSRCROOT:-${PRODROOT}/src/python}
  • export CONFROOT=${CONFROOT:-${PRODROOT}/etc}
  • export PYTHONPATH=${PRODROOT}/src/python
  • export PYTHON=${PYTHON:-/etc/python}
  • export PYTHON_EGG_CACHE=${PYTHON_EGG_CACHE:-/tmp/.python-eggs}
  • export STATICROOT=${STATICROOT:-${PRODROOT}/www/}

ecomap's People

Contributors

frutkick avatar padalko avatar piratovskyi avatar sabutobi avatar lhalam avatar gamolyavlad avatar innakutsik avatar romanderkach avatar

Watchers

James Cloos 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.