Skip to content

Commit dac5b7e

Browse files
committed
Task 64 : Devise README.md template
1 parent 41f956b commit dac5b7e

File tree

1 file changed

+252
-0
lines changed

1 file changed

+252
-0
lines changed

README.md

+252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
# Spring Boot Microservices with JWT Implementation
2+
3+
<p align="center">
4+
<img src="screenshots/spring_boot_security_example_jwt_implementation.png" alt="Main Information" width="700" height="500">
5+
</p>
6+
7+
### 📖 Information
8+
9+
<ul style="list-style-type:disc">
10+
<li>This project demonstrates a <b>Spring Boot microservices</b> architecture with <b>JWT-based authentication</b> and <b>role-based</b> access control. The setup includes an <b>API Gateway</b> to manage <b>routing</b> and <b>authentication</b>.</li>
11+
</ul>
12+
13+
<ul style="list-style-type:disc">
14+
<li>Roles and Permissions:
15+
<ul>
16+
<li><b>Admin</b> and <b>User</b> roles each have their own authentication and authorization mechanisms defined by their roles.</li>
17+
<li><b>Admin</b> can:
18+
<ul>
19+
<li>Create products</li>
20+
<li>Retrieve all products</li>
21+
<li>Retrieve products by ID</li>
22+
<li>Update products by ID</li>
23+
<li>Delete products by ID</li>
24+
</ul>
25+
</li>
26+
<li><b>User</b> can:
27+
<ul>
28+
<li>Retrieve all products</li>
29+
<li>Retrieve products by ID</li>
30+
</ul>
31+
</li>
32+
</ul>
33+
</li>
34+
</ul>
35+
36+
### Explore Rest APIs
37+
38+
<table style="width:100%">
39+
<tr>
40+
<th>Method</th>
41+
<th>Url</th>
42+
<th>Description</th>
43+
<th>Request Body</th>
44+
<th>Header</th>
45+
<th>Valid Path Variable</th>
46+
<th>No Path Variable</th>
47+
</tr>
48+
<tr>
49+
<td>POST</td>
50+
<td>/api/v1/authentication/admin/register</td>
51+
<td>Admin Register</td>
52+
<td>AdminRegisterRequest</td>
53+
<td></td>
54+
<td></td>
55+
<td></td>
56+
<tr>
57+
<tr>
58+
<td>POST</td>
59+
<td>/api/v1/authentication/admin/login</td>
60+
<td>Admin Login</td>
61+
<td>LoginRequest</td>
62+
<td></td>
63+
<td></td>
64+
<td></td>
65+
<tr>
66+
<tr>
67+
<td>POST</td>
68+
<td>/api/v1/authentication/admin/refreshtoken</td>
69+
<td>Admin Refresh Token</td>
70+
<td>TokenRefreshRequest</td>
71+
<td></td>
72+
<td></td>
73+
<td></td>
74+
<tr>
75+
<tr>
76+
<td>POST</td>
77+
<td>/api/v1/authentication/admin/logout</td>
78+
<td>Admin Logout</td>
79+
<td>TokenInvalidateRequest</td>
80+
<td></td>
81+
<td></td>
82+
<td></td>
83+
<tr>
84+
<tr>
85+
<td>POST</td>
86+
<td>/api/v1/authentication/user/register</td>
87+
<td>User Register</td>
88+
<td>UserRegisterRequest</td>
89+
<td></td>
90+
<td></td>
91+
<td></td>
92+
<tr>
93+
<tr>
94+
<td>POST</td>
95+
<td>/api/v1/authentication/user/login</td>
96+
<td>User Login</td>
97+
<td>LoginRequest</td>
98+
<td></td>
99+
<td></td>
100+
<td></td>
101+
<tr>
102+
<tr>
103+
<td>POST</td>
104+
<td>/api/v1/authentication/user/refreshtoken</td>
105+
<td>User Refresh Token</td>
106+
<td>TokenRefreshRequest</td>
107+
<td></td>
108+
<td></td>
109+
<td></td>
110+
<tr>
111+
<tr>
112+
<td>POST</td>
113+
<td>/api/v1/authentication/user/logout</td>
114+
<td>User Logout</td>
115+
<td>TokenInvalidateRequest</td>
116+
<td></td>
117+
<td></td>
118+
<td></td>
119+
<tr>
120+
<tr>
121+
<td>POST</td>
122+
<td>/api/v1/products</td>
123+
<td>Create Product</td>
124+
<td>ProductCreateRequest</td>
125+
<td></td>
126+
<td></td>
127+
<td></td>
128+
<tr>
129+
<tr>
130+
<td>GET</td>
131+
<td>/api/v1/products/{productId}</td>
132+
<td>Get Product By Id</td>
133+
<td></td>
134+
<td></td>
135+
<td>ProductId</td>
136+
<td></td>
137+
<tr>
138+
<tr>
139+
<td>GET</td>
140+
<td>/api/v1/products</td>
141+
<td>Get Products</td>
142+
<td>ProductPagingRequest</td>
143+
<td></td>
144+
<td></td>
145+
<td></td>
146+
<tr>
147+
<tr>
148+
<td>PUT</td>
149+
<td>/api/v1/products/{productId}</td>
150+
<td>Update Product By Id</td>
151+
<td>ProductUpdateRequest</td>
152+
<td></td>
153+
<td>ProductId</td>
154+
<td></td>
155+
<tr>
156+
<tr>
157+
<td>DELETE</td>
158+
<td>/api/v1/products/{productId}</td>
159+
<td>Delete Product By Id</td>
160+
<td></td>
161+
<td></td>
162+
<td>ProductId</td>
163+
<td></td>
164+
<tr>
165+
</table>
166+
167+
168+
### Technologies
169+
170+
---
171+
- Java 21
172+
- Spring Boot 3.0
173+
- Restful API
174+
- Lombok
175+
- Maven
176+
- Junit5
177+
- Mockito
178+
- Integration Tests
179+
- Docker
180+
- Docker Compose
181+
- Github Actions
182+
- Spring Cloud
183+
- Postman
184+
- Spring Security
185+
- JWT
186+
187+
188+
### Prerequisites
189+
190+
#### Define Variable in .env file for product service and user service
191+
192+
```
193+
DATABASE_USERNAME={DATABASE_USERNAME}
194+
DATABASE_PASSWORD={DATABASE_PASSWORD}
195+
```
196+
197+
---
198+
- Maven or Docker
199+
---
200+
201+
202+
### Docker Run
203+
The application can be built and run by the `Docker` engine. The `Dockerfile` has multistage build, so you do not need to build and run separately.
204+
205+
Please follow directions shown below in order to build and run the application with Docker Compose file;
206+
207+
```sh
208+
$ cd springbootmicroserviceswithsecurity
209+
$ docker-compose up -d
210+
```
211+
212+
If you change anything in the project and run it on Docker, you can also use this command shown below
213+
214+
```sh
215+
$ cd springbootmicroserviceswithsecurity
216+
$ docker-compose up --build
217+
```
218+
219+
---
220+
### Maven Run
221+
To build and run the application with `Maven`, please follow the directions shown below;
222+
223+
```sh
224+
$ cd springbootmicroserviceswithsecurity
225+
$ cd eurekaserver
226+
$ mvn clean install
227+
$ mvn spring-boot:run
228+
$ cd ..
229+
$ cd apigateway
230+
$ mvn clean install
231+
$ mvn spring-boot:run
232+
$ cd ..
233+
$ cd authservice
234+
$ mvn clean install
235+
$ mvn spring-boot:run
236+
$ cd ..
237+
$ cd userservice
238+
$ mvn clean install
239+
$ mvn spring-boot:run
240+
$ cd ..
241+
$ cd productservice
242+
$ mvn clean install
243+
$ mvn spring-boot:run
244+
```
245+
246+
### Screenshots
247+
248+
<details>
249+
<summary>Click here to show the screenshots of project</summary>
250+
<p> Figure 1 </p>
251+
<img src ="screenshots/spring_1.PNG">
252+
</details>

0 commit comments

Comments
 (0)