Coder Social home page Coder Social logo

mateusbw / punchclock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramos-ph/punchclock

0.0 0.0 0.0 6.54 MB

A simple electronic punch clock to track hours spent on projects.

License: GNU Affero General Public License v3.0

Shell 0.02% JavaScript 6.49% Ruby 79.31% CSS 0.05% HTML 9.11% Dockerfile 0.25% SCSS 4.76% Procfile 0.01%

punchclock's Introduction

Punchclock

A simple electronic punch clock to track hours spent on projects.

Ruby Maintainability Test Coverage

Dependencies

Ruby 3.1
Rails 7.0
Postgres >= 13.7
Node 16.13.1

Installing

$ git clone [email protected]:Codeminer42/Punchclock.git
$ cd Punchclock
$ cp .env.example .env
$ Install Postgres
$ Install Redis
$ bin/setup

Database

After installation steps the following admin users will be created in database

  1. An Admin User
E-mail:   [email protected]
Password: password

Adding new Javascript

Javascript with ES6 syntax should be compiled by webpack instead of sprockets as of now. The Javascript may work in development mode in modern browsers, but it will break in production mode, be aware.

Running

Server

Run it on development mode using thin

$ foreman start -f Procfile.dev

To enable guard-livereload, you need to install the LiveReload extension on your browser.

In another terminal, start Guard:

$ bundle exec guard

After that, start the extension on your browser. You'll see a browser connection browser on the terminal.

Freely make your changes and the page will be refreshed after you save it.

Docker environment for development

Install the docker and docker compose plugin versions:

  • Docker ~>v20.10
  • Docker compose plugin ~>v2.10
$ cp .env.example .env
$ cp config/database.yml.example config/database.yml
$ docker compose build
$ docker compose run --rm app bundle install
$ docker compose run --rm app yarn install --frozen-lockfile
$ docker compose run --rm app bundle exec rake db:reset
$ docker compose run --rm app bundle exec rake db:create

Useful commands

Access Rails console:

$ docker compose run --rm app rails c

If you want to run tests:

$ docker compose run --rm app bundle exec rspec

Now run the servers:

$ docker compose up

Testing

This app uses RSpec, Factory Girl, Forgery and Faker to fake reality. Please read betterspecs.org.

At first time:

$ bundle exec rake db:migrate

Running tests:

$ bundle exec rake spec

Running with Guard:

$ bundle exec guard

Debugging

To debug this app, follow the following steps, for more details about debugging with pry, read the official documentation here: https://pry.github.io/ .

Running with foreman

At the point of code that you want to debug, add:

binding.remote_pry

Run you application, the app should stop at the point that you added binding.remote_pry.

In you terminal, run:

$ bundle exec pry-remote

Now you will get the piece of code where you can debug.

Running with rails server

At the point of code that you want to debug, add:

binding.pry

Run you application, the app should stop at the point that you added binding.pry and you will get the piece of code where you can debug.

Debugguing a test

At the point of code that you want to debug, add:

binding.pry

In you terminal, run:

$ bundle exec rspec <PATH_TO_FILE>

Exiting the debug mode

To exit the pry console, type:

To hard exit:

-> !!!

To soft exit:

-> exit

License

Copyright 2013-2021, Codeminer 42.

Punchclock is made available under the Affero GPL license version 3, see LICENSE.txt.

punchclock's People

Contributors

adbatista avatar alexandresaura avatar andrelumor avatar brunnohenrique avatar caps-looking avatar carloslopes avatar cassianoblonski avatar daniloisr avatar dantealg avatar dependabot[bot] avatar diogosonsim avatar douglaslutz avatar edddieee avatar fabiosaito avatar fabiosammy avatar gabrielrumiranda avatar geeksilva97 avatar halan avatar heatskr avatar heitormc avatar jeduardo824 avatar laka3000 avatar lucascarrias avatar mateuscelio avatar mildojr avatar moiseshilario avatar rhiroyuki avatar sadjow avatar tonyaraujop avatar wenderjean 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.