A Spring Boot project for saving notes and sharing notes with other users. The application uses JWT for authentication and includes rate limiting with Bucket4j.
- Save personal notes
- Share notes with other users
- JWT-based authentication
- Rate limiting using Bucket4j
- Full-text search using PostgreSQL's
tsvector
Spring Boot is chosen for its maturity and robustness as a backend framework. It offers a wide range of features for building enterprise-level applications and integrates seamlessly with various tools and libraries.
PostgreSQL is selected for its production-readiness and solid support for full-text search using tsvector
.
Bucket4j is used for implementing rate limiting to control the rate of requests to the application. It provides a simple and efficient way to apply rate limits.
- JDK 21
- Maven
- PostgreSQL
- Clone the repository:
git clone <repository-url>
- Navigate to the project's root directory:
cd Spring_Java/Speer_Project
- Install JDK 21 and Maven (if not already installed).
- Run test cases:
mvn clean test
- Build the project:
mvn clean package
- Edit properties (optional):
Before running the application, you can edit the properties in
src/main/resources/application-dev.yml
to suit your needs. - Run the application:
java -jar target/project-0.0.1-SNAPSHOT.jar
- Access Swagger UI:
Open your browser and navigate to
http://localhost:8080/swagger-ui/index.html
to use Swagger UI. Alternatively, you can use Postman to send requests tohttp://localhost:8080
.
-
Authentication:
- Sign Up:
POST /api/auth/signup
- Log In:
POST /api/auth/login
- Sign Up:
-
Notes:
- All requests to
/api/notes/**
require anAuthorization
header with a Bearer token. - You can get the token by signing up and logging in as described above.
- All requests to
- Make sure to replace
your_token
with the actual token obtained from the login response. - The default port is
8080
, and it can be changed by editing theapplication-dev.yml
file.