Scandit is an a discussion forum where people post and comment on a topic.
·
User Stories
·
- User Stories
- Timeline
- Architecture
- Installation Instruction
- Jenkins Instruction
- JavaDocs
- API
- Postman Collection
- What's Included
- Creators
Pivotal Tracker (Back-End REST API)
Application Goals from User Stories are:
- Sign-up and Create Scandit User
- Anyone can See Posts and Comments
- Signed-in user able to post a Post and comment
- Signed-in user able to delete it's own Posts and Comments
- Spring boot is used for the backend Services.
- Zuul Eureka client is used for load-balancing between Services.
- Zuul Gateway for Api-Gateway to forward api requests to Services.
- Postgres is Used for the database.
- Docker to run the services.
- RabbitMQ for inter-service Communication.
- ELK for Logging.
- Swagger to Create API Documentation.
- Jenkins for CI/CD
- Pivotal Cloud Foundry is used to deploy the application.
We discussed the architecture of the project and decided to use a database for each component. We figured out how to proceed with the development and created the corresponding user stories that will lead us to completion.
We used pair programming and collaborated with each other and tried to stick to our schedule.
- Implementation of RabbitMQ.
- Getting the services to communicate through the queues.
- Test Coverage.
- Adding the different services to the Jenkins pipeline and getting the coverage to show
Follow these easy step:
-
Clone the repository:
https://github.com/gajjuCoderBoi/capstone-project.git
-
Execute this on command line:
$cd capstone-project $docker-compose up
- if don't have Docker install from here
-
Enjoy
https://gajjucoderboi.github.io/capstone-project/
Follow these easy step:
-
Run Jenkins by using following command:
https://github.com/gajjuCoderBoi/capstone-project.git
- if don't have Jenkins install from here
-
Run Jenkins:
$jenkins-lts
-
Login
-
New Item.
Click New Item on Left panel.
-
Create Pipeline
-
Open Created Item and Configure.
-
Open BlueOcean in Jenkins and Run Project.
- if you don't have blueocean plugin install from here
-
Successful Jenkins Pipeline.
- Requirement Analysis
-
Thursday(Nov 21, 2019) - user stories
We give our user stories points, so that we could prioritize our development steps.
https://www.pivotaltracker.com/n/projects/2416993
For messaging services, we decided we would use RabbitMQ for microservices communication.
A new repository was created.
-
Friday(Nov 22, 2019) - Research
We research how the actual implementation of the communication services using RabbitMQ should look.
-
Saturday (Nov 23, 2019) - Replaced RestTemplate communication points with RabbitMQ.
Added queues for microservices communication
-
Monday(Nov 26, 2019) - Microservices communication finish and testing. Started Input Validation @ back-end
Continued to work on microservices communication. Finished routes and testing, Added input validation at the back-end.
-
Tuesday(Nov 27, 2019) - Finished back-end validation started Exception Handling.
Finished input validation at the back-end Started adding Exception Handling
-
Wednesday (Nov 28, 2019) - Start working on Swagger and JUnit testing Started working on Swagger Started writing the tests
-
Thanksgiving weekend (Nov 29 - Dec 1) - Continued working with Swagger, JUnit Test and started working on Jenkins pipeline Swagger work continued Testing work continued
-
Monday (Dec 2, 2019) - Swagger was completed. JUnit Test was completed and Jenkins was set up. Work on logging started,
Testing was completed Swagger was implemented Work on logging started
-
Tuesday (Dec 3, 2019) - Logging work continued. Integration testing started Logging completed JavaDocs created Integration Test started
*-*-*-*-*-*-*
-
Base URL: /, Version: 1.1
Default request content-types: application/json
Default response content-types: application/json
Schemes: http
Documentation for the API can be found in the swagger files and API Reference. There are a lot of tools available to automatically generate client from Swagger format. For more information about Swagger see official website - http://swagger.io/.
Path | Operation | Description | Microservice->Controller#Method |
---|---|---|---|
/users/signup | |||
POST |
Create a User (Sign-up) |
Users-api->UserController#signup |
|
/users/login | |||
POST |
Create a login session. |
Users-api->UserController#login |
|
/profiles/ | GET |
Retrieve the profile of the User. (Auth Token Required) |
Profile-API->ProfileController#getProfile |
POST |
Create the profile of the User. (Auth Token Required) |
Profile-API->ProfileController#createProfile |
|
PUT |
Update profile of the User. (Auth Token Required) |
Profile-API->ProfileController#updateProfile |
|
/posts/ | |||
POST |
Create a Posts of the User (Auth Token Required). |
Posts-API->PostController#createPost |
|
/posts/list | |||
GET |
Retrieve all the posts. |
Posts-API->PostController#getPosts |
|
/posts/{postId} | |||
DELETE |
Deleting a Post. (Auth Token Required). |
Posts-API->PostController#deletePost |
|
/comments/{postId} | GET |
Get Comments of a Post by postId. |
Comments-API->CommentController#getCommentsByPostId |
POST |
Creating a comment on a post. (Auth Token Required). |
Comments-API->CommentController#createComment |
|
/comments/{commentId} | DELETE |
Deleting a Comment. (Auth Token Required). |
Comments-API->CommentController#deleteComment |
Download Postman Collection and Feel free to play with api.
Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:
File Tree.
capstone-project/
.
├── API-Gateway
│ ├── Dockerfile
│ ├── api-gateway.iml
│ ├── manifest.yml
│ ├── mvnw
│ ├── mvnw.cmd
│ ├── pom.xml
│ └── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── APIGateway
│ │ │ ├── TestController.java
│ │ │ └── ZuulGatewayApplication.java
│ │ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-pcf.properties
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── example
│ └── APIGateway
│ └── ZuulGatewayApplicationTests.java
├── Jenkinsfile
├── Jenkinsfile_api-gateway
├── Jenkinsfile_comments-api
├── Jenkinsfile_eureka-server
├── Jenkinsfile_posts-api
├── Jenkinsfile_profile-api
├── Jenkinsfile_swagger-app
├── Jenkinsfile_users-api
├── README.md
├── comments-api
│ ├── Dockerfile
│ ├── manifest.yml
│ └── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── ga
│ │ │ └── commentsapi
│ │ │ ├── CommentsApplication.java
│ │ │ ├── bean
│ │ │ │ ├── Post.java
│ │ │ │ └── User.java
│ │ │ ├── config
│ │ │ │ ├── DatabaseLoader.java
│ │ │ │ ├── RabbitMQConfig.java
│ │ │ │ ├── SwaggerDocumentationConfiguration.java
│ │ │ │ └── WebSecurityConfig.java
│ │ │ ├── controller
│ │ │ │ └── CommentController.java
│ │ │ ├── exception
│ │ │ │ ├── CommentNotExistException.java
│ │ │ │ ├── ErrorResponse.java
│ │ │ │ ├── MyExceptionHandler.java
│ │ │ │ ├── PostNotExistException.java
│ │ │ │ ├── TokenException.java
│ │ │ │ └── UnauthorizeActionException.java
│ │ │ ├── messagequeue
│ │ │ │ ├── Receiver.java
│ │ │ │ └── Sender.java
│ │ │ ├── model
│ │ │ │ └── Comment.java
│ │ │ ├── repository
│ │ │ │ └── CommentRepository.java
│ │ │ └── service
│ │ │ ├── CommentService.java
│ │ │ └── CommentServiceImpl.java
│ │ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-local.properties
│ │ ├── application-pcf.properties
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── ga
│ └── commentsapi
│ ├── CommentsApplicationTests.java
│ ├── controller
│ │ └── CommentControllerTest.java
│ ├── exception
│ │ └── MyExceptionHandlerTest.java
│ └── service
│ └── CommentsServiceTest.java
├── deployment.sh
├── docker-compose.yml
├── eureka-server
│ ├── Dockerfile
│ ├── README.md
│ ├── eureka-server.iml
│ ├── manifest.yml
│ ├── mvnw
│ ├── mvnw.cmd
│ ├── pom.xml
│ └── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── eurekaserver
│ │ │ └── EurekaServerApplication.java
│ │ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-pcf.properties
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── example
│ └── eurekaserver
│ └── EurekaServerApplicationTests.java
├── logstash.conf
├── manifest.yml
├── posts-api
│ ├── Dockerfile
│ ├── manifest.yml
│ └── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── ga
│ │ │ └── postsapi
│ │ │ ├── PostsApiApplication.java
│ │ │ ├── bean
│ │ │ │ ├── Comment.java
│ │ │ │ ├── PostRequestBody.java
│ │ │ │ └── User.java
│ │ │ ├── cofig
│ │ │ │ ├── DatabaseLoader.java
│ │ │ │ ├── RabbitMQConfig.java
│ │ │ │ ├── SwaggerDocumentationConfiguration.java
│ │ │ │ └── WebSecurityConfig.java
│ │ │ ├── controller
│ │ │ │ └── PostController.java
│ │ │ ├── exception
│ │ │ │ ├── ErrorResponse.java
│ │ │ │ ├── MyExceptionHandler.java
│ │ │ │ ├── PostNotExistException.java
│ │ │ │ ├── TokenException.java
│ │ │ │ └── UnauthorizeActionException.java
│ │ │ ├── messagequeue
│ │ │ │ ├── Receiver.java
│ │ │ │ └── Sender.java
│ │ │ ├── model
│ │ │ │ └── Post.java
│ │ │ ├── repository
│ │ │ │ └── PostRepository.java
│ │ │ └── service
│ │ │ ├── PostService.java
│ │ │ └── PostServiceImpl.java
│ │ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-local.properties
│ │ ├── application-pcf.properties
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── ga
│ └── postsapi
│ ├── controller
│ │ └── PostControllerTest.java
│ ├── exception
│ │ └── MyExceptionHandlerTest.java
│ └── service
│ └── PostServiceTest.java
├── profile-api
│ ├── Dockerfile
│ └── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── ga
│ │ │ └── profileapi
│ │ │ ├── ProfileAPIApplication.java
│ │ │ ├── bean
│ │ │ │ └── User.java
│ │ │ ├── config
│ │ │ │ ├── RabbitMQConfig.java
│ │ │ │ ├── SwaggerDocumentationConfiguration.java
│ │ │ │ └── WebSecurityConfig.java
│ │ │ ├── controller
│ │ │ │ └── UserProfileController.java
│ │ │ ├── exception
│ │ │ │ ├── EntityNotCreatedException.java
│ │ │ │ ├── EntityNotFoundException.java
│ │ │ │ ├── ErrorResponse.java
│ │ │ │ ├── MyExceptionHandler.java
│ │ │ │ ├── ProfileNotFoundException.java
│ │ │ │ └── TokenException.java
│ │ │ ├── messagequeue
│ │ │ │ └── Sender.java
│ │ │ ├── model
│ │ │ │ └── Profile.java
│ │ │ ├── repository
│ │ │ │ └── ProfileRepository.java
│ │ │ └── service
│ │ │ ├── ProfileService.java
│ │ │ └── ProfileServiceImpl.java
│ │ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-local.properties
│ │ ├── application-pcf.properties
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── ga
│ └── profileapi
│ ├── ProfileAPIApplicationTests.java
│ ├── controller
│ │ └── UserProfileControllerTest.java
│ ├── exception
│ │ └── MyExceptionHandlerTest.java
│ └── service
│ └── ProfileServiceTest.java
├── swagger
│ ├── comments-api.json
│ ├── posts-api.json
│ ├── profile-api.json
│ ├── swagger.iml
│ └── users-api.json
├── swagger-app
│ ├── Dockerfile
│ ├── HELP.md
│ ├── manifest.yml
│ ├── mvnw
│ ├── mvnw.cmd
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ └── ga
│ │ │ │ └── swaggerapp
│ │ │ │ ├── SwaggerAppApplication.java
│ │ │ │ ├── config
│ │ │ │ │ ├── ServiceDefinitionsContext.java
│ │ │ │ │ ├── ServiceDescriptionUpdater.java
│ │ │ │ │ └── SwaggerUIConfiguration.java
│ │ │ │ └── controller
│ │ │ │ └── ServiceDefinitionController.java
│ │ │ └── resources
│ │ │ ├── application-dev.properties
│ │ │ ├── application-local.properties
│ │ │ ├── application-pcf.properties
│ │ │ └── application.properties
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── ga
│ │ └── swaggerapp
│ │ └── SwaggerAppApplicationTests.java
│ └── swagger-app.iml
└── users-api
├── Dockerfile
├── manifest.yml
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── ga
│ │ │ └── usersapi
│ │ │ ├── UsersApiApplication.java
│ │ │ ├── config
│ │ │ │ ├── DatabaseLoader.java
│ │ │ │ ├── JwtRequestFilter.java
│ │ │ │ ├── JwtUtil.java
│ │ │ │ ├── RabbitMQConfig.java
│ │ │ │ ├── SecurityConfig.java
│ │ │ │ ├── SecurityConfigInitializer.java
│ │ │ │ └── SwaggerConfig.java
│ │ │ ├── controller
│ │ │ │ └── UserController.java
│ │ │ ├── exception
│ │ │ │ ├── EntityNotCreatedException.java
│ │ │ │ ├── EntityNotFoundException.java
│ │ │ │ ├── ErrorResponse.java
│ │ │ │ ├── LoginException.java
│ │ │ │ ├── MyExceptionHandler.java
│ │ │ │ └── UserAlreadyExistException.java
│ │ │ ├── messagequeue
│ │ │ │ └── Receiver.java
│ │ │ ├── model
│ │ │ │ ├── JwtResponse.java
│ │ │ │ ├── User.java
│ │ │ │ └── UserRole.java
│ │ │ ├── repository
│ │ │ │ ├── UserRepository.java
│ │ │ │ └── UserRoleRepository.java
│ │ │ └── service
│ │ │ ├── UserRoleService.java
│ │ │ ├── UserRoleServiceImpl.java
│ │ │ ├── UserService.java
│ │ │ └── UserServiceImpl.java
│ │ └── resources
│ │ ├── application-dev.properties
│ │ ├── application-local.properties
│ │ ├── application-pcf.properties
│ │ ├── application-qa.properties
│ │ └── application.properties
│ └── test
│ └── java
│ └── com
│ └── ga
│ └── usersapi
│ ├── UsersApiApplicationTests.java
│ ├── controller
│ │ └── UserControllerTest.java
│ ├── exception
│ │ └── MyExceptionHandlerTest.java
│ ├── integration
│ │ └── UserIntegrationTest.java
│ └── service
│ ├── UserRoleServiceTest.java
│ └── UserServiceTest.java
Carlos Kruger
Mohammad Javed
Got Swagger Help from : Github