Giter Site home page Giter Site logo

sherryjyc / aircasting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from habitatmap/aircasting

0.0 1.0 0.0 6.77 MB

AirCasting API and web application

Home Page: http://aircasting.org

License: Other

Ruby 45.65% JavaScript 42.23% CSS 3.24% HTML 8.67% Shell 0.21%

aircasting's Introduction

Build Status Code Climate

AirCasting - Share your Air!

About

This is the AirCasting project - the project aims to build a platform for gathering, visualization and sharing of environmental data. To learn more about the platform visit aircasting.org.

Developing

Branching strategy

  • production is stable code which gets deployed to aircasting.org. If you're setting up your own copy of Aircasting use this branch.
  • master is a base branch to which we merge code. It gets deployed to staging server. It may contain some work-in-progress code or unfinished features.

Prerequisite: Debian / Ubuntu

sudo apt-get install bzip2 curl subversion git-core -y
# install rvm https://rvm.io/rvm/install
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config imagemagick mysql-server libmysqlclient-dev redis-server libgsl0-dev nodejs -y

Prerequisite: Mac

# install rvm https://rvm.io/rvm/install
brew install gsl

App (any OS)

rvm install 2.0.0
rvm use 2.0.0
gem install bundler
git clone git://github.com/HabitatMap/AirCasting.git
cd aircasting
cp config/database.yml.example config/database.yml
# `socket:` in `config/database.yml` should be equal to the path from
# `mysqladmin variables -uroot | grep socket | grep "\.sock"`
cp config/secrets.yml.example config/secrets.yml
# fill proper secrets in config/secrets.yml
bundle install
bundle exec rake db:create db:migrate
bundle exec sidekiq -d
bundle exec rails server
# visit http://localhost:3000

Tests

run tests

RAILS_ENV=test bundle exec rake db:create db:migrate
bundle exec rspec
bundle exec rake spec:javascript

API documentation

Read more here.

Assets version bumping

Whenever changing code tounching google maps, the data-version attribute in app/views/layouts/map.html.haml should be bumped. This ensures that the assets will reload correctly.

Importing a big db dump to a server, i.e. staging

For restoring a big db dump you can try to opitimize a process by changing the database configuration temporarily. See example post on Stack Overflow

mysql -u root -p
use MY_DATABASE_NAME;

set global net_buffer_length=1000000; --Set network buffer length to a large byte number

set global max_allowed_packet=1000000000; --Set maximum allowed packet size to a large byte number

SET foreign_key_checks = 0; --Disable foreign key checking to avoid delays,errors and unwanted behaviour

source file.sql --Import your sql dump file

SET foreign_key_checks = 1; --Remember to enable foreign key checks when procedure is complete!

Troubleshooting

In case you encounter a similar error

Mysql2::Error: Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column ...

please check if any of these files

  • /etc/my.cnf
  • /etc/mysql/my.cnf
  • /usr/local/etc/my.cnf
  • ~/.my.cnf

contain sql_mode = "...". If that's the case, make sure to remove ONLY_FULL_GROUP_BY from the string. Otherwise, just add

sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

to any existing configuration file. If none exists just create ~/.my.cnf as follows

[mysqld]
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

To double check the configuration works

bundle exec rails c
ActiveRecord::Base.connection.execute("show variables like 'sql_mode'").to_a
# the return value should not contain ONLY_FULL_GROUP_BY

Contribute

If you'd like to contribute just use the usual github process - fork, make changes, issue a pull request.

Contact

You can contact the authors by email at [email protected].

Thanks

AirCasting uses The YourKit Java Profiler for Performance Tuning

YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: YourKit Java Profiler and YourKit .NET Profiler.

License

The project is licensed under the GNU Affero GPLv3. For more information see COPYING and visit http://www.gnu.org/licenses/agpl.html.

aircasting's People

Contributors

3v0k4 avatar ags313 avatar cichaczem avatar czorek avatar gitjul avatar knapo avatar ku1ik avatar kustosz avatar mheimbinder avatar obrok avatar sparrovv avatar szemek avatar szynszyliszys avatar takiarek avatar tomaszgieres 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.