Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
3a4dc91
More cases for exercises
florczaq Oct 2, 2025
d16b8ac
Merge pull request #106 from PKWMApp/fix/change-mail-message
florczaq Oct 2, 2025
e7b03b7
extract authorization from ExamService
PatMaz999 Oct 4, 2025
3774cbb
javadoc for Authorization
PatMaz999 Oct 4, 2025
c841a98
update tests
PatMaz999 Oct 4, 2025
41838b5
Merge pull request #107 from PKWMApp/refactor/authorization
florczaq Oct 4, 2025
5a1072a
implement refresh token logic
PatMaz999 Oct 5, 2025
d9801a9
implement logout endpoint
PatMaz999 Oct 5, 2025
59efd5c
update database schema
PatMaz999 Oct 5, 2025
d3a0588
added refreshToken hashing
PatMaz999 Oct 7, 2025
71f531b
remove boilerplate code with generics
PatMaz999 Oct 9, 2025
c3cd511
mark interface as NoRepositoryBean
PatMaz999 Oct 9, 2025
139440a
fix create new refresh token
PatMaz999 Oct 11, 2025
cf13009
refactor refresh endpoint for moderator
PatMaz999 Oct 11, 2025
761856d
refactor refresh tokens logic for moderators
PatMaz999 Oct 11, 2025
adf0189
refactor refreshToken logic
PatMaz999 Oct 13, 2025
7ffd344
fix bug with duplicating users in repository
PatMaz999 Oct 13, 2025
774cd0f
replace random with SecureRandom in generating OTP codes
PatMaz999 Oct 13, 2025
cf4c3f8
adjust OTP tests for refresh tokens
PatMaz999 Oct 13, 2025
eb71000
adjust JWT tests
PatMaz999 Oct 13, 2025
8d6d672
Merge pull request #108 from PKWMApp/refreshTokens
florczaq Oct 16, 2025
34c1d10
Database refactor
florczaq Oct 16, 2025
2e225f2
Database backup
florczaq Oct 16, 2025
5f91b36
Change 'moderator_id' column type to varchar
florczaq Oct 16, 2025
963c72d
Fix day separation
florczaq Oct 16, 2025
5fbcac6
Delete INPUTs
florczaq Oct 16, 2025
aa50f46
Apply changes pointed in review
florczaq Oct 16, 2025
14e4b1d
Update README.md
florczaq Oct 16, 2025
3ea3b98
Update src/main/java/org/pkwmtt/timetable/parser/TimetableParserServi…
florczaq Oct 16, 2025
b6d3fd8
Update README.md
florczaq Oct 16, 2025
7b5f25f
Merge remote-tracking branch 'origin/reafactor/database' into reafact…
florczaq Oct 16, 2025
f1f8b8e
Apply changes from review
florczaq Oct 17, 2025
e718406
Encode api and admin keys in database
florczaq Oct 17, 2025
725b80c
Encode api and admin keys in database
florczaq Oct 17, 2025
8331a63
Merge remote-tracking branch 'origin/reafactor/database' into reafact…
florczaq Oct 17, 2025
64ae958
Encode api and admin keys in database
florczaq Oct 17, 2025
b4a4a4d
Encode api and admin keys in database
florczaq Oct 17, 2025
bec7893
Delete redundant query
florczaq Oct 17, 2025
ae76516
Update src/test/resources/schema.sql
florczaq Oct 17, 2025
c3bd942
Apply for review
florczaq Oct 17, 2025
d6ff4aa
Refactor timetable parsing logic for improved clarity
florczaq Oct 17, 2025
90a3b12
Update README.md
florczaq Oct 17, 2025
60dc9a6
Update src/main/java/org/pkwmtt/security/admin/AdminRequestIntercepto…
florczaq Oct 17, 2025
1c788de
Change expire column type from TIMESTAMP to DATETIME in student_codes…
florczaq Oct 17, 2025
d218421
Merge remote-tracking branch 'origin/reafactor/database' into reafact…
florczaq Oct 17, 2025
c3a8ea2
Rename refresh token tables for consistency
florczaq Oct 17, 2025
f81c5c7
Refactor database schema: rename refresh token tables and add user re…
florczaq Oct 17, 2025
4347167
Refactor database schema: rename refresh token tables and update fore…
florczaq Oct 17, 2025
9ec5994
Refactor authentication and token handling: rename methods and update…
florczaq Oct 17, 2025
450c70f
Update src/test/java/org/pkwmtt/examCalendar/repository/ExamRepositor…
florczaq Oct 17, 2025
3cd1589
Refactor student code identifiers: rename otp_code_id to student_code…
florczaq Oct 17, 2025
fa53c2e
Merge remote-tracking branch 'origin/reafactor/database' into reafact…
florczaq Oct 17, 2025
7871fc5
Refactor StudentCode class: add default values for usage and usageLim…
florczaq Oct 17, 2025
0ef7429
Update src/main/java/org/pkwmtt/global/RequestInterceptor.java
florczaq Oct 17, 2025
36185e1
Update src/main/java/org/pkwmtt/security/apiKey/ApiKeyService.java
florczaq Oct 17, 2025
ced4178
Refactor database schema: rename 'usage' to 'usage_count' and update …
florczaq Oct 18, 2025
3f9cce3
Refactor TimetableParserService: simplify typeOfWeek determination logic
florczaq Oct 18, 2025
f2ce6c9
Update src/main/java/org/pkwmtt/security/apiKey/ApiKeyService.java
florczaq Oct 18, 2025
8e393d5
Update src/main/java/org/pkwmtt/global/RequestInterceptor.java
florczaq Oct 18, 2025
4172dc4
add Transactional annotation to service
PatMaz999 Oct 18, 2025
f9fdf45
Merge pull request #109 from PKWMApp/reafactor/database
PatMaz999 Oct 18, 2025
23b9e83
Add new validation for dates
KrecikKretes Oct 18, 2025
c430180
Add CacheContentNotAvailableException and enhance documentation in ti…
florczaq Oct 18, 2025
2e4036f
Merge branch 'main' into fix/timetable-cache
florczaq Oct 18, 2025
efc0daf
Resolve @florczaq comments
KrecikKretes Oct 18, 2025
4fee387
Merge pull request #110 from PKWMApp/feature/date_not_so_far_into_future
florczaq Oct 18, 2025
d28b7e5
Refactor timetable-related services and tests to handle JsonProcessin…
florczaq Oct 18, 2025
454ecc7
Merge branch 'main' into fix/timetable-cache
florczaq Oct 18, 2025
7a49c17
Merge pull request #111 from PKWMApp/fix/timetable-cache
florczaq Oct 18, 2025
d6e9782
Add log directory initialization and configure logging for rolling fi…
florczaq Oct 19, 2025
da7da38
Merge pull request #112 from PKWMApp/feat/mount-log-file-to-docker
florczaq Oct 19, 2025
a3b9d16
update JwtFilterTest
PatMaz999 Oct 19, 2025
5b7974e
update project structure of security
PatMaz999 Oct 19, 2025
1ad709c
Refactor student code handling: rename OTP-related classes and method…
florczaq Oct 19, 2025
8e0f4b7
Refactor security package naming to correct spelling of 'authentication'
florczaq Oct 19, 2025
2a37957
Merge pull request #113 from PKWMApp/refactor/security
florczaq Oct 19, 2025
4d874a2
Merge remote-tracking branch 'origin/main' into refactor/student-codes
florczaq Oct 19, 2025
cbb5652
Refactor cache configuration: re-enable scheduling in application and…
florczaq Oct 19, 2025
2f8d904
Refactor student code handling: unify method names to 'sendStudentCod…
florczaq Oct 20, 2025
10b44b4
Refactor Exam and Moderator controllers: remove commented-out code an…
florczaq Oct 20, 2025
be53486
Refactor cache configuration and add UtilsProperty management: implem…
florczaq Oct 20, 2025
380d15e
Add BugReport entity, DTO, repository, mapper, and service for bug re…
florczaq Oct 20, 2025
4dc430c
Add bug_reports and utils_kv tables with initial data and indexing
florczaq Oct 20, 2025
f6d2ab6
Add bug report management endpoints: implement retrieval and deletion…
florczaq Oct 20, 2025
060a26f
Add bug_reports and utils_kv tables to schema; update UtilsProperty f…
florczaq Oct 20, 2025
877f17f
Refactor representatives and user_refresh_tokens tables: change repre…
florczaq Oct 20, 2025
f075788
Refactor bug report handling: introduce NewBugReportDTO, update BugRe…
florczaq Oct 20, 2025
f36139f
Refactor cache management: update cache expiration time, change log l…
florczaq Oct 20, 2025
2010ea0
Update src/main/java/org/pkwmtt/cache/CacheConfig.java
florczaq Oct 20, 2025
32c62f7
Update src/main/java/org/pkwmtt/studentCodes/StudentCodeService.java
florczaq Oct 20, 2025
b61c061
Update src/test/java/org/pkwmtt/utils/UtilsServiceTest.java
florczaq Oct 20, 2025
cc5964e
Merge pull request #114 from TrybikDevelopers/refactor/student-codes
PatMaz999 Oct 21, 2025
b25df75
add username to AuthDto
PatMaz999 Oct 21, 2025
1e08cb0
change representative access token structure + adjust tests
PatMaz999 Oct 21, 2025
e94fb93
fix bug in examControllerTest
PatMaz999 Oct 21, 2025
90b9e17
Update README.md
florczaq Oct 22, 2025
bfc9c5f
remove representativeDto + adjust tests
PatMaz999 Oct 22, 2025
c8bb462
simplify validateAccessToken methods
PatMaz999 Oct 22, 2025
7b41fcf
Add customizable subjects feature: implement endpoint to retrieve fil…
florczaq Oct 22, 2025
4c13f3c
Update src/main/java/org/pkwmtt/timetable/TimetableService.java
florczaq Oct 22, 2025
a8fa318
Update src/main/java/org/pkwmtt/timetable/TimetableController.java
florczaq Oct 22, 2025
00b09d6
Merge pull request #116 from TrybikDevelopers/feature/list-of-customi…
florczaq Oct 22, 2025
ff24b2c
Update README.md
florczaq Oct 22, 2025
04431e3
implement new JwtAuthenticationToken class
PatMaz999 Oct 22, 2025
791c53b
remove validateToken() method that does nothing
PatMaz999 Oct 24, 2025
5420d5a
add test that proves the validateToken() method is useless
PatMaz999 Oct 24, 2025
4cc793d
implement ModeratorAuthenticationProvider
PatMaz999 Oct 27, 2025
1d5ad17
implement RepresentativeAuthenticationProvider
PatMaz999 Oct 27, 2025
9214034
update jwtFilter
PatMaz999 Oct 27, 2025
70d0ce7
Update contact information and remove screenshots
florczaq Oct 28, 2025
f09c0e0
refactor structure
PatMaz999 Oct 31, 2025
d80eaa1
update existing security tests
PatMaz999 Oct 31, 2025
65c47ad
basic AuthenticationProviders tests
PatMaz999 Oct 31, 2025
6769e3a
remove deprecated JwtAuth token
PatMaz999 Oct 31, 2025
1c29be6
Merge branch 'main' into refactor/security
PatMaz999 Oct 31, 2025
23f90c7
fix: bug with saving representatives to database
PatMaz999 Oct 31, 2025
d0b53b0
update test database structure
PatMaz999 Oct 31, 2025
7a73728
Merge pull request #118 from TrybikDevelopers/refactor/security
florczaq Oct 31, 2025
36f9117
feat: add MaxUsageForStudentCodeReachedException and update authentic…
florczaq Nov 1, 2025
a55614e
Merge pull request #119 from TrybikDevelopers/refacotr/studentCodes
florczaq Nov 1, 2025
ad67818
docs: add API reference documentation for ExamController and Moderato…
florczaq Nov 10, 2025
1df2b4b
docs: add API reference documentation for ExamController and Moderato…
florczaq Nov 10, 2025
2ea8d87
Merge remote-tracking branch 'origin/refactor/calendar' into refactor…
florczaq Nov 10, 2025
0983ab0
refactor: update package structure from examCalendar to calendar
florczaq Nov 10, 2025
b73e37f
refactor: reorganize package structure for controllers and services
florczaq Nov 10, 2025
6ccaa22
deleted old structure for events
florczaq Nov 10, 2025
7c347e8
refactor: update cache expiration and refresh logic in CacheConfig an…
florczaq Nov 10, 2025
702b936
refactor: update package structure and imports for exam-related classes
florczaq Nov 10, 2025
1e24079
refactor: reorganize package structure for adnotations and introduce …
florczaq Nov 10, 2025
bae7bad
refactor: enhance Event entity with superior group relationships and …
florczaq Nov 10, 2025
b155a94
refactor: streamline event handling by introducing new methods for su…
florczaq Nov 12, 2025
97feb5b
refactor: introduce EventType entity and update Event and EventDTO fo…
florczaq Nov 12, 2025
9ca8b17
refactor: add API documentation for EventsController and enhance serv…
florczaq Nov 12, 2025
c9c01f6
refactor: add link to detailed documentation for Events in README
florczaq Nov 12, 2025
c5f9aca
refactor: add link to detailed documentation for Events in README
florczaq Nov 12, 2025
3b5c56e
refactor: enhance EventDTO with future date validation and update Eve…
florczaq Nov 12, 2025
66ef56a
refactor: update Event handling to include EventType and improve Mode…
florczaq Nov 12, 2025
387b776
Update src/main/java/org/pkwmtt/calendar/EXAMCALENDAR.MD
florczaq Nov 12, 2025
d612173
refactor: change eventsRepository visibility to private in EventsService
florczaq Nov 12, 2025
0f43ced
Merge remote-tracking branch 'origin/refactor/calendar' into refactor…
florczaq Nov 12, 2025
bb49da4
Update src/main/java/org/pkwmtt/calendar/EXAMCALENDAR.MD
florczaq Nov 12, 2025
4677259
refactor: clean up EventsServiceTest formatting and improve readability
florczaq Nov 12, 2025
eb3c6d6
Merge remote-tracking branch 'origin/refactor/calendar' into refactor…
florczaq Nov 12, 2025
07fdaa9
Merge pull request #120 from TrybikDevelopers/refactor/calendar
florczaq Nov 15, 2025
2d26b0b
refactor: simplify event retrieval logic in EventsController
florczaq Nov 16, 2025
79ea0d7
refactor: enhance EventDTO and EventsMapper with improved documentati…
florczaq Nov 16, 2025
cab8a85
Merge branch 'main' into refactor/calendar
florczaq Nov 16, 2025
2e379a5
Merge pull request #121 from TrybikDevelopers/refactor/calendar
florczaq Nov 16, 2025
086b64b
hotfix: resolve issue with certification
PatMaz999 Dec 15, 2025
8ea02aa
Merge pull request #123 from TrybikDevelopers/hotfix
florczaq Dec 15, 2025
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
126 changes: 85 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,99 +1,143 @@
# 🚀 PKWM App Backend
# ⚙ Trybik — Backend

