Skip to content

Commit

Permalink
Merge pull request #7 from shishir-insane/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
shishir-insane authored Aug 30, 2019
2 parents 38a698f + 65a20d2 commit 5ee86d1
Show file tree
Hide file tree
Showing 76 changed files with 2,488 additions and 447 deletions.
38 changes: 13 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ An in-progress comprehensive health and symptom tracker.

## Low Level Design

### Sequence Diagram
Below is a sequence diagram of a typical request flow in the application.

![Typical Sequence Diagram](docs/assets/images/TypicalFlowSequence.png)

### Stack Used

1. **Methodology**: Behaviour Driven Development BDD using Cucumber 4.7
2. **Microservice Design Patterns**: Decomposition by Business Capability, Database per Service, Backend For Frontend BFF and Log Aggregation Observability pattern
1. **Methodology**: Behaviour Driven Development BDD using Cucumber 4.7
2. **Microservice Design Patterns**: Decomposition by Business Capability, Database per Service, Backend For Frontend BFF and Log Aggregation Observability pattern
3. **Programming Language**: Java 8
4. **Database**: Mongo DB 4.0
5. **UI Stack**: HTML 5, CSS 3, Javascript 3
Expand All @@ -37,7 +42,7 @@ An in-progress comprehensive health and symptom tracker.
|----|-------|----------------------------|-----------|------|------------------------|----------------------------------------|
| 1 | UI | Sinthoma Web | localhost | 8093 | /sinthoma | |
| 2 | UI | Sinthoma App | | | | |
| 3 | BFF | Dashboard BFF | | | | |
| 3 | BFF | Dashboard BFF | localhost | 8094 | /sinthoma/dashboard-bff| /sinthoma/dashboard-bff/swagger-ui.html |
| 4 | BFF | Daily Tracker BFF | | | | |
| 5 | BFF | Stats Reports BFF | | | | |
| 6 | CORE | User Manager API | localhost | 8092 | /sinthoma/user-manager | /sinthoma/user-manager/swagger-ui.html |
Expand All @@ -47,25 +52,8 @@ An in-progress comprehensive health and symptom tracker.
| 10 | CORE | Food Nutrition Manager API | | | | |
| 11 | CORE | Report Manager API | | | | |
| 12 | CORE | Notification Manager API | | | | |
| 13 | PROXY | Weather Proxy API | | | | |
| 14 | PROXY | Email Proxy API | | | | |
| 15 | DB | Mongo DB | localhost | 8091 | - | |
| 16 | DB | Mongo DB Express | localhost | 8090 | /db/sinthoma | |

## Status Summary
| # | Layer | Component | Status | Planned | Designed | Developed | Tested | Released |
|----|-------|----------------------------|-------------|---------|-------------|-------------|--------|----------|
| 1 | UI | Sinthoma Web | IN PROGRESS | YES | YES | IN PROGRESS | NO | NO |
| 2 | UI | Sinthoma App | NOT PLANNED | NO | NO | NO | NO | NO |
| 3 | BFF | Dashboard BFF | IN PROGRESS | YES | YES | IN PROGRESS | NO | NO |
| 4 | BFF | Daily Tracker BFF | IN PROGRESS | YES | IN PROGRESS | NO | NO | NO |
| 5 | BFF | Stats Reports BFF | NOT PLANNED | NO | NO | NO | NO | NO |
| 6 | CORE | User Manager API | IN PROGRESS | YES | YES | IN PROGRESS | NO | NO |
| 7 | CORE | Symptom Manager API | IN PROGRESS | YES | YES | IN PROGRESS | NO | NO |
| 8 | CORE | Appointment Manager API | IN PROGRESS | YES | IN PROGRESS | NO | NO | NO |
| 9 | CORE | Medication Manager API | NOT PLANNED | NO | NO | NO | NO | NO |
| 10 | CORE | Food Nutrition Manager API | NOT STARTED | NO | NO | NO | NO | NO |
| 11 | CORE | Report Manager API | NOT STARTED | NO | NO | NO | NO | NO |
| 12 | CORE | Notification Manager API | NOT STARTED | NO | NO | NO | NO | NO |
| 13 | PROXY | Weather Proxy API | NOT STARTED | NO | NO | NO | NO | NO |
| 14 | PROXY | Email Proxy API | NOT STARTED | NO | NO | NO | NO | NO |
| 13 | CORE | Auth Service | localhost | 8095 | /sinthoma/auth | /sinthoma/auth/swagger-ui.html |
| 14 | PROXY | Weather Proxy API | | | | |
| 15 | PROXY | Email Proxy API | | | | |
| 16 | DB | Mongo DB | localhost | 8091 | - | |
| 17 | DB | Mongo DB Express | localhost | 8090 | /db/sinthoma | |
17 changes: 16 additions & 1 deletion bff/dashboard-bff/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,22 @@
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* DashboardBffApplication.java
* dashboard-bff
* DashboardBffApplication.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard;

