Skip to content

jerrywdlee/iuliana-challenges

Repository files navigation

Iuliana Challenges

This Repo is moved from jerrywdlee/EnergyDataSimulationChallenge and is a web app for exhibiting EnergyDataSimulationChallenge challenges

License: MIT Ruby

Introduction

DEMO: https://iuliana-challenges.herokuapp.com

Local Install (development)

Dependencies

  • postgresql >= 10.2
  • ruby: >= 2.6.1
  • bundler: >= 2.0.0
  • nodejs: >= 8.0
  • yarn: >= 1.13.0
  • docker: >= 17.12.0

Command Cheat Sheet

Setup Rails Part
$ bundle install
$ bundle exec rails db:create
$ bundle exec rails db:migrate
$ bundle exec rails s
# page will shown on localhost:18000

Default User

Username: admin@example.com
Password: admin2019
Setup Admin(Vue.js) Part

Admin part is based on Vue Element Admin and Vue Typescript Admin Template, special thanks.

Set vendor/admin As Root Path

$ yarn install
$ yarn serve
# page will shown on localhost:8080

Add New SVG Icons

$ cp YOUR_ICON.svg ./src/icons/svg
$ npx vsvg -s ./src/icons/svg -t ./src/icons/components --ext ts --es6
Tests on Rails Part
$ bundle exec rspec
# Coverage in `caesaris/coverage`
# Coverage(2019-07-12): 1040 / 1048 LOC (99.24%)
Tests on Admin(Vue.js) Part

Set vendor/admin As Root Path

$ yarn test:unit
# Coverage in `tests/unit/coverage`
# Coverage(2019-06-24): 94.12%, WIP

Deployment (production)

Deploy Directly

  • Install Postgres and set POSTGRES_USERNAME, POSTGRES_PASSWORD
  • Set SECRET_KEY_BASE by bundle exec rake secret
$ bundle install
$ cd vendor/admin; yarn install; cd -
$ bundle exec rails db:create
$ bundle exec rails db:migrate
$ bundle exec rake assets:precompile
$ bundle exec puma -C config/puma.rb
# bond nginx to `localhost:18000`
# Admin(Vue.js) will be built and serve by Rails server

Deploy By Docker

$ echo "POSTGRES_USERNAME=${YOUR_DB_USERNAME}" >> .env
$ echo "POSTGRES_PASSWORD=${YOUR_DB_PASSWORD}" >> .env
$ echo "SECRET_KEY_BASE=`bundle exec rake secret`" >> .env
$ docker-compose build
# Run Database Migration in Docker
$ docker-compose run web bundle exec rake db:create
$ docker-compose run web bundle exec rake db:migrate
$ docker-compose up -d
# bond nginx to `localhost:38000`
# Admin(Vue.js) will be built and serve by Rails server

Challenges

Challenges 1

WIP

Challenges 2

Energy Consumption Per 30mins

documents/challenge-2/challenges-2-0.gif

Average Energy Consumption Per Day

Clustered By KMeans
documents/challenge-2/challenges-2-1.gif

Energy Consumption Per Day

Clustered By KMeans From 2 To 4
documents/challenge-2/challenges-2-2.gif

Challenges 3

Abstract

documents/challenge-3/challenges-3-0.gif

Init Datasets

documents/challenge-3/challenges-3-1.png

Challenges 4

WIP

Copyright (c) 2019 Iuliana Caesaris Augusta

About

Iuliana Challenges App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages