Giter VIP home page Giter VIP logo

joggify's Introduction

Joggify

Joggify is a web application that allows users to track their jogging time and build up their motivation.

Basic technologies used within the project

  1. For Back-end:
  • Backbone: rails 5.1
  • Authentication: devise with devise_token_auth
  • Authorization: pundit
  • Rest APIs for all actions
  • Test: rspec with factory_bot, e2e tests use chromedriver and capybara.
  • Lint: rubocop with rules get from official rails project
  • Assets Bundler: webpacker
  • and some other gems
  1. For Front-end:
  • Backbone: react 16 with redux (Single Page App with Flux architecture)
  • Router: react-router
  • UI framework: material-ui-next
  • Form handling: redux-form
  • Development: webpack-dev-server and react-hot-loader for Hot reloading when coding
  • Use Rest API calls to fully interact with back-end
  • Lint: eslint with recommended rules for react
  • and some other node_modules

How to setup the project for development

  1. Make sure your Environment is ready!
  • Install Ruby 2.4.3 with bundler.
  • Install Node 6.12.3 or above.
  • Install yarn with npm install -g yarn.
  • Install chromedriver for e2e tests. (if you are using mac, you can easily install it using brew install chromedriver)
  • Have your local Postgres server ready, use version 9.4 or higher.
  • Pull latest source code of joggify to your computer.
  • cd to the folder that store the source code.
  1. Configurate
  • Update config/database.yml your local credentials for Postgres access.
  1. Install libraries

     # Install Gems
     bundle install
    
     # Install node_modues
     yarn install
    
     # Install foreman
     gem install foreman
    
  2. Initialise the database

     bundle exec rake db:drop db:create db:migrate
    
  3. Seed the database with example data:

     bundle exec rake db:seed
    
  4. Start hacking by running

     npm run dev
    

Done! You're ready to access the application: localhost:3000.

Sample users with scenarios

  1. Admin:
  • Email: [email protected]
  • Password: bob.admin
  • Permission:
    • This user can CRUD any time entry of any user
    • This user can view time entries reports of any user.
    • This user can CRUD any user.
    • This user cannot delete himself.
  1. Manager:
  • Email: [email protected]
  • Password: alice.manager
  • Permission:
    • This user can CRUD time entry of herself.
    • This user can view time entries reports of herself.
    • This user cannot CRUD time entry of any other user.
    • This user cannot view time entries reports of any other user.
    • This user can CRUD any user who is manager or user.
    • This user cannot delete herself.
    • This user cannot CRUD any admin user.
  1. User:
  • Email: [email protected]
  • Password: carol.user
  • Permission:
    • This user can CRUD time entry of herself.
    • This user can view time entries reports of herself.
    • This user cannot CRUD time entry of any other user.
    • This user cannot view time entries reports of any other user.
    • This user cannot CRUD any other user.
    • This user cannot delete himself.

Run Linting and Tests

  1. Run eslint and rubocop

     # Check linting for js code
     npm run lint
    
     # Check linting for ruby code
     rubocop
    
  2. Run Rspec Specs (E2E tests and Unit tests included)

     bundle exec rspec
    

Deployment guide for Heroku

# Create Heroku app
heroku create

# Install addons for postgres and sendgrid
heroku addons:create heroku-postgresql
heroku addons:create sendgrid:starter

# First deployment
git push heroku master

# Migrate the database and generate seed data
heroku run rake db:migrate
heroku run rake db:seed

# Open your deployed app, yay!!!!
heroku open

I also deployed a sample app here for demo and testing Joggify on Heroku

joggify's People

Contributors

nmqanh 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.