Expand All @@ -21,6 +11,11 @@
@SpringBootApplication
public class DashboardBffApplication {

/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
SpringApplication.run(DashboardBffApplication.class, args);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* CoreLoggerConfig.java
* dashboard-bff
* CoreLoggerConfig.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.config;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* LoggerConfig.java
* dashboard-bff
* LoggerConfig.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.config;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* RestTemplateConfig.java
* dashboard-bff
* RestTemplateConfig.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.config;

Expand All @@ -23,6 +13,12 @@
@Configuration
public class RestTemplateConfig {

/**
* Rest template.
*
* @param builder the builder
* @return the rest template
*/
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* UserManagerController.java
* dashboard-bff
* UserManagerController.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.controller;

Expand All @@ -30,6 +20,12 @@ public class UserManagerController {
@Autowired
private UserManagerService userManagerService;

/**
* Login.
*
* @param user the user
* @return the user
*/
@PostMapping("/login")
@ResponseBody
public User login(@RequestBody User user) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* ApplicationLogAspect.java
* dashboard-bff
* ApplicationLogAspect.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.log;

Expand All @@ -22,15 +12,24 @@
@Aspect
public class ApplicationLogAspect {

/**
* In controller package.
*/
@Pointcut("within(com.sk.sinthoma.bff.dashboard.controller.*)")
public void inControllerPackage() {
}

/**
* In service package.
*/
@Pointcut("within(com.sk.sinthoma.bff.dashboard.service.*)")
public void inServicePackage() {

}

/**
* Do controller log.
*/
@Before("inControllerPackage()")
public void doControllerLog() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* LogInstrumentationConfig.java
* dashboard-bff
* LogInstrumentationConfig.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.log;

Expand All @@ -38,6 +28,11 @@ public class LogInstrumentationConfig extends AsyncConfigurerSupport implements
@Autowired
private BeanFactory beanFactory;

/**
* Executor.
*
* @return the executor
*/
@Bean
public Executor executor() {
final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
Expand All @@ -48,6 +43,9 @@ public Executor executor() {
return new LazyTraceExecutor(beanFactory, threadPoolTaskExecutor);
}

/* (non-Javadoc)
* @see org.springframework.scheduling.annotation.AsyncConfigurerSupport#getAsyncExecutor()
*/
@Override
public Executor getAsyncExecutor() {
final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
Expand All @@ -58,11 +56,19 @@ public Executor getAsyncExecutor() {
return new LazyTraceExecutor(beanFactory, threadPoolTaskExecutor);
}

/* (non-Javadoc)
* @see org.springframework.scheduling.annotation.SchedulingConfigurer#configureTasks(org.springframework.scheduling.config.ScheduledTaskRegistrar)
*/
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
scheduledTaskRegistrar.setScheduler(schedulingExecutor());
}

/**
* Scheduling executor.
*
* @return the executor
*/
@Bean(destroyMethod = "shutdown")
public Executor schedulingExecutor() {
return Executors.newScheduledThreadPool(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/**
* PerfLogConfiguration.java
* dashboard-bff
* PerfLogConfiguration.java - dashboard-bff
* Copyright 2019 Shishir Kumar
*
* Licensed under the GNU Lesser General Public License v3.0
* Permissions of this license are conditioned on making available complete
* source code of licensed works and modifications under the same license
* or the GNU GPLv3. Copyright and license notices must be preserved.
*
* Contributors provide an express grant of patent rights. However, a larger
* work using the licensed work through interfaces provided by the licensed
* work may be distributed under different terms and without source code for
* the larger work.
*/
package com.sk.sinthoma.bff.dashboard.log;

Expand All @@ -33,16 +23,29 @@
@Slf4j
public class PerfLogConfiguration {

/**
* Monitor.
*/
@Pointcut("execution(* com.sk.sinthoma.bff.dashboard.*.*.*(..))")
public void monitor() {
log.info("Pointcut defined for execution(* com.sk.sinthoma.bff.dashboard.*.*.*(..))");
}

/**
* Performance monitor interceptor.
*
* @return the performance monitor interceptor
*/
@Bean
public PerformanceMonitorInterceptor performanceMonitorInterceptor() {
return new PerformanceMonitorInterceptor(false);
}

/**
* Performance monitor advisor.
*
* @return the advisor
*/
@Bean
public Advisor performanceMonitorAdvisor() {
final AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
Expand Down
Loading

0 comments on commit 5ee86d1

Please sign in to comment.