Coder Social home page Coder Social logo

hytsang / census_explorer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gazetteerhk/census_explorer

0.0 1.0 0.0 10.76 MB

Explore Hong Kong's neighborhoods through visualizations of census data

Home Page: http://gazetteer.hk

License: MIT License

Shell 1.30% Python 56.62% JavaScript 31.15% HTML 9.90% CSS 1.03%

census_explorer's Introduction

Hong Kong Gazetteer

Explore Hong Kong's neighborhoods through data

Usage

Data Preparation

Go to scripts dir and run python data_preparation.py. This script will download original xlsx files, extract cleaned data to JSON, generate translation mapping, and generate combined CSV files.

You can also generate translation files with this script by uncommenting a few lines, but this should not be necessary, as the files are included in the repo under /rontend/locale

All the data files are under backend/data dir.

Backend

  • Python
  • Flask

Make sure to install the necessary libraries by doing pip install -r requirements.txt. We recommend using a virtualenv.

Run:

  • soft link the backend/ dir to /srv/hk_census_explorer/backend.
  • uwsgi uwsgi.ini for production server.

The production server runs at port 8080 by default.

  • python debug.py for the DEBUG version.

The development server runs at port 8081 by default.

Dockerized Backend

You can run the backend as a Docker container. Simply do sudo docker build . in the project root, and it will build the container for you. You must still do the data preparation step first.

Frontend

  • Node.js
  • Grunt
  • AngularJS
  • D3js
  • Leaflet
  • Google Map

cd into the frontend folder. Prepare environment:

  • [sudo] npm install -g grunt-cli
  • [sudo] npm install -g bower
  • npm install
  • bower install

Usage:

  • grunt serve: Start the local http server at port 9000 in app. By default the host is 0.0.0.0 to allow connections from outside the server.
  • grunt test: Run frontend tests.
  • grunt build: Execute the build process.
  • grunt serve:dist will run the build process and start the server within dist.
  • grunt deploy will build and deploy the site to GitHub pages.

By default, the API will hit our servers. If you want it to query from your local development server, you must change the endpoint in frontend/app/scripts/services/CensusAPI.js

Contribution

If you have bug report, feature request or anything to discuss, create an issue in our project repo.

For code contributions, please fork, modify and send Pull Request.

License

See LICENSE

Todo

  • Data preparation scripts dump the data into scripts/data, but the backend assumes the data will be in backend/data
  • Backend requires symlink of backend to /srv/hk_census_explorer/backend

census_explorer's People

Contributors

2blam avatar brettneese avatar debuggingfuture avatar denistsoi avatar hupili avatar hxu avatar

Watchers

 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.