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
Simple rest api using spring boot and mongodb as nosql storage.
8
+
This project mainly focussed on the kickstart to the CI/CD using TravisCI. Also includes CodeCoverage, Sonarqube integration with can be plugged into any application.
9
+
6
10
## Task List Progress
7
11
-[X] Rest controllers and models using SpringBoot
8
12
-[X] MongoDB configuration
@@ -13,30 +17,21 @@
13
17
-[ ] 80% and above Code Coverage
14
18
-[ ] Cloud deployment
15
19
20
+
### Getting Started
21
+
* Import this project into your favourite IDE after fork and checkout of this repository.
16
22
17
-
```Tech Stack Used in this project ```
18
-
* Java
19
-
* Spring Boot
20
-
* Gradle
21
-
* MongoDB
22
-
23
-
## ```Setup Steps ```
23
+
### Pre-requisite and Installing Steps
24
24
25
-
### Step 1: Creating a Database
26
-
Get a running instance of MongoDB that you can connect to.
25
+
* Get a running instance of MongoDB that you can connect to.
27
26
For more information on getting started with MongoDB, visit their [online tutorial](https://docs.mongodb.com/manual/).
28
-
29
-
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:
27
+
* 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:
30
28
```use rest_tutorial;```
31
-
This will create a new database in MongoDB that we can use for our project.
32
-
33
-
### Step 2: Adding a MongoDB Collection and Data
34
-
Create a sample collection that will hold data about different types of pets. Let's create the collection with the following command:
35
29
30
+
* Create a sample collection that will hold data about different types of pets. Let's create the collection with the following command:
36
31
```db.createCollection("pets");```
37
-
Once the collection is created, we need to add some data!
38
-
We can add data to the collection with the following command:
39
32
33
+
* Once the collection is created, we need to add some data!
34
+
We can add data to the collection with the below query, you can add any number of data like this :
40
35
```db.pets.insertMany([```
41
36
```{```
42
37
```"name" : "Spot",```
@@ -55,13 +50,25 @@ We can add data to the collection with the following command:
55
50
```}```
56
51
```]);```
57
52
58
-
### Step 3: Adding mongodb credentials
59
-
Add the mongodb authentication-database, username & password in [application.properties](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/src/main/resources/application.properties)
53
+
* Add the mongodb authentication-database, username & password in [application.properties](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/src/main/resources/application.properties)
60
54
If there is no authrntication when you are running locally then you can also remove these properties from this file.
61
55
62
-
### Step 4: Testing Your API
56
+
57
+
### Running the tests
63
58
Once the server starts, you are free to test your API however you choose.
64
-
For example :
65
-
* POST 'http://localhost:8080/pets'
66
-
With body : ```{"name" : "Liam", "species" : "cat", "breed" : "tabby"}```
67
-
and header : ```'Content-Type: application/json'```
Please read [CONTRIBUTING.md](https://github.com/GouravRusiya30/SpringBootRestAPI/blob/master/docs/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
0 commit comments