Component | Technology |
---|---|
Backend (REST) | Spring 6 & SpringBoot 3.12 (Java 17) |
Security | Token Based (Spring Security and JWT ) |
REST Documentation | Swagger & Spring Doc |
REST Spec | Open API Standard |
Persistence | JPA (Using Spring Data) |
Build Tool | Gradle |
- Registering new users
- Login with existing user
- Logout with one or all devices
- Role System
- Authentication and authorization with JWT
- Refresh Token functionality
- Forgot Password
- Verify Email
- Create, Read, Update, Delete Todos
- Filter and Sort Todos
- Upload profile image for User
$ git clone https://github.com/robotTX1/SpringTodoApp.git
- Navigate into the folder
$ cd SpringTodoApp
-
Create
secrets.yaml
in yourresources
folder and copy everything fromexample-secrets.yaml
to it. Change example values to real ones. -
Run
generateRsaKeys.sh
in yourresources/certs
folder to generate RSA private and public keys -
Build project
$ gradle build
- Run the project
$ gradle bootRun
- Navigate to
http://localhost:8080/swagger-ui.html
in your browser to check everything is working correctly. You can change the default port in theapplication.yml
file
server:
port: 8080
- Make a GET request to
/api/v1/todos
to check you're not authenticated. You should receive a response with a401
with no message since you haven't set your valid JWT token yet
$ curl -X GET 'http://localhost:8080/api/v1/todos'
- Make a POST request to
/api/v1/auth/login
with the default admin user we programatically created to get a valid JWT token
$ curl -d '{"email": "[email protected]", "password": "password"}' -H 'Content-Type: application/json' -X POST 'http://localhost:8080/api/v1/auth/login'
- Add the JWT token as a Header parameter and make the initial GET request to
/api/v1/todos
again
$ curl -H 'Authorization: Bearer <JWT_TOKEN>' -X GET http://localhost:8080/api/v1/todos
- If you got 200 OK and your todos back thank you did everything correctly!
- Report issues
- Open pull request with improvements
- Reach out to me directly at [email protected]