Sptrng is a secure task management application with backend functionalities created using Spring Boot. The app leverages Spring Security with JWT (JSON Web Tokens) for authentication, including access and refresh tokens, and uses PostgreSQL as its database. It provides endpoints for user management and task management with comprehensive CRUD operations.
- User Authentication: Signup, signin, and refresh token functionality using JWT.
- Task Management: Create, update, delete, and retrieve tasks with associated points.
- User Management: Update user information and retrieve authenticated user details.
- Backend: Spring Boot
- Security: Spring Security with JWT
- Database: PostgreSQL
- ORM: JPA (Java Persistence API)
- Cookies: Used for storing JWT tokens
-
Signup
- URL:
/api/v1/auth/signup - Method:
POST - Body:
SignUpRequest(JSON) - Response:
JwtAuthenticationResponse
- URL:
-
Signin
- URL:
/api/v1/auth/signin - Method:
POST - Body:
SignInRequest(JSON) - Response:
JwtAuthenticationResponse
- URL:
-
Refresh Token
- URL:
/api/v1/auth/refresh - Method:
POST - Cookie:
refreshToken - Response:
JwtAuthenticationResponse
- URL:
-
Create Task
- URL:
/api/v1/task - Method:
POST - Body:
TaskRequest(JSON) - Response:
Task
- URL:
-
Get Tasks
- URL:
/api/v1/task - Method:
GET - Response: List of
Task
- URL:
-
Get Task by ID
- URL:
/api/v1/task/{id} - Method:
GET - Response:
Task
- URL:
-
Delete Task
- URL:
/api/v1/task/{id} - Method:
DELETE - Response: Status of the deletion operation
- URL:
-
Add Point
- URL:
/api/v1/task/{id} - Method:
POST - Body:
TaskPointRequest(JSON) - Response: Updated
Task
- URL:
-
Delete Point
- URL:
/api/v1/task/{taskId}/{pointId} - Method:
DELETE - Response: Status of the deletion operation
- URL:
-
Set Point Completion
- URL:
/api/v1/task/{taskId}/{pointId} - Method:
PUT - Request Parameter:
completed(boolean) - Response: Updated
Task
- URL:
-
Update User
- URL:
/api/v1/user/update - Method:
PUT - Body:
UserInfo(JSON) - Response: Updated
User
- URL:
-
Get Authenticated User ID
- URL:
/api/v1/user/authenticated - Method:
GET - Response: Authenticated User ID
- URL:
-
Get User by ID
- URL:
/api/v1/user/{id} - Method:
GET - Response:
User
- URL:
-
Confirm Email
- URL:
/api/v1/user/confirmemail - Method:
GETorPOST - Request Parameter:
token - Response: Status of email confirmation
- URL:
- Java 17 or higher
- PostgreSQL database
- Maven or Gradle (for building the project)
-
Clone the Repository
git clone https://github.com/yourusername/sptrng-security-jwt-auth-app.git
-
Navigate to the Project Directory
-
Configure the Database
Update
src/main/resources/application.propertieswith your PostgreSQL database configuration:spring.datasource.url=jdbc:postgresql://localhost:5432/yourdatabase spring.datasource.username=yourusername spring.datasource.password=yourpassword
-
Build the Project
If you're using Maven:
mvn clean install
Or if you're using Gradle:
./gradlew build
-
Run the Spring Application