{"id":26600903,"url":"https://github.com/imwrdo/rating-system-leverx","last_synced_at":"2026-04-06T09:32:50.764Z","repository":{"id":283260793,"uuid":"939325292","full_name":"imwrdo/rating-system-leverx","owner":"imwrdo","description":"Final project from leverx java course","archived":false,"fork":false,"pushed_at":"2025-03-19T20:13:05.000Z","size":810,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T16:23:21.972Z","etag":null,"topics":["java","junit","postgresql","redis","rest-api","software-engineering","spring","springdata-jpa","sptingboot"],"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/imwrdo.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":"2025-02-26T11:10:49.000Z","updated_at":"2025-03-19T19:35:53.000Z","dependencies_parsed_at":"2025-03-19T10:47:25.706Z","dependency_job_id":null,"html_url":"https://github.com/imwrdo/rating-system-leverx","commit_stats":null,"previous_names":["imwrdo/rating-system-leverx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imwrdo/rating-system-leverx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwrdo%2Frating-system-leverx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwrdo%2Frating-system-leverx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwrdo%2Frating-system-leverx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwrdo%2Frating-system-leverx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imwrdo","download_url":"https://codeload.github.com/imwrdo/rating-system-leverx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imwrdo%2Frating-system-leverx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31466621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: 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":["java","junit","postgresql","redis","rest-api","software-engineering","spring","springdata-jpa","sptingboot"],"created_at":"2025-03-23T18:36:00.381Z","updated_at":"2026-04-06T09:32:50.748Z","avatar_url":"https://github.com/imwrdo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rating System Application\n\nA Spring Boot application for managing user ratings and comments for game-related content.\n\n## Features\n\n### User Management\n\n- User registration and authentication\n- Role-based access control (Admin/User)\n- User activation via email confirmation\n- User profile management\n- User rankings based on ratings\n\n### Comment System\n\n- Create, read, update, and delete comments\n- Comment moderation (approval/rejection) by admins\n- Rating system (1-5 stars)\n- Anonymous commenting with optional registration\n\n### Game Objects\n\n- Game listing and management\n- Associate games with users\n- Filter ratings by game\n\n### Rating System\n\n- Automatic rating calculation\n- Average rating computation\n- Total ratings tracking\n- User ranking based on ratings\n- Rating history\n\n## Project Structure\n\n```\nrating-app/\n├── src/\n│   ├── main/\n│   │   ├── java/\n│   │   │   └── org/leverx/ratingapp/\n│   │   │       ├── config/             # Application configuration\n│   │   │       │   ├── aop/           # Aspect-oriented programming configs\n│   │   │       │   ├── init/          # Initialization configs\n│   │   │       │   ├── redis/         # Redis configuration\n│   │   │       │   └── security/      # Security configurations\n│   │   │       ├── controllers/        # REST API endpoints\n│   │   │       ├── dtos/              # Data Transfer Objects\n│   │   │       │   ├── auth/          # Authentication DTOs\n│   │   │       │   ├── comments/      # Comment DTOs\n│   │   │       │   ├── error/         # Error response DTOs\n│   │   │       │   ├── gameobject/    # Game object DTOs\n│   │   │       │   └── user/          # User DTOs\n│   │   │       ├── models/            # Entity models\n│   │   │       │   ├── entities/      # JPA entities\n│   │   │       │   └── enums/         # Enumerations\n│   │   │       ├── exceptions/         # Custom exceptions\n│   │   │       ├── repositories/       # Data access layer\n│   │   │       │   ├── redis/         # Redis repositories\n│   │   │       │   └──token/         # Token repositories\n│   │   │       └── services/          # Business logic\n│   │   │           ├── auth/          # Authentication services\n│   │   │           │   ├── jwt/       # JWT services\n│   │   │           │   └── token/     # Token services\n│   │   │           ├── comment/       # Comment management\n│   │   │           ├── email/         # Email services\n│   │   │           ├── gameobject/    # Game object services\n│   │   │           ├── pendingcomment/ # Pending comment services\n│   │   │           ├── rating/        # Rating calculations\n│   │   │           └── user/          # User operations\n│   │   └── resources/\n│   │       └── application.properties  # Application configuration\n│   └── test/\n        └── java/\n            └── org/leverx/ratingapp/\n                ├── unit/              # Unit tests\n                └── integration/       # Integration tests\n                    \n```\n### Running with Docker (Recommended)\n1. Switch to the containerized branch:\n   ```bash\n   git checkout containerized\n   ```\n2. Run the application using Docker Compose:\n   ```bash\n   docker-compose up\n   ```\n   This will start the application, PostgreSQL, and Redis containers.\n### Running with SAP BTP (Hightly recommended)\n1. Switch to the containerized branch:\n   ```bash\n   git checkout deploy\n   ```\n2. Build the application using Maven:\n   ```bash\n    chmod +x mvnw \u0026\u0026 ./mvnw clean package -Dmaven.test.skip=true -Dspring.config.location=src/main/resources/application-cloud.properties\n   ```\n3. Send application to SAP BTP Cloud:\n   ```bash\n    cf push\n   ```\n   This will start the application, PostgreSQL, and Redis containers will be alredy on SAP BTP.\n## Data layer schema\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/imwrdo/rating-system-leverx/blob/main/img/data_layer.png\" style=\"width: 100%;\"\u003e\n\u003c/div\u003e\n\n## API Endpoints\n\n### Authentication\n\n- `POST /auth/register` - Register new user\n    - Body: `{firstName, lastName, email, password}`\n- `POST /auth/authenticate` - Login user\n    - Body: `{email, password}`\n- `GET /auth/confirm?token={token}` - Confirm email registration (User can confirm using email)\n    - Query: `token` - Email confirmation token\n\n### Users\n\n- `GET /users` - Get all users\n    - Users: Can see only users with active status\n    - Admins: Can see all users, even other admins\n- `GET /users/{id}` - Get user by ID\n    - Path: `id` - User's unique identifier\n- `GET /users/rating` - Get user rankings\n    - Query: `gameName` - Filter by game title (optional)\n    - Query: `limit` - Limit number of results (optional)\n- `GET /admin/users/inactive` - Get inactive users (Admin only)\n- `POST /admin/users/{seller_id}/comments/{comment_id}` - Approve/reject comment (Admin only)\n\n### Comments\n- `POST /users/{seller_id}/comments` - Create comment for seller\n    - Path: `seller_id` - Seller's unique identifier\n    - Body: `{message, grade}`\n    - Returns: Created comment with status \"CREATED\"\n\n- `POST /users/{seller_id}/comments/optional-seller` - Create comment with optional seller registration\n    - Path: `seller_id` - Seller's unique identifier\n    - Body: `{message, grade, firstName, lastName, email, password}`\n    - Returns: Comment pending status if seller needs registration\n\n- `GET /users/{seller_id}/comments` - Get seller's comments\n    - Path: `seller_id` - Seller's unique identifier\n    - Users: Can see only approved comments and their own\n    - Admins: Can see all comments\n\n- `GET /users/{seller_id}/comments/{comment_id}` - Get specific comment\n    - Path: `seller_id` - Seller's unique identifier\n    - Path: `comment_id` - Comment's unique identifier\n    - Returns: Comment details if visible to user\n\n- `PUT /users/{seller_id}/comments/{comment_id}` - Update comment\n    - Path: `seller_id` - Seller's unique identifier\n    - Path: `comment_id` - Comment's unique identifier\n    - Body: `{message, grade}`\n    - Access: Comment author only\n\n- `DELETE /users/{seller_id}/comments/{comment_id}` - Delete comment\n    - Path: `seller_id` - Seller's unique identifier\n    - Path: `comment_id` - Comment's unique identifier\n    - Access: Comment author or admin\n    - Returns: 202 Accepted with deletion status\n\n- `POST /admin/users/{seller_id}/comments/{comment_id}` - Approve/reject comment\n    - Path: `seller_id` - Seller's unique identifier\n    - Path: `comment_id` - Comment's unique identifier\n    - Query: `confirm` - true to approve, false to reject\n    - Access: Admin only\n    - Returns: Updated comment status\n\n### Game Objects\n\n- `POST /users/{user_id}/games` - Create game object\n- `GET /users/{user_id}/games` - Get user's games\n- `PUT /users/{user_id}/games/{game_id}` - Update game\n- `DELETE /users/{user_id}/games/{game_id}` - Delete game\n\n## Technologies\n\n- Spring Boot\n- Spring Security\n- Spring Data JPA\n- PostgreSQL\n- JUnit 5\n- Mockito\n- Maven\n\n## Getting Started\n\n1. Clone the repository\n2. Configure database connection in `application.properties`\n3. Run `mvn clean install`\n4. Start the application using `mvn spring-boot:run`\n\n## Testing\n\nThe application includes both unit and integration tests:\n\n```bash\n# Run all tests\nmvn test\n\n# Run unit tests only\nmvn test -Dtest=*UnitTests\n\n# Run integration tests only\nmvn test -Dtest=*IntegrationTest\n```\n\n## Security\n\n- JWT-based authentication\n- Password encryption using BCrypt\n- Role-based access control\n- Email verification for new accounts\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimwrdo%2Frating-system-leverx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimwrdo%2Frating-system-leverx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimwrdo%2Frating-system-leverx/lists"}