REST backend API for managing personal financial transactions. The application provides user authentication and full CRUD operations for transactions.
-
User registration and login (JWT authentication)
-
Create, read, update, delete transactions
-
Store transaction details:
- amount
- type (income / expense)
- category
- notes
- date
-
Secure endpoints (authenticated access)
- Java + Spring Boot
- Spring Security (JWT)
- Hibernate / JPA
- Database: TODO (PostgreSQL / MySQL / H2)
git clone https://github.com/SharpP03/expense-tracker-backend.git
cd expense-tracker-backendConfigure database in application.properties:
spring.datasource.url=TODO
spring.datasource.username=TODO
spring.datasource.password=TODORun:
./mvnw spring-boot:runPOST /api/auth/register
{
"username": "testuser",
"email": "test@example.com",
"password": "password123"
}{
"id": 1,
"username": "testuser",
"email": "test@example.com"
}POST /api/auth/login
{
"username": "testuser",
"password": "password123"
}{
"token": "JWT_TOKEN"
}"Invalid username or password"All endpoints require Authorization header:
Authorization: Bearer YOUR_TOKEN
GET /api/transactions
[
{
"id": 1,
"amount": 100.0,
"type": "INCOME",
"category": "SALARY",
"note": "Monthly salary",
"date": "2025-01-01"
}
]GET /api/transactions/{id}
{
"id": 1,
"amount": 100.0,
"type": "INCOME",
"category": "SALARY",
"note": "Monthly salary",
"date": "2025-01-01"
}POST /api/transactions
{
"amount": 50.0,
"type": "EXPENSE",
"category": "FOOD",
"note": "Dinner",
"date": "2025-01-02"
}{
"id": 2,
"amount": 50.0,
"type": "EXPENSE",
"category": "FOOD",
"note": "Dinner",
"date": "2025-01-02"
}PUT /api/transactions/{id}
{
"amount": 60.0,
"type": "EXPENSE",
"category": "FOOD",
"note": "Dinner updated",
"date": "2025-01-02"
}{
"id": 2,
"amount": 60.0,
"type": "EXPENSE",
"category": "FOOD",
"note": "Dinner updated",
"date": "2025-01-02"
}DELETE /api/transactions/{id}
204 No Content
GET /api/test
Response:
hello world
GET /api/info
Response:
{
"appName": "Aplikacja Budżetowa",
"version": "1.0",
"message": "Witaj w aplikacji budżetowej stworzonej ze Spring Boot!"
}- Add unit & integration tests
- Add Swagger / OpenAPI documentation