Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
179 commits
Select commit Hold shift + click to select a range
6d81f2c
Add initial api setup
ViriCruz May 13, 2020
242c644
Add scaffolded files for user,category,reading and measurement
ViriCruz May 13, 2020
09eab3a
Add rspec config file
ViriCruz May 13, 2020
ab41b7f
Add api and v1 folders for versioning the api
ViriCruz May 13, 2020
1c70e66
Add rspec initial files
ViriCruz May 13, 2020
b9aa28e
Add namespaces for versioning the api
ViriCruz May 13, 2020
0603a51
Add faker, rspec, factory bot rails, shoulda matchers and database cl…
ViriCruz May 13, 2020
98de181
Move controllers to api/v1 directory
ViriCruz May 13, 2020
c33021b
Add format --documentation config
ViriCruz May 14, 2020
2953b94
Add shoulda-matchers and database_cleaner config
ViriCruz May 14, 2020
65b07c3
Add unit tests for user, category, reading and measurement models
ViriCruz May 14, 2020
ae9565c
Add validations and relationships to controllers
ViriCruz May 14, 2020
7aa67e7
Add json method to parse json in every request
ViriCruz May 14, 2020
5bb226c
Add categories and readings factories
ViriCruz May 14, 2020
15b1055
Add request spec for categories
ViriCruz May 14, 2020
f8ec178
Add support files config
ViriCruz May 14, 2020
76af943
Add exception handler and response helpers
ViriCruz May 15, 2020
5d363b3
Add jbuilder templates for user and categories
ViriCruz May 15, 2020
bea5a6d
Add request specs for /api/v1/categories/:id endpoint
ViriCruz May 15, 2020
13691e6
Add response and exception handler modules
ViriCruz May 15, 2020
86d75f0
Refactor controller to use json_response helper
ViriCruz May 15, 2020
089a5ec
Create .stickler.yml
ViriCruz May 15, 2020
bd5484b
Create .rubocop.yml
ViriCruz May 15, 2020
dc1b617
Modify exclude files
ViriCruz May 15, 2020
0231a01
Add user basic factory
ViriCruz May 15, 2020
bd437c2
Add request specs for readings endpoint
ViriCruz May 15, 2020
021771b
Remove unnecessary request specs
ViriCruz May 15, 2020
d412310
Refactor reading factory
ViriCruz May 15, 2020
7da611f
Refactor model specs for reading
ViriCruz May 15, 2020
a8bf18e
Add nested resources for readings and modify categories resources to …
ViriCruz May 15, 2020
3f19c29
Remove validates presence of created_at attribute
ViriCruz May 15, 2020
8a1070e
Refactor readings_controller
ViriCruz May 15, 2020
40ef4a9
Refactor users_controller
ViriCruz May 15, 2020
23738f4
Add bcrypt gem
ViriCruz May 17, 2020
115ca68
Add authenticate_user and authorize_api_request controllers
ViriCruz May 17, 2020
1a21979
Add authentication controller to return auth token once user is authe…
ViriCruz May 17, 2020
c620e0c
Add json_web_token to encode and decode token. Also add a message hel…
ViriCruz May 17, 2020
8eff45f
Add migrations to update database tables
ViriCruz May 17, 2020
2a6da6b
Add specs for authenticate user and authorize api request controllers
ViriCruz May 17, 2020
d1c9512
Add specs for application controller
ViriCruz May 17, 2020
756c498
Add measurement factory
ViriCruz May 17, 2020
a6ea20a
Add request specs for authentication, measurements and users controllers
ViriCruz May 17, 2020
e5516b4
Add helper for controllers in specs
ViriCruz May 17, 2020
f27ab74
Add jbuilder template for measurements#index
ViriCruz May 17, 2020
b9c4f47
Refactor jbuilder template for users to come with readings user data
ViriCruz May 17, 2020
499e40e
Add signup to create users, auth/login to authenticate user and refac…
ViriCruz May 17, 2020
aaa8f5e
Refactor controller to support authentication errors
ViriCruz May 17, 2020
9caf4cf
Add authorize_request method to return authenticated current user
ViriCruz May 17, 2020
93e342e
Refactor controllers
ViriCruz May 17, 2020
2375fa9
Modify rails_helper when importing support files
ViriCruz May 17, 2020
2cbb784
Refactor models
ViriCruz May 17, 2020
dd09e3f
Remove duration:time and add hours and minutes columns to readings table
ViriCruz May 17, 2020
d98b76d
Refactor controllers to pas the tests
ViriCruz May 17, 2020
c3e5228
Add day column to readings
ViriCruz May 17, 2020
25caa98
Refactor readings controller, model and specs
ViriCruz May 17, 2020
0c71bb7
Add total_time method to readings controller
ViriCruz May 18, 2020
e46a44f
Add format_time to readings_controller
ViriCruz May 18, 2020
3a8a9d3
Correct rubocop linting errors
ViriCruz May 18, 2020
4a4f21f
Update .rubocop.yml
ViriCruz May 18, 2020
ef362c9
Update rubocop file
ViriCruz May 18, 2020
99a700f
Update stickler
ViriCruz May 18, 2020
ec8d1f8
Add rubocop and stickler to root folder
ViriCruz May 18, 2020
966a0ad
Update stickler location
ViriCruz May 18, 2020
3b6d41d
Update rubocop
ViriCruz May 18, 2020
e8b5714
Update .rubocop.yml
ViriCruz May 18, 2020
e612e43
Update .rubocop.yml
ViriCruz May 18, 2020
a683dc3
Update .rubocop.yml
ViriCruz May 18, 2020
22051d2
Update stickler
ViriCruz May 18, 2020
0b468f3
Update stickler
ViriCruz May 18, 2020
fafbada
Add procfile to deploy to heroku
ViriCruz May 18, 2020
c9c667d
Add initial create react app
ViriCruz May 18, 2020
5b47d6b
Add CORS with rack-cors
ViriCruz May 18, 2020
f74eb0a
Add prop-types, react-redux and redux packages
ViriCruz May 19, 2020
ff1df0c
Delete yarn.lock
ViriCruz May 19, 2020
546d3dd
Add redux actions and remove unnecessary files
ViriCruz May 19, 2020
4c3ed2b
Add categories reducer
ViriCruz May 19, 2020
e125f26
Add eslint config
ViriCruz May 19, 2020
f701380
Add babel config file
ViriCruz May 19, 2020
3bdad6c
Add barebones components
ViriCruz May 19, 2020
067aff6
Add reducers for user,reading,category,measurement entity
ViriCruz May 19, 2020
1f0c238
Remove unnecessary files and add enzyme to setupTests.js
ViriCruz May 19, 2020
645e96e
Add reset css
ViriCruz May 20, 2020
278e5ed
Add barebone code
ViriCruz May 20, 2020
bd14196
Refactor users controller
ViriCruz May 20, 2020
7f121c1
Add logs
ViriCruz May 20, 2020
8399e2f
Add production config
ViriCruz May 20, 2020
345980b
Add seed to create categories
ViriCruz May 20, 2020
647e376
Fix linting errors
ViriCruz May 20, 2020
ebd58f9
Add bootstrap classes to registration form component
ViriCruz May 20, 2020
1df3638
Refactor data object that is dispatched when post successful
ViriCruz May 20, 2020
a808670
Add mapDispatchToProps and mapStateToProps to store data in redux store
ViriCruz May 20, 2020
1b0da47
Change data array to data object in initialState object
ViriCruz May 20, 2020
aa73e60
Add loginForm component and redirect users after registration
ViriCruz May 20, 2020
0f5c60b
Add categories list component
ViriCruz May 21, 2020
8805af0
Add fetch categories module
ViriCruz May 21, 2020
5281706
Add onClick listener
ViriCruz May 21, 2020
1fd9bfb
Add loginForm route
ViriCruz May 21, 2020
a41e117
Add basic navbar
ViriCruz May 21, 2020
aa05a7f
Add form to trackReading component
ViriCruz May 21, 2020
af4d77a
Add stopWatch barebones component
ViriCruz May 21, 2020
2449957
Refactor json object for categories and readings. Also fix linting er…
ViriCruz May 21, 2020
6deb0d0
Add action dispatcher to set category
ViriCruz May 22, 2020
afbb695
Add readingContainer component
ViriCruz May 22, 2020
b519780
Rename categoryReducer to categoriesReducer
ViriCruz May 22, 2020
4c9ea2e
Add categoryReducer
ViriCruz May 22, 2020
7836d73
Add default route to redirect to signin
ViriCruz May 25, 2020
151ef26
Add register link at bottom
ViriCruz May 25, 2020
62dfc8f
Add fetch post method to signin user
ViriCruz May 26, 2020
671b678
Add mapStateToProps and dispatchToProps to connect with redux store
ViriCruz May 26, 2020
46c7d3a
Refactor error case to send correctly error message to redux store
ViriCruz May 26, 2020
08db0fb
Change redirect to /categories
ViriCruz May 26, 2020
f84ab4c
Add signout action
ViriCruz May 26, 2020
835fbcd
Add signout function
ViriCruz May 26, 2020
49ad9e6
Add spinner component while fetching
ViriCruz May 26, 2020
63e7fcc
Add not_logged_in case
ViriCruz May 26, 2020
1083a57
Add links for signin and signout status
ViriCruz May 26, 2020
560c41f
Add dispatch and state to props
ViriCruz May 26, 2020
7ddb434
Refactor NOT_LOGGED_IN case
ViriCruz May 26, 2020
d6af1cb
Change import for navbar component
ViriCruz May 26, 2020
151cfcc
Add redirect to login if user is not logged in or when logout
ViriCruz May 27, 2020
b57da8d
Add handleSave function to readings component
ViriCruz May 27, 2020
bf22d1d
Add stopwatch component
ViriCruz May 27, 2020
8cefb95
Merge branch 'react-app' of github.com:ViriCruz/readouts_tracker into…
ViriCruz May 27, 2020
bb6d13a
Add create reading function to call api
ViriCruz May 28, 2020
32805b2
Add helper functions to extract time in numbers. Also add setDuration…
ViriCruz May 28, 2020
497b079
Add props to handle save, set duration, set description and props to …
ViriCruz May 28, 2020
b6d8086
Add handle save, set duration and set description to pass as props to…
ViriCruz May 28, 2020
59f1f57
Refactor fetch function to create a new reading
ViriCruz May 29, 2020
1217b6b
Remove disabled prop
ViriCruz May 29, 2020
61bb643
Refactor condition to evaluate if categories prop exists on data
ViriCruz May 29, 2020
96e41e9
Add map dispatch to props
ViriCruz May 29, 2020
254590b
Add callback fn to setState when saving duration to avoid delay
ViriCruz May 29, 2020
348c54a
Add recharts
ViriCruz May 29, 2020
ba0d1fc
Add measure component
ViriCruz May 29, 2020
ef4e95a
Add measurements barebones component
ViriCruz May 29, 2020
f837522
Fix total_hours method
ViriCruz May 29, 2020
6e75c4a
Add print to debug
ViriCruz May 30, 2020
bdabc66
Add json message when readings of current date does not exist
ViriCruz May 30, 2020
a8c9099
Fix readings spec and linting errors
ViriCruz May 30, 2020
198c75b
Add actions for fetching total time
ViriCruz May 31, 2020
4d04af6
Add function to fetch total time
ViriCruz May 31, 2020
817d79b
Remove onChange from div
ViriCruz May 31, 2020
d235a71
Remove className vh-100
ViriCruz May 31, 2020
5cbe945
Add totalTime to state
ViriCruz May 31, 2020
d9336e0
Add totalTime to store
ViriCruz May 31, 2020
a72ad67
Add totalTime to combineReducers
ViriCruz May 31, 2020
4858d2b
Add reducer for total time
ViriCruz May 31, 2020
16c015b
Add function to create measure
ViriCruz Jun 1, 2020
dd99994
Add fetchMeasurements function to retrieve measurements data
ViriCruz Jun 1, 2020
5ac33f4
Refactor total time method and api/v1/measurements/:day route added
ViriCruz Jun 1, 2020
fb8522b
Add component did update to reading container
ViriCruz Jun 1, 2020
1917109
Add pie chart
ViriCruz Jun 2, 2020
ec786f8
Add moment-react
ViriCruz Jun 3, 2020
bfe9da2
Add data fetched from api to fit on pie chart
ViriCruz Jun 3, 2020
63402f5
Add tests for categories container component
ViriCruz Jun 3, 2020
93e1148
Add tests for registrationForm component
ViriCruz Jun 3, 2020
16f7044
Add tests for reading container component
ViriCruz Jun 3, 2020
fbdafe5
Add tests for navbar component
ViriCruz Jun 3, 2020
9ce696f
Add tests for measurements component
ViriCruz Jun 3, 2020
4e8ab31
Add tests for login form component
ViriCruz Jun 4, 2020
f21ea40
Add custom style to navbar
ViriCruz Jun 4, 2020
fe1054e
Restore file
ViriCruz Jun 4, 2020
04af033
Add custom css to all components
ViriCruz Jun 4, 2020
516f0f6
Add custom css and fix linting errors
ViriCruz Jun 4, 2020
0af0fef
Add favicon and refactor html structure for signin links
ViriCruz Jun 4, 2020
ce0b985
Add eslintrc.json to root
ViriCruz Jun 4, 2020
0a8a6a6
Fix linting errors
ViriCruz Jun 4, 2020
25182e0
Merge pull request #2 from ViriCruz/react-app
ViriCruz Jun 4, 2020
10b1509
Merge branch 'project' into ror_api
ViriCruz Jun 4, 2020
9df0e1d
Merge pull request #3 from ViriCruz/ror_api
ViriCruz Jun 4, 2020
f7ab778
Fix tests for some somponents
ViriCruz Jun 5, 2020
a793da8
Fix proptypes validation for measurements, categories and login form
ViriCruz Jun 5, 2020
96a82c6
Modify README file
ViriCruz Jun 5, 2020
97c4ad9
Fix tests
ViriCruz Jun 5, 2020
eff5584
Update readme file
ViriCruz Jun 5, 2020
884afd7
Modify readme
ViriCruz Jun 5, 2020
ebf35f6
Update measurements.js
ViriCruz Jun 5, 2020
43b1904
Add errors to state
ViriCruz Jun 10, 2020
48e08aa
Merge branch 'project' of github.com:ViriCruz/readouts_tracker into p…
ViriCruz Jun 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": ["airbnb", "plugin:react/recommended"],
"plugins": ["react"],
"rules": {
"react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }],
"import/no-unresolved": "off",
"no-shadow": "off",
"arrow-parens": ["error", "as-needed"]
}
}
22 changes: 22 additions & 0 deletions .stickler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# add the linters you want stickler to use for this project
linters:
rubocop:
display_cop_names: true
# indicate where is the config file for stylelint
config: './rubocop.yml'
eslint:
# indicate where is the config file for stylelint
config: './.eslintrc.json'

