Skip to content

A mobile app that allows employed to clock in and out. React front end uses back end API to retrieve and update information regarding their respective entry on the time sheet.

Notifications You must be signed in to change notification settings

geraldgsh/time-tracker

Repository files navigation

Time Tracker

Ruby on Rails React

Snapshot

Introduction.

A mobile app that allows employed to clock in and out. React front end uses back end API to retrieve and update information regarding their respective entry on the timesheet.

Tools

  • Rails
  • Ruby
  • API
  • Node.js
  • React
  • React-DOM
  • npm
  • CSS
  • ES6
  • Webpack

Ruby On Rails / React

This is the GitHub Actions configuration. If you are looking for the Stickler configuration, you can find it here.

If you are not familiar with linters and GitHub Actions, read root level README.

Set-up GitHub Actions

This GitHub Action is going to run ESLint and Stylelint to help you find style issues.

Stylelint is a linter for your stylesheets that helps you avoid errors and enforce conventions.

ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.

Please do the following steps in this order:

  1. In the first commit of your feature branch create a .github/workflows folder and add a copy of .github/workflows/linters.yml to that folder.
    • Remember to use the file linked above
    • Remember that .github folder starts with a dot.
  2. Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
  3. When you open your first pull request you should see the result of the GitHub Actions:

gh actions checks

Click on the Details link to see the full output and the errors that need to be fixed:

gh actions failing checks

Set-up linters in your local env

Note: The npm package manager is going to create a node_modules directory to install all of your dependencies. You shouldn't commit that directory. To avoid that, you can create a .gitignore file and add node_modules to it:

# .gitignore
node_modules/

Rubocop

  1. Add gem 'rubocop', '~>0.81.0' to Gemfile (not sure how to use Gemfile? Read this).
  2. Run bundle install.
  3. Copy .rubocop.yml to the root directory of your project
  4. Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
  5. Run rubocop.
  6. Fix linter errors.
  7. IMPORTANT NOTE: feel free to research auto-correct options for Rubocop if you get a flood of errors but keep in mind that correcting style errors manually will help you to make a habit of writing a clean code!

Stylelint

  1. Run

    npm install --save-dev stylelint@13.3.x stylelint-scss@3.17.x stylelint-config-standard@20.0.x stylelint-csstree-validator
    

    (not sure how to use npm? Read this).

$ npm install --save-dev stylelint@13.3.x stylelint-scss@3.17.x stylelint-config-standard@20.0.x stylelint-csstree-validator

+ stylelint-config-standard@20.0.0
+ stylelint-csstree-validator@1.8.0
+ stylelint-scss@3.17.2
+ stylelint@13.3.3
added 136 packages from 91 contributors, removed 10 packages, updated 6 packages and audited 1987 packages in 67.901s

113 packages are looking for funding
  1. Copy .stylelintrc.json to the root directory of your project.
  2. Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
  3. Run
    npx stylelint "**/*.{css,scss}"
    
    on the root of your directory of your project.
  4. Fix linter errors.
  5. IMPORTANT NOTE: feel free to research auto-correct options for Stylelint if you get a flood of errors but keep in mind that correcting style errors manually will help you to make a habit of writing a clean code!

Test/Deployment Actions

Feel free to add your own deployment actions which can run your tests and deploy to Heroku.

Make sure that you do not modify the .github/workflows/linters.yml but that you create a separe GitHub Action workflow file for that.

Troubleshooting

  • If you are building an API only Rails application For API only Rails application you can remove the Stylelint config. To do so remove line no. 23 to 36 from the linter.yml file.

Future Features

To begin

  1. Clone Repo by using this command 'git clone --branch development https://github.com/geraldgsh/time-tracker.git'.
  2. Follow instruction in this link for DB setup.
  3. Run 'rails db:migrate' to initialize
  4. Run 'rails db:seed' to generate one user in DB
  5. Type rails server in terminal within root project folder.
  6. Open http://localhost:3000 to view it in the browser.

To Test

Run the following command terminal for root folder

$ bundle exec rspec spec/models
.......

Finished in 0.26756 seconds (files took 2.63 seconds to load)
7 examples, 0 failures

Wiki

Checkout our wikipage for details on development cycles.

Live Demo

Demo

Prerequisites

Web browser like Chrome, Mozilla or similar.

Github Repo

https://github.com/geraldgsh/time-tracker

👤 Author

Github: geraldgsh

Twitter: geraldgsh

Linkedin: Gerald Goh

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

📝 License

This project is MIT licensed.

About

A mobile app that allows employed to clock in and out. React front end uses back end API to retrieve and update information regarding their respective entry on the time sheet.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published