{"id":30357821,"url":"https://github.com/hyuseinleshov/power-log","last_synced_at":"2026-04-08T16:01:16.535Z","repository":{"id":243887698,"uuid":"813099940","full_name":"hyuseinleshov/power-log","owner":"hyuseinleshov","description":"A strength training application developed using Spring MVC. PowerLog helps users track their workouts, monitor progress, and manage their training schedules.","archived":false,"fork":false,"pushed_at":"2024-08-07T20:39:00.000Z","size":951,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T08:46:46.586Z","etag":null,"topics":["ajax","bootstrap","fitness-tracking","hibernate","i18n","java","javascript","jpa","jquery","jwt","lombok","mapstruct","mysql","restful-api","scheduling","spring-boot","spring-mvc","spring-security","thymeleaf","web-application"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyuseinleshov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-10T13:34:55.000Z","updated_at":"2024-08-16T21:18:53.000Z","dependencies_parsed_at":"2024-07-06T22:28:54.165Z","dependency_job_id":"775be916-53aa-47bd-b713-8183e56eefe1","html_url":"https://github.com/hyuseinleshov/power-log","commit_stats":null,"previous_names":["hyuseinlesho/power-log","hyuseinleshov/power-log"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hyuseinleshov/power-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyuseinleshov%2Fpower-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyuseinleshov%2Fpower-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyuseinleshov%2Fpower-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyuseinleshov%2Fpower-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyuseinleshov","download_url":"https://codeload.github.com/hyuseinleshov/power-log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyuseinleshov%2Fpower-log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","bootstrap","fitness-tracking","hibernate","i18n","java","javascript","jpa","jquery","jwt","lombok","mapstruct","mysql","restful-api","scheduling","spring-boot","spring-mvc","spring-security","thymeleaf","web-application"],"created_at":"2025-08-19T08:31:11.676Z","updated_at":"2026-04-08T16:01:16.529Z","avatar_url":"https://github.com/hyuseinleshov.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerLog\nPowerLog is a Spring MVC web application designed to help strength training enthusiasts track their workouts, monitor progress, and manage their training schedules.\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Features](#features)\n- [Technologies Used](#technologies-used)\n- [Installation](#installation)\n- [API Endpoints](#api-endpoints)\n- [Database Schema](#database-schema)\n- [Security](#security)\n- [Validation and Error Handling](#validation-and-error-handling)\n- [Internationalization (i18n)](#internationalization-i18n)\n- [Contact Management](#contact-management)\n- [Events and Scheduling](#events-and-scheduling)\n- [Apache Kafka](#apache-kafka)\n- [Mapping](#mapping)\n- [Testing](#testing)\n- [Front-end Design](#front-end-design)\n- [Usage](#usage)\n- [Contact](#contact)\n\n## Introduction\nPowerLog was developed as part of the [Spring Advanced Course @ SoftUni](https://softuni.bg/trainings/4532/spring-advanced-june-2024). It provide a comprehensive strength training tracking system.\n\n## Features\n- **Home, About, and Contact pages:** Accessible to unauthenticated users.\n- **Authentication:** Login and register options.\n- **Workout Management:**\n  - Create, update, and delete workouts.\n  - Use routines as templates for new workouts.\n  - Create custom exercises.\n  - View exercise progress with graphs using Chart.js.\n- **Tools:**\n  - Log daily weight and view progress graphs.\n  - Store and view progress photos.\n- **Account Management:**\n  - View and edit profile information (email, password).\n- **Admin Dashboard:**\n  - View all users.\n  - View all contacts.\n  - Access to app interface settings and usage statistics.\n  - Role-based access control with user and admin roles.\n\n## Technologies Used\n- **Backend:** Spring Framework, Spring Boot\n- **Frontend:** JavaScript, jQuery, AJAX, HTML, Bootstrap, Thymeleaf, Thymeleaf Layout Dialect, Chart.js, DataTables\n- **Database:** MySQL, Hibernate (JPA provider)\n- **Messaging:** Apache Kafka\n- **Storage Cloud:** Cloudinary\n- **Security:** Spring Security, JWT authentication with refresh tokens\n- **Other Libraries:** MapStruct, Lombok\n\n## Installation\n### Prerequisites\n- JDK 17+\n- Gradle\n- MySQL\n\n### Steps\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/hyuseinlesho/power-log.git\n2. Set up environment variables.\n   ```bash\n   DB_USERNAME=\n   DB_PASSWORD=\n   SECRET_KEY=\n   ACCESS_TOKEN_EXPIRATION=\n   REFRESH_TOKEN_EXPIRATION=\n   REMEMBER_ME_REFRESH_TOKEN_EXPIRATION=\n   ACCESS_TOKEN_COOKIE_MAX_AGE=\n   REFRESH_TOKEN_COOKIE_MAX_AGE=\n   REMEMBER_ME_REFRESH_TOKEN_COOKIE_MAX_AGE=\n   MAIL_USERNAME=\n   MAIL_PASSWORD=\n   ADMIN_EMAIL=\n   CLOUDINARY_CLOUD_NAME=\n   CLOUDINARY_API_KEY=\n   CLOUDINARY_API_SECRET=\n3. Set up used Cloudinary for storing progress pictures, install and run Apache Kafka server for messages from ContactService or uncomment this property in `application.yaml`:\n\n![disable-kafka-auto-configuration-powerlog](https://github.com/user-attachments/assets/6555752e-9dab-4728-a469-6d0770a641b3)\n\n4. Run the application and enjoy it!\n\n## API Endpoints\n\n### Authentication Controller\n\n- `GET /auth/login`\n- `POST /auth/login`\n- `GET /auth/register`\n- `POST /auth/register`\n- `POST /auth/logout`\n\n### Contact Controller\n\n- `GET /contact`\n- `POST /contact`\n\n### Exercise Controller\n\n- `GET /exercises`\n- `GET /exercises/graph`\n\n### Home Controller\n\n- `GET /`\n- `GET /about`\n- `GET /home`\n\n### Progress Photo Controller\n\n- `GET /progress-photos`\n- `GET /progress-photos/upload`\n\n### Routine Controller\n\n- `GET /workouts/routines`\n- `GET /workouts/routines/create`\n- `POST /workouts/routines/create`\n- `POST /workouts/routines/{id}/delete`\n- `GET /workouts/routines/{id}/details`\n- `GET /workouts/routines/{id}/edit`\n- `POST /workouts/routines/{id}/edit`\n\n### User Controller\n\n- `GET /users/profile`\n\n  ### Weight Log Controller\n\n- `GET /weight-logs`\n- `POST /weight-logs/graph`\n\n### Workout Controller\n\n- `GET /workouts/create`\n- `POST /workouts/create`\n- `GET /workouts/history`\n- `GET /workouts/history/search`\n- `POST /workouts/{id}/delete`\n- `GET /workouts/{id}/details`\n- `GET /workouts/{id}/edit`\n- `POST /workouts/{id}/edit`\n \n#### Other is used for AJAX requests\n\n### Exercise Log REST Controller\n\n- `GET /api/exercise-logs`\n\n### Exercise REST Controller\n\n- `POST /api/exercies/create`\n- `PUT /api/exercies/{id}`\n- `DELETE /api/exercies/{id}`\n\n### User Profile REST Controller\n\n- `POST /users/profile/change-email`\n- `POST /users/profile/change-password`\n\n### Weight Log REST Controller\n\n- `GET /api/weight-logs`\n- `POST /api/weight-logs/create`\n- `PUT /api/weight-logs/{id}`\n- `DELETE /api/weight-logs/{id}`\n\n## Database Schema\n\n- The database schema for the PowerLog application is designed to support the functionalities required for tracking strength training workouts, user authentication, and role-based access control. Below is a detailed description of each table and its relationships.\n\n### ER Diagram\n\n![er-diagram](https://github.com/user-attachments/assets/ddd8c227-f690-4b6f-8636-357a24ee10b7)\n\n- This schema ensures that each user can have multiple roles, workouts, exercises, routines, weight logs, and progress photos, providing a comprehensive structure for the application's functionality.\n\n## Security\n\n- Custom JWT authentication with refresh tokens based on [this tutorial](https://medium.com/@tericcabrel/implement-jwt-authentication-in-a-spring-boot-3-application-5839e4fd8fac).\n- Role-based authentication with user and admin roles.\n- Security features including CSRF protection and password hashing.\n\n## Validation and Error Handling\n\n- Client-side and server-side validation.\n\n### Examples of validation messages.\n![contact-validations](https://github.com/user-attachments/assets/ae4010c5-c258-4eee-bb70-1b8fd713c38a)\n![login-validation](https://github.com/user-attachments/assets/72818760-b42e-4fcb-8681-8e496bb96daf)\n![client-side-validation](https://github.com/user-attachments/assets/0bad0045-271b-4b8c-b6e1-06741db41d55)\n\n## Internationalization (i18n)\n\n- Supported languages: English, Bulgarian, and German.\n\n![change-language-dropdown](https://github.com/user-attachments/assets/f09155c6-495c-4087-a402-a1582209c837)\n![home-en](https://github.com/user-attachments/assets/2379010f-a7f5-4264-b5d2-4b087410b499)\n![home-bg](https://github.com/user-attachments/assets/ebfe21cc-55b0-458c-a743-862730e214c3)\n\n## Contact Management\n\nUtilizes a separate REST service, [ContactService](https://github.com/hyuseinlesho/contact-service), for saving new contacts and fetching contacts based on date.\n\n## Events and Scheduling\n\n- Event which send welcome email after a new user registers.\n\n![welcome-email-example](https://github.com/user-attachments/assets/34d54c13-33e8-4928-bbee-a892b75a42bb)\n\n- Event which send notification email after users create now contact.\n- Consume new messages from ContactService producer through Kafka\n\n![new-contact-notification-email](https://github.com/user-attachments/assets/11bc120a-8151-446e-8e8a-a2e69fcb3205)\n\n- Scheduler to send a weekly contact summary email to the admin with new contacts created.\n\n![weekly-contact-summary-email](https://github.com/user-attachments/assets/4b01523a-4916-4f22-aaa2-bea26ae91b9d)\n\n## Apache Kafka\n\n### Setup and Configuration\n\n- Ensure Apache Kafka is installed and running to test it locally.\n\n### Contact Consumer\n\n- Consumes messages from the Kafka topic `contact-topic` and ContactService as producer.\n- Parses the consumed message and processes the contact data.\n- Configured consumer settings, including bootstrap servers, key and value deserializers, and group ID in `application.yaml` file.\n\n### Process Contact\n\n- Processes the contact data after consumption from Kafka.\n- Sends notification email to the admin when a new contact is created.\n\n### Note\n\n- Ensure that Kafka server is installed and running when testing the integration.\n\n## Mapping\n\n- Use MapStruct for DTO conversions.\n\n## Testing\n\n- Unit tests for service layer.\n- Integration tests for REST controllers.\n- Achieved ~60% line coverage.\n\n## Front-end Design\n\nThe PowerLog application uses modern web technologies to ensure a responsive and user-friendly interface. Key technologies include:\n\n### Thymeleaf Templates with Layout Dialect\n\n- **Thymeleaf**: Used as the template engine to generate dynamic HTML content on the server side.\n- **Layout Dialect**: Provides tools to create reusable layouts, components, and fragments, ensuring consistency across the application.\n- **Security Integration**: Manages user authentication and authorization within templates using Spring Security.\n\n### Bootstrap for Styling\n\n- **Bootstrap 5**: Utilized for responsive CSS styling and layout design, offering a library of pre-designed components like forms, buttons, and navigation bars.\n- **Modals**: Used for creating dialog boxes and forms for user interactions without navigating away from the current page.\n\n### JavaScript and AJAX for Interactivity\n\n- **JavaScript**: Enhances user interactions and provides dynamic functionality on the client side, including form validation and event handling.\n- **AJAX**: Enables asynchronous communication with the server, allowing data to be sent and received without reloading the page, thus improving user experience.\n\n### Chart.js for Data Visualization\n\n- **Chart.js**: Utilized for creating responsive and interactive charts, helping to visualize workout progress and other data in a clear and engaging manner.\n\n### DataTables for Tabular Data\n\n- **DataTables**: Provides advanced interaction controls for HTML tables, such as sorting, filtering, and pagination, making it easier to manage and analyze tabular data.\n\n## Usage\n\nHere is a demonstration video of PowerLog application:\n\n- [PowerLog demo](https://youtu.be/bhbnsqqFx3Y)\n\n### * Note that this video is from 2024/07/28\n\n## Contact\n\n- Author: Hyusein Lesho\n- [Email](mailto:hl.dev.acc@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyuseinleshov%2Fpower-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyuseinleshov%2Fpower-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyuseinleshov%2Fpower-log/lists"}