Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rblcoder/daily_sleep_tracker
An example of CRUD using Springboot and Thymeleaf
https://github.com/rblcoder/daily_sleep_tracker
java-8 spring-boot thymeleaf unit-testing
Last synced: about 1 month ago
JSON representation
An example of CRUD using Springboot and Thymeleaf
- Host: GitHub
- URL: https://github.com/rblcoder/daily_sleep_tracker
- Owner: rblcoder
- License: mit
- Created: 2022-05-20T05:38:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-21T13:09:40.000Z (about 1 year ago)
- Last Synced: 2023-10-22T12:25:59.506Z (about 1 year ago)
- Topics: java-8, spring-boot, thymeleaf, unit-testing
- Language: Java
- Homepage:
- Size: 126 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Java CI with Gradle](https://github.com/rblcoder/daily_sleep_tracker/actions/workflows/gradle.yml/badge.svg)](https://github.com/rblcoder/daily_sleep_tracker/actions/workflows/gradle.yml)
JaCoCo Test Coverage [![coverage](badges/jacoco.svg)](https://github.com/rblcoder/daily_sleep_tracker/actions/workflows/gradle.yml) [![branches coverage](badges/branches.svg)](https://github.com/rblcoder/daily_sleep_tracker/actions/workflows/gradle.yml)
# DevProjects - Daily sleep tracker web app
This is an open source project from [DevProjects](http://www.codementor.io/projects). Feedback and questions are welcome!
Find the project requirements here: [Daily sleep tracker web app](https://www.codementor.io/projects/web/daily-sleep-tracker-web-app-byi4kpk5rt)## Tech/framework used
Built with spring boot, db used postgresql, thymeleaf for rendering html## Functionality
This application presently supports only single user.
The user can login, create, view, update and delete entries.## Database setup
from terminal:
psql postgres
CREATE ROLE sleep WITH LOGIN PASSWORD 'somepassword';
ALTER ROLE sleep CREATEDB;GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO sleep;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO sleep;
\q
psql postgres -U sleepCREATE DATABASE sleep;
\c sleep
## Installation
I used Java 8, Intellij Idea, TablePlus to check the data
and a local postgreSQL instance## Activate profile
Specify dev or prod in SPRING_PROFILES_ACTIVE environment variableRefer
#### https://docs.spring.io/spring-boot/docs/2.7.1/reference/htmlsingle/#features.profiles
#### https://www.baeldung.com/spring-profiles## Enviroment variables
Set SPRING_USERNAME, SPRING_PASSWORD environment variables to specify spring security user name and passwordSet DB_USERNAME, DB_PASSWORD when using postgresql
## Database logging
https://vladmihalcea.com/log-sql-spring-boot/
https://github.com/gavlyukovskiy/spring-boot-data-source-decorator## License
[MIT](https://choosealicense.com/licenses/mit/)