Skip to content

πŸ’ŽπŸ³A containerized Rails web application to study athlete health data and automate reporting. πŸŠπŸΎβ€β™€οΈπŸš΅β€β™€οΈπŸƒπŸ»

Notifications You must be signed in to change notification settings

mindatasleep/health_webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmoothPeaks webapp

A containerized Ruby on Rails web application to study data and automate reporting. Developed for Smooth Peaks, an athletics Data Science company.

Consists of the following modules:

  • Data warehousing (TBD)
  • Data onboarding with API (Flask)
  • Data analysis and visualization (Python)
  • Web application and reporting (Ruby on Rails)

Import data

python3 -m analysis.src.data_import analysis/src/data/

Run PCA study

python3 -m analysis.src.studies.iris analysis/src/data/ analysis/src/plots/plot1.png

python3 -m src.studies.vega_test src/data/ src/tmp/plot_vega.html

Run analysis with docker-compose

docker run --rm -dit --name interested_hofstadter -v ${PWD}:/tmp pythonanalysis:latest

Manage Docker containers

# Example
docker build -t pythonimage .
docker run pythonimage

# Analysis module
docker build -t interested_hofstadter_image analysis
docker run --name interested_hofstadter --rm -it -v $PWD/tmp:/app/src/plots interested_hofstadter_image:latest

# Mount volumes from CLI	
docker run --name=nginx --rm -d -v $PWD/nginxlogs_del:/var/log/nginx -p 5000:80 nginx
docker exec -i pythonimage bash 
docker run --name interested_hofstadter --rm -it -v $PWD/tmp:/app/src/plots interested_hofstadter_image:latest

# Flask
docker run --rm -i -p 5000:5000 pythonflaskdemo:latest

# Rails
(https://zegetech.com/blog/2019/02/14/rails-on-docker.html)
docker-compose run --rm --service-ports app bash. 
docker-compose\'a0run [options] name_of_service [command to run]


docker-compose build
docker-compose run web rake db:create db:migrate
docker-compose up
docker-compose exec web rails console

docker-compose exec app rails db:create
# or if the container was not yet started
docker-compose run app rails db:create

# Rails drop table through console
rails console
ActiveRecord::Migration.drop_table(:table_name)

# Remove stopped containers
docker rm -v $(sudo docker ps -aq -f status=exited)

# Exec
docker container exec -it smoothpeaks_web_1 ls

Run top-level docker-compose

docker-container up --build
# On a different terminal
docker-compose run web rake db:create
docker-compose run web rake db:migrate RAILS_ENV=development

About

πŸ’ŽπŸ³A containerized Rails web application to study athlete health data and automate reporting. πŸŠπŸΎβ€β™€οΈπŸš΅β€β™€οΈπŸƒπŸ»

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published