Spring Boot backend for a messenger app, providing authentication, chat, presence, and file handling APIs.
- JWT-based auth and Spring Security
- REST APIs for users, friends, chats, and messages
- WebSocket support for realtime updates
- Postgres persistence via Spring Data JPA
- Media/file uploads for avatars and messages
- Java 17
- Spring Boot 3.5
- PostgreSQL
- Maven
- MapStruct, Lombok
- Java 17
- Maven (or use the included Maven Wrapper)
- PostgreSQL
- Create a Postgres database (default:
cryptDB). - Update database credentials and JWT secret in
application.properties. - Run the app.
./mvnw spring-boot:runmvn spring-boot:runThe server starts on the default Spring Boot port 8080.
Main config lives in src/main/resources/application.properties.
Key settings you may want to change:
spring.datasource.*for Postgres connectionjwt.secretfor JWT signingapp.avatars.*andapp.messages.*for uploads paths and URLs
Uploads are stored under uploads/ by default.
.
├── pom.xml
├── README.md
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com/example/piccrypt
│ │ │ ├── PicCryptBackendApplication.java
│ │ │ ├── config
│ │ │ ├── controllers
│ │ │ ├── dtos
│ │ │ ├── exceptions
│ │ │ ├── mapper
│ │ │ ├── models
│ │ │ ├── repositories
│ │ │ ├── serviceImpl
│ │ │ ├── services
│ │ │ └── types
│ │ └── resources
│ │ └── application.properties
│ └── test
│ └── java/com/example/piccrypt
├── uploads
│ ├── avatars
│ └── messages
└── target
└── ...
./mvnw test- The default JWT secret in
application.propertiesis for local development only. Replace it for real deployments. - If you use a different port, set
server.portinapplication.properties.