# add the files here you want to be ignored by stylelint
files:
ignore:
- "**/db/*"
- "**/bin/*"
- "**/config/*"
- "**/Guardfile"
- "**/Rakefile"
- "**/README.md"
- "**/node_modules/**/*"
- "**/Gemfile"
- "**/Gemfile.lock"
76 changes: 73 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
## Readings tracker app

Initial setup for readouts tracker.
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

More information coming soon.
# Tracking mobile web app with react
This project is a tracking app to measure how much do you read during a day. Taking in count only: books, articles, audiobooks, mangas, and comics.
This is a manual tracking to acquire the habit of reading.


## Demo down below
Visit [Readouts tracker](https://readouts-tracker.herokuapp.com/ ) to try the live version.

## Built With ✨
- React 16.13
- react-router 5.1
- react-router-dom 5.1
- create-react-app
- JavaScript ES6
- Ruby on Rails

* System dependencies
Windows/ Mac


### How to use

#### Login page
If you already registered, you only need to type your email and password to sign in.

#### SignUp page
To signup, you need to fill a form with your first name, last name, email, and password. After this, you will be redirected to the main page.

#### Categories page
You will see a list of categories here, you only need to click or tap on one to select it. You will be redirected to the track reading section.

#### Track Reading page
Here you can start your manual tracking. You write a description of what you are reading, click or tap start to measure. Don't forget to save first before you edit or stop the time.

#### Measurements page
Here you can see what do you read more during a day. Showing a pie chart to represent the percentage of the categories that you read.


## How to contribute and partipate
Fork this repo and submit a PR for review and potential merge to main branch. Feel free to leave feedback :smile:

## Authors

👨‍💻 **Gabriela Cruz**

- Github [@viricruz](https://github.com/ViriCruz/)

- email me at [email protected]

- Linkedin [@viricruz](https://www.linkedin.com/in/viricruz/)

## License

This project is [MIT](LICENSE) licensed.

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[contributors-shield]: https://img.shields.io/github/contributors/viricruz/readouts_tracker.svg?style=flat-square
[contributors-url]: https://github.com/viricruz/readouts_tracker/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/viricruz/readouts_tracker
[forks-url]: https://github.com/viricruz/readouts_tracker/network/members
[stars-shield]: https://img.shields.io/github/stars/viricruz/readouts_tracker
[stars-url]: https://github.com/viricruz/readouts_tracker/stargazers
[issues-shield]: https://img.shields.io/github/issues/viricruz/readouts_tracker
[issues-url]: https://github.com/viricruz/readouts_tracker/issues
[license-shield]: https://img.shields.io/github/license/viricruz/readouts_tracker
[license-url]: https://github.com/viricruz/readouts_tracker/blob/master/LICENSE.txt
27 changes: 27 additions & 0 deletions readouts-tracker-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key
2 changes: 2 additions & 0 deletions readouts-tracker-api/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--require spec_helper
--format documentation
62 changes: 62 additions & 0 deletions readouts-tracker-api/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
AllCops:
Exclude:
- "db/**/*"
- "bin/*"
- "config/**/*"
- "Guardfile"
- "Rakefile"
- "README.md"
- "Gemfile"
- "node_modules/**/*"
- "config/application.rb"
- "db/*"
DisplayCopNames: true

Layout/LineLength:
Max: 120
Metrics/MethodLength:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 20
Metrics/AbcSize:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 50
Metrics/ClassLength:
Max: 150
Metrics/BlockLength:
ExcludedMethods: ['describe']
Max: 30

Style/Documentation:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/EachForSimpleLoop:
Enabled: false
Style/AndOr:
Enabled: false
Style/DefWithParentheses:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: never

Layout/HashAlignment:
EnforcedColonStyle: key
Layout/ExtraSpacing:
AllowForAlignment: false
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
1 change: 1 addition & 0 deletions readouts-tracker-api/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.5.1
54 changes: 54 additions & 0 deletions readouts-tracker-api/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.1'
gem 'figaro'
gem 'rubocop'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
gem 'bcrypt', '~> 3.1.7'
gem 'jwt'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem 'rack-cors'
gem 'rack-cors', '~> 0.4.0'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
%w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: 'master' # Previously '4-0-dev' or '4-0-maintenance' branch
end
gem 'capybara'
end

group :test do
gem 'database_cleaner'
gem 'factory_bot_rails'
gem 'faker'
gem 'shoulda-matchers', '~> 3.1'
end

group :development do
gem 'listen', '~> 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
Loading