Trybik (Server) – timetable, exam calendar & ECTS calculator for students of Mechanical Engineering @ Cracow University of Technology

---

## 📦 Tech Stack

- **Backend Framework:** [Java Spring](https://spring.io/)
- **Language:** [Java](https://www.java.com/pl/)
- **Database:** [MySQL](https://www.mysql.com/)
- **Authentication:** [JWT](https://jwt.io/)
- **Project Manager:** [Maven](https://maven.apache.org/)
- **Containerization:** [Docker](https://www.docker.com/)
- Framework: Java Spring Boot 3.5+
- Language: Java 21
- Database: MySQL (H2 used for tests)
- Authentication: JWT (JSON Web Tokens)
- API Docs: Swagger / OpenAPI
- Caching: Caffeine
- Build / Project: Maven (mvn / ./mvnw)
- Containerization: Docker

---

## ⚙️ Setup & Installation

### 1. Clone the repository

```shell
docker pull ghcr.io/pkttteam/pkwmtt-backend:latest
```bash
git clone https://github.com/TrybikDevelopers/Trybik-backend.git
cd Trybik-backend
```

### 2. Build the project

If the Maven wrapper is present:

```bash
./mvnw clean package
```

Or with your system Maven:

```bash
mvn clean package
```

### 3. Run with Docker

Build and run locally:

```bash
docker build -t trybik-backend .
docker run -d --name trybik-backend -p 8080:8080 trybik-backend
```

### 2. Run
If an official container image is published (check the Releases or container registry), you can pull and run:

```shell
docker run -d --name [image_name] -p 8080:8080 ghcr.io/pkttteam/pkwmttt-backend:[PACKAGE_NUMBER]
```bash
docker pull ghcr.io/trybikdevelopers/trybik-backend:latest
docker run -d --name trybik-backend -p 8080:8080 ghcr.io/trybikdevelopers/trybik-backend:latest
```

---

## 📮 API Overview

The backend exposes various RESTful endpoints to manage:
This backend exposes RESTful endpoints for:

- Timetable:
- Schedule for specific general group with optional filters (K,L,P groups)
- List of available general groups (f.e. 12K1)
- List of subjects hours
- List of available KLP groups for specified general group (f.e. K01)
- Timetable management (by study group, with filters)
- Exam calendar and exam types
- ECTS calculator
- Group and subject listings
- (Other endpoints may exist — check the controller packages / OpenAPI docs)

The API follows standard REST conventions and uses JWT for authentication. Headers typically include:
## Detailed API docs
For implementation details, examples and payload shapes see the module-level API references below:

- Timetable — Detailed docs: [TIMETABLE.MD](src/main/java/org/pkwmtt/timetable/TIMETABLE.MD)
- Exam calendar — Detailed docs: [EXAMCALENDAR.MD](src/main/java/org/pkwmtt/calendar/EXAMCALENDAR.MD)
- Moderator — Detailed docs: [MODERATOR.MD](src/main/java/org/pkwmtt/moderator/MODERATOR.MD)
- Events — Detailed docs: [EVENTS.MD](src/main/java/org/pkwmtt/calendar/EVENTS.MD)

Authentication
- Endpoints are protected using JWT tokens.
- Example header:

```
Authorization: Bearer <token>
Content-Type: application/json
```

> ⚠️ API documentation with Swagger may be available [here](http://localhost:8080/swagger-ui/index.html) if enabled in
> the application.
API documentation (Swagger UI / OpenAPI) is usually available at:
`http://localhost:8080/swagger-ui/index.html` or `http://localhost:8080/v3/api-docs` (if Swagger/OpenAPI is enabled in configuration).

---

## 🧪 Testing

```shell
Run unit and integration tests:

```bash
./mvnw test
# or
mvn test
```

The project may use H2 for tests — check test configuration files for details.

---

## 🤝 Contributing

Contributions are welcome! Follow these steps:
We welcome contributions!

1. Fork the repository
2. Create a new branch: `git checkout -b feature/your-feature-name`
3. Make your changes
4. Commit and push: `git commit -m "feat: add new feature" && git push`
5. Submit a pull request 🚀
2. Create a new branch: `git checkout -b feature/your-feature`
3. Make your changes and add tests where appropriate
4. Commit and push:
```bash
git commit -m "feat: short description"
git push origin feature/your-feature
```
5. Open a pull request against the main branch and describe your changes

Please follow the existing code style and include tests for new behavior when possible.

---

## 📄 License

This project is licensed under the **MIT License**. See the [LICENSE](./LICENSE) file for details.
This project is licensed under the MIT License. See [LICENSE](./LICENSE) for details.

---

## 💬 Contact
## 💬 Contact / Support

For questions, suggestions, or collaboration:
- Issues: https://github.com/TrybikDevelopers/Trybik-backend/issues
- Organization: https://github.com/TrybikDevelopers
- Email: support@trybik.app

- GitHub Issues: [Submit here](https://github.com/PKWMApp/PKWMTT-backend/issues)
- Team: [@PKWMApp](https://github.com/PKWMApp
)
If you have questions about API usage or want to report bugs, please open an issue with reproduction steps and relevant logs.

---

## 🌐 Related Projects

---

## 📸 Screenshots (Optional)

---



- Frontend / mobile apps — check the organization repositories for matching frontend projects.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
restart: always
volumes:
- ./uploads:/app/uploads
- ./logs:/app/logs
environment:
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE}
db:
Expand Down
Loading
Loading