You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### This project mainly focussed on the Kickstart to the CI/CD using TravisCI. Includes CodeCoverage, Sonarqube integration which can be plugged into any application.
18
+
#### This project mainly focused on the Kickstart to the CI/CD using TravisCI. Includes CodeCoverage, Sonarqube integration which can be plugged into any application.
19
19
20
20
21
21
## Task List Progress
22
22
-[X] Rest controllers and models using SpringBoot
23
23
-[X] MongoDB configuration
24
24
-[X] TravisCI build
25
-
-[X] SonarQube integration
25
+
-[X] SonarQube integration
26
26
-[X] Jacoco Test report
27
-
-[] JWT authentication
27
+
-[X] JWT authentication
28
28
-[ ] 80% and above Code Coverage (using codecov or coveralls)
29
29
-[ ] Cloud deployment
30
30
@@ -33,15 +33,15 @@
33
33
34
34
### Pre-requisite and Installing Steps
35
35
36
-
* Get a running instance of MongoDB that you can connect to.
36
+
* Get a running instance of MongoDB that you can connect to.
37
37
For more information on getting started with MongoDB, visit their [online tutorial](https://docs.mongodb.com/manual/).
38
38
* Start by creating a test database. I will call mine "rest_tutorial" using the following command in the MongoDB shell, or through a database manager like MongoDB Compass:
39
39
```use rest_tutorial;```
40
40
41
41
* Create a sample collection that will hold data about different types of pets. Let's create the collection with the following command:
42
42
```db.createCollection("pets");```
43
43
44
-
* Once the collection is created, we need to add some data!
44
+
* Once the collection is created, we need to add some data!
45
45
We can add data to the collection with the below query, you can add any number of data like this :
46
46
```db.pets.insertMany([```
47
47
```{```
@@ -62,11 +62,29 @@ We can add data to the collection with the below query, you can add any number o
62
62
```]);```
63
63
64
64
* Add the mongodb authentication-database, username & password in [application.properties](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/src/main/resources/application.properties)
65
-
If there is no authrntication when you are running locally then you can also remove these properties from this file.
65
+
If there is no authentication when you are running locally then you can also remove these properties from this file.
66
66
67
+
* Create the user roles in the database. The user roles can be one of "USER, MODERATOR or ADMIN"
68
+
```
69
+
db.roles.insertMany([
70
+
{ name: "ROLE_USER" },
71
+
{ name: "ROLE_MODERATOR" },
72
+
{ name: "ROLE_ADMIN" },
73
+
])
74
+
```
67
75
68
76
### Running the tests
69
-
Once the server starts, you are free to test your API however you choose.
77
+
Once the server starts, your first need to register a user and login as that user to get a token.\
For code coverage reports integration, I have shown example using Codecov and Coveralls as both are pretty popular and easy to integrate with the travis.
83
105
@@ -91,10 +113,10 @@ Awesome but please first go through the [ISSUE TEMPLATE.md](https://github.com/G
91
113
92
114
### Pull Request Template
93
115
``Are you up for your first PR for this project !!!``
94
-
Awesome but please first go through the [PULL REQUEST TEMPLATE.md](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/PULL_REQUEST_TEMPLATE.md) and use this template to submit your PR.
116
+
Awesome but please first go through the [PULL REQUEST TEMPLATE.md](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/PULL_REQUEST_TEMPLATE) and use this template to submit your PR.
95
117
96
118
### Contributing
97
119
Please read [CONTRIBUTING.md](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/CONTRIBUTING.md) and [CODE OF CONDUCT.md](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/CODE_OF_CONDUCT.md) for details on our code of conduct, and the process for submitting pull requests to us.
0 commit comments