A backend REST API for a personal journaling application, built with Spring Boot. Users can register, authenticate, and manage their journal entries securely through a clean set of RESTful endpoints, protected with JWT-based authentication.
- User registration and JWT-based authentication
- Create, read, update, and delete (CRUD) journal entries
- Entries linked to individual users
- Secured endpoints using Spring Security + JWT
- RESTful API design following standard HTTP conventions
- SonarQube integration for code quality checks
- CI pipeline configured via GitHub Actions
| Layer | Technology |
|---|---|
| Language | Java |
| Framework | Spring Boot |
| Security | Spring Security + JWT |
| Database | MongoDB |
| Build Tool | Maven |
| Code Quality | SonarQube |
| CI/CD | GitHub Actions |
journalApp/
├── .github/workflows/ # CI pipeline configuration
├── .mvn/wrapper/ # Maven wrapper
├── src/ # Application source code
├── build.yml # Build configuration
├── pom.xml # Maven dependencies
└── README.md
- Java 17+
- Maven
- MongoDB running locally or a cloud MongoDB URI
-
Clone the repository
git clone https://github.com/coderxom/journalApp.git cd journalApp -
Configure your MongoDB connection in
application.properties/application.ymlspring.data.mongodb.uri=mongodb://localhost:27017/journalApp -
Build the project
./mvnw clean install
-
Run the application
./mvnw spring-boot:run
The application will start on http://localhost:8080 by default.
All endpoints under /journal are secured and require a valid JWT token in the request header:
Authorization: Bearer <your-jwt-token>
A token is obtained after successfully registering and logging in through the public auth endpoints.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /public/create-user |
Register a new user | ❌ |
| POST | /public/login |
Login and receive a JWT token | ❌ |
| GET | /journal |
Get all journal entry IDs for the logged-in user | ✅ |
| POST | /journal |
Create a new journal entry | ✅ |
| GET | /journal/id/{myId} |
Get a specific journal entry by ID | ✅ |
| PUT | /journal/id/{myId} |
Update a journal entry by ID | ✅ |
| DELETE | /journal/id/{myId} |
Delete a journal entry by ID | ✅ |
⚠️ The/public/loginpath is a placeholder based on a typical Spring Security + JWT setup — update this row with your actual login endpoint path if it differs.
./mvnw test- Return full journal entry objects (not just IDs) in
GET /journal - Add refresh token support
- Deploy to a cloud platform (Render / Railway)
- Add pagination and search for journal entries
- Write unit and integration tests
Om Gupta
This project is open source and available under the MIT License.