Skip to content

Example of a rest API using Spring Boot, using jwt for security.

License

Notifications You must be signed in to change notification settings

damian-git-99/Spring-boot-rest-api-jwt

Repository files navigation

Example of a rest api using JWT Spring Security

This is an example for using JWT (JSON Web Token) and Mysql with Spring Security and Spring Boot 2.7.5.

Run project With Docker

  • Install Docker
  • Run docker compose up

Run Project Manually

Requirements

* Java 11
* Maven 3
* Mysql 8.0.26
1- Install Mysql 
2- CREATE DATABASE tasks_app;
3- Change mysql user and password from application.properties
4- start the application with the Spring Boot maven plugin (mvn spring-boot:run).

Users Use Case Diagram

USE_CASE

Users API

Use postman to test the api

SignUp: POST /api/1.0/users | { username, email, password }
LogIn: POST /api/1.0/auth   | { email, password }
FindAllUsers: GET /api/1.0/users
FindUserById: GET /api/1.0/users/{id}
DeleteUser: DELETE /api/1.0/users/{id}
UpdateUSer: PUT /api/1.0/users/{id} | { username, email, password }

About

Example of a rest API using Spring Boot, using jwt for security.

Resources

License

Stars

Watchers

Forks

Packages

No packages published