A personal project to keep track of memories and practice Spring Boot development.
MemoryApp allows users to store and organize personal memories using:
- Boards (grouping memories)
- Tags (categorization)
- Media attachments
- Secure authentication
Note
Notification support is planned but not yet implemented.
- Tech Stack
- Architecture
- Security Model
- Database Strategy
- Project Structure
- Quick Start
- Configuration
- Running (Development)
- Core APIs
- Documentation Index
- License
- Author
| Layer | Technology |
|---|---|
| Framework | Spring Boot |
| ORM | Spring Data JPA |
| Database | PostgreSQL |
| Migrations | Flyway |
| Boilerplate Reduction | Lombok |
Main packages: com.spring.memory → controller, service, repository, entity, dto, security, configuration.
- Controllers are thin and request-focused
- Business logic lives in the service layer
- Repositories expose minimal query methods
- DTOs prevent entity leakage
- Transactions are handled explicitly
- Flyway owns schema evolution
- Database migrations are in
src/main/resources/db/migration(Flyway).
- Stateless JWT-based authentication
- Short-lived access tokens
- Refresh tokens stored server-side
- Logout implemented via refresh token invalidation
- Protected endpoints enforced through Spring Security filters
Authentication flows are documented with sequence diagrams.
- PostgreSQL as the primary datastore
- Flyway for controlled, versioned schema migrations
- No automatic schema generation in production
- Explicit migration scripts under
db/migration
docs/
├─ diagrams/
│ └─ auth.md # Authentication flow diagrams
├─ static/ # Images used in documentation
│ ├─ @ToString.Exclude excluded.png
│ ├─ @ToString.Excluded included.png
│ ├─ Default Entity States.png
│ ├─ Entity States.png
│ ├─ Entity [email protected]
│ ├─ GET_tag(not exists)_Optional_Before_controller.png
│ └─ GET_tag(not exists)_with_Optional.png
├─ ANNOTATION_GUIDE.md # JPA & Lombok annotation usage
├─ API_REFERENCE.md # Detailed API endpoint documentation
├─ ERROR_LOG.md # Known issues and resolutions
├─ JPA_CONCEPTS.md # Core JPA concepts and pitfalls
├─ PERFORMANCE_&_BEST_PRACTICES_GUIDE.md
├─ SETUP.md # Local setup guide
src/
├─ main/
│ ├─ java/com/spring/memory/
│ │ ├─ configuration/ # Security & password configuration
│ │ ├─ controller/ # REST controllers (thin layer)
│ │ ├─ dto/ # Request/response DTOs
│ │ ├─ entity/ # JPA entities
│ │ ├─ enumeration/ # Domain enums
│ │ ├─ exception/ # Global & custom exceptions
│ │ ├─ mapper/ # Entity ↔ DTO mappers
│ │ ├─ repository/ # JPA repositories
│ │ ├─ security/ # JWT & authentication filters
│ │ ├─ service/ # Business logic
│ │ ├─ util/ # Utility helpers
│ │ └─ MemoryApplication.java
│ └─ resources/
│ ├─ db/migration/ # Flyway migration scripts
│ └─ application.properties
└─ test/
└─ java/com/spring/memory/
└─ MemoryApplicationTests.java
- For getting started (see
docs/SETUP.mdfor details). - Update
src/main/resources/application.propertieswith your DB credentials (see Configuration below). - Run the application locally
Set the following essential properties in src/main/resources/application.properties or via environment variables:
spring.datasource.url=jdbc:postgresql://localhost:5432/memory_app
spring.datasource.username=your_username
spring.datasource.password=your_password
# JWT (example keys - replace in production)
app.jwt.secret=replace-with-your-secret
app.jwt.expirationMs=3600000
# Flyway
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration- Run via Maven wrapper:
./mvnw spring-boot:run- Run tests:
./mvnw test- Run Flyway migrations manually:
./mvnw flyway:migrateCore endpoints include authentication, boards, memories, tags, and user profile management.
- API Reference:
docs/API_REFERENCE.md; detailed endpoint tables and notes (moved from README).
- Setup: Step-by-step local setup and prerequisites; SETUP.md
- Annotation Guide: Flyway vs JPA annotations and best practices; ANNOTATION_GUIDE
- JPA Concepts: Fetch strategies,
@Transactional, andEntityManagernotes; JPA_CONCEPTS - Performance & Best Practices: Performance tips and common pitfalls; PERFORMANCE_&_BEST_PRACTICES_GUIDE
- Error Log / Troubleshooting: Collected errors, causes, and solutions; ERROR_LOG
- Auth Diagrams: Sequence diagrams showing authentication flows; auth
This project is licensed under the MIT License.
Sana Gul 🌐 LinkedIn
“Preserve memories. Practice code. Progress daily.”