JournalApp is a Spring Boot-based web application that allows users to create, read, update, and delete their personal journals. The application provides secure user authentication with JWT, ensuring that only authorized users can access their journals.
-
User Authentication:
- Secure JWT-based authentication system.
- Users can register and log in to access their journals.
-
CRUD Operations:
- Create: Users can write new journal entries.
- Read: Users can view their existing journal entries.
- Update: Users can modify their journal entries.
- Delete: Users can remove journal entries they no longer need.
-
User Management:
- Manage user profiles, including updating user information.
- Each user's journals are securely associated with their account.
- Java Development Kit (JDK) 11 or higher
- Maven 3.6+
- MySQL or any other supported relational database
- An IDE (e.g., IntelliJ IDEA, Eclipse)
-
Clone the repository:
git clone https://github.com/tushar21014/JournalApp.git cd JournalApp -
Set up the database:
- Create a new database in MySQL (or your preferred RDBMS).
- Update the
application.propertiesfile with your database credentials.
Example:
spring.datasource.url=jdbc:mysql://localhost:3306/journaldb spring.datasource.username=root spring.datasource.password=yourpassword spring.jpa.hibernate.ddl-auto=update
-
Build the project:
mvn clean install
-
Run the application:
mvn spring-boot:run
-
Access the application:
- The application will run on
http://localhost:8080. - Use Postman or any other API client to test the CRUD operations and JWT authentication.
- The application will run on
-
User Registration:
POST /api/auth/register
-
User Login:
POST /api/auth/login
-
Create Journal:
POST /api/journals
-
Get All Journals:
GET /api/journals
-
Get Journal by ID:
GET /api/journals/{id}
-
Update Journal:
PUT /api/journals/{id}
-
Delete Journal:
DELETE /api/journals/{id}
- JWT Authentication:
- All API requests are secured with JWT tokens.
- Ensure you pass the
Authorizationheader with the token for secured endpoints.
- Develop a frontend for easier interaction with the API.
- Thanks to the open-source community for their contributions and support.