Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fastruby/pecas
Classy Leaderboards for Noko Time (and Alarms!)
https://github.com/fastruby/pecas
hacktoberfest hacktoberfest2022 leaderboards noko ombulabs open-source pecas rails
Last synced: about 1 month ago
JSON representation
Classy Leaderboards for Noko Time (and Alarms!)
- Host: GitHub
- URL: https://github.com/fastruby/pecas
- Owner: fastruby
- License: mit
- Created: 2015-06-01T21:10:14.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T20:57:28.000Z (over 1 year ago)
- Last Synced: 2023-09-12T04:14:34.012Z (over 1 year ago)
- Topics: hacktoberfest, hacktoberfest2022, leaderboards, noko, ombulabs, open-source, pecas, rails
- Language: Ruby
- Homepage: https://fastruby.github.io/pecas/
- Size: 650 KB
- Stars: 7
- Watchers: 14
- Forks: 5
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: code-of-conduct.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Pecas: Leaderboards for [Noko](https://nokotime.com)
[![Build Status](https://travis-ci.org/fastruby/pecas.svg?branch=master)](https://travis-ci.org/fastruby/pecas)
[![Code Climate](https://codeclimate.com/github/fastruby/pecas/badges/gpa.svg)](https://codeclimate.com/github/fastruby/pecas)Pecas is a time tracking leaderboard for
[https://nokotime.com](https://nokotime.com).## Getting started
To get started with the app, clone the repo and then install the needed gems running the setup script:
```bash
git clone [email protected]:fastruby/pecas.git
cd pecas
./bin/setup
```## Environment Variables
The command `./bin/setup`, among other things, creates the `.env` file which contains the following env variables:
```yml
# .env.sample
NOKO_ACCOUNT_HOST=ombulabs
NOKO_TOKEN=foobar
SMTP_SERVER=smtp.sendgrid.net
SMTP_PORT=587
SMTP_DOMAIN=ombushop.com
[email protected]
SMTP_USER_PASSWORD=secret
COUNTRY_CODE="ar"
DATABASE_NAME="pecas"
BASIC_AUTH_NAME="user"
BASIC_AUTH_PASSWORD="secret"
```Now, you just need to update the `NOKO_TOKEN` env with the correct value.
You can fetch the token value from the Noko app, after logging in, you can find the `API token` or create a new one under the `Connected Apps > Noko API > Personal Access Tokens` section.The `BASIC_AUTH_NAME` and `BASIC_AUTH_PASSWORD` are already setup from the `.env.sample` file but you can change their values at any time, will be used for a basic http auth for the application.
## Slack Notifications
If you want to use Pecas to send Slack messages you'll also need to setup
`SLACK_OAUTH_TOKEN` in the `.env` file. This requires a `SLACK_OAUTH_TOKEN`
generated with the following scopes:* chat:write
* usergroups:read
* users.profile:read
* users:read
* users:read.emailOnce set up we can use the rake task `notify:send_noko_format_warning['']`.
This task is destined to be run once an hour (for best results - a few minutes
after the hour) as it will only notify users Slack reports as being in the
timezone currently within an hour of 8pm.## Start
You can setup your `COUNTRY_CODE` environment variable with an ISO 3166 country code.
Otherwise the emails will be sent on holidays.## Starting the Server
```bash
rails s
```Go to `http://localhost:3000` and start your session with the `BASIC_AUTH_NAME` and `BASIC_AUTH_PASSWORD` values.
## Running Tests
```bash
rspec
```## Using Docker
> NOTE: You'll need to have docker and docker-compose installed
Build the pecas docker image
```bash
docker-compose build
```First-time only
```bash
docker-compose run web /bin/bash
./bin/setup
```Start
```bash
docker-compose up
```## Import
Import the entries with:
rake import:entries
Calculate the leaderboards with:
rake calc:leaderboards
## Demo Data
Generate demo data with:
rake demo_data:setup
## Deleting old data
You can run this task specifying the number of months ago for the query:
# delete entries with date older than 6 months ago
MONTHS=6 rake delete_past_entries## Contributing
Bug reports and pull requests are welcome on GitHub at [https://github.com/fastruby/pecas](https://github.com/fastruby/pecas). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
When Submitting a Pull Request:
- If your PR closes any open GitHub issues, please include `Closes #XXXX` in your comment
- Please include a summary of the change and which issue is fixed or which feature is introduced.
- If changes to the behavior are made, clearly describe what changes.
- If changes to the UI are made, please include screenshots of the before and after.
## License
[License]
[license]: LICENSE
## Sponsorship
![FastRuby.io | Rails Upgrade Services](app/assets/images/fastruby-logo.png)
`Pecas` is maintained and funded by [FastRuby.io](https://fastruby.io). The names and logos for FastRuby.io are trademarks of The Lean Software Boutique LLC.