Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8880c2a
Merge pull request #32 from lamisplus/dev
mathewade Jun 9, 2024
2b349a1
Merge pull request #35 from lamisplus/dev
mathewade Jul 12, 2024
7411303
Update README.md
AJ-DataFI Mar 13, 2025
6f5bc83
Merge pull request #38 from lamisplus/AJ-DataFI-patch-1
AJ-DataFI Mar 14, 2025
eaed9ed
Update README.md
AJ-DataFI Mar 14, 2025
d78d215
Merge pull request #39 from lamisplus/AJ-DataFI-patch-1
AJ-DataFI Mar 14, 2025
1e4b186
Feat: Created chart entity, controller and service for the core dashb…
EMEKADATAFI Jul 30, 2025
e14dac9
Feat: API to getChartIndicator By Location using result set & raw query
EMEKADATAFI Jul 30, 2025
54530a7
Feat: Added tableName variable to ChartDTO
EMEKADATAFI Jul 30, 2025
54b6869
Feat: Update endpoint with more variables
EMEKADATAFI Jul 30, 2025
906e947
Fix: modified API and method to return an object instead of list
EMEKADATAFI Jul 31, 2025
0df4fe6
Feat: Spring boot Cache implemented for fast response time
EMEKADATAFI Jul 31, 2025
8d6b4c5
feature: dynamic dashboard charts frontend
peterabiodun Jul 31, 2025
58c6ff0
Feat: Added facility id to API and query
EMEKADATAFI Aug 1, 2025
1cee8a4
Merge remote-tracking branch 'origin/modules_chart' into modules_chart
EMEKADATAFI Aug 1, 2025
71b6c54
feature: sort charts by position, cache defaults
peterabiodun Aug 1, 2025
2c35091
feature: implemented exists check for chart tables
peterabiodun Aug 1, 2025
24203ea
feature: implemented exists check for chart tables
peterabiodun Aug 1, 2025
a71c2fc
Merge branch 'optimized-core' of https://github.com/lamisplus/Core in…
peterabiodun Aug 19, 2025
12196b8
remove archived from lastRole id
joshuagabriel-datafi Aug 20, 2025
4c401bd
exclude certain menu for RDE userRole
joshuagabriel-datafi Aug 20, 2025
22e4d80
Merge branch 'optimized-core' of https://github.com/lamisplus/Core in…
peterabiodun Aug 20, 2025
a30ef1c
Feat: Implemented multiple cache for app
EMEKADATAFI Aug 25, 2025
7382eef
Merge remote-tracking branch 'origin/modules_chart' into modules_chart
EMEKADATAFI Aug 25, 2025
7ab9238
Merge remote-tracking branch 'public/modules_chart' into modules_chart
peterabiodun Aug 25, 2025
0ca525b
Merge branch 'dev-backend' of https://github.com/lamisplus/Core into …
peterabiodun Sep 1, 2025
78ea791
feat: backend crud operations for dynamic charts
peterabiodun Sep 3, 2025
1c4439c
Merge https://github.com/lamisplus/Core into modules_chart
emmannajichi Sep 4, 2025
931038e
Merge branch 'modules_chart' of https://github.com/lamisplus/Core int…
emmannajichi Sep 4, 2025
0a3f1a0
feature:added and endpoint to get charts data
TyavBarnabas2 Sep 9, 2025
7bb8ead
started adding chart configuration
emmannajichi Sep 9, 2025
69729d4
added files to gitignore
emmannajichi Sep 9, 2025
3494b7f
Stop tracking db-config.yml
emmannajichi Sep 9, 2025
2b7dcf7
Merge branch 'modules_chart' of https://github.com/lamisplus/Core int…
emmannajichi Sep 9, 2025
4910d0a
fix: renamed an api
TyavBarnabas2 Sep 9, 2025
7cb5050
Merge remote-tracking branch 'origin/modules_chart' into modules_chart
TyavBarnabas2 Sep 9, 2025
8a8cd07
refactor on home dashboard ongoing
emmannajichi Sep 9, 2025
6a80d97
Merge branch 'modules_chart' of https://github.com/lamisplus/Core int…
emmannajichi Sep 9, 2025
816148e
Feat: added get all charts API
peterabiodun Sep 10, 2025
f8d32cd
Merge remote-tracking branch 'public/modules_chart' into modules_chart
peterabiodun Sep 10, 2025
8de4532
done developing the chart edit, delete, import and export functionali…
emmannajichi Sep 11, 2025
dde767d
minor adjustment to buttons
emmannajichi Sep 11, 2025
1dec933
update:aaded liquid base query to insert chart config into base_menu …
TyavBarnabas2 Sep 11, 2025
aba5dce
minor change
emmannajichi Sep 11, 2025
367725f
Merge branch 'modules_chart' of https://github.com/lamisplus/Core int…
emmannajichi Sep 11, 2025
6111769
chat entity added
joshuagabriel-datafi Oct 20, 2025
3e860ff
added chatWidget rendered
joshuagabriel-datafi Oct 20, 2025
8b46f56
added messageType
joshuagabriel-datafi Oct 20, 2025
e9d992b
refactor websocketConfiguration
joshuagabriel-datafi Oct 20, 2025
c39a78d
added chatInterface
joshuagabriel-datafi Oct 20, 2025
2690c33
added eventListner
joshuagabriel-datafi Oct 20, 2025
8168fde
added pushNotification controller
joshuagabriel-datafi Oct 20, 2025
cf54959
added websocket const fix
joshuagabriel-datafi Oct 20, 2025
94e2340
added emojis
joshuagabriel-datafi Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
### Java template
*.class

db-config.yml
package-lock.json
# BlueJ files
*.ctxt

Expand Down Expand Up @@ -37,4 +39,5 @@ node_modules
starter-module/src/main/resources/static/*
starter-module/build/*
starter-module/node/*
base-module/node/*
base-module/node/*
db-config.yml
100 changes: 75 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,84 @@
# lamisplus-core-enhancement application
# Run with java version 8.
## Setting up the database
This application uses `postgres` database; create a database on postgres
and set up the database credentials in the application.yml in lamisplus module
# LAMISPlus 2.0

## Maven setup
Use maven 3 upwards, run **mvn dependency:tree** to resolve java dependencies
## System Requirements

## Starting the website on your local machine
Just start `coreApplication` with the command **mvn spring-boot:run**.
This will start up the website using a local database on port **8080**. or another user defined port.
### Prerequisites to Install
- IDE of choice (IntelliJ, Eclipse, etc.)
- Java 8+
- PostgreSQL 14+
- `.m2` folder from Google Drive https://drive.google.com/file/d/17F6wHPADVVaDBabajrM9wABUeB04i6D1/view?usp=sharing

Browsing to http://localhost:8080/login should give you the homepage.
## Run in Development Environment

## Front-end development
When starting on your local machine, you should get instant reloading of all static files.
Simply make a change and refresh the page in your browser.
### How to Install Dependencies
1. Install Java 8+
2. Install PostgreSQL 14+
3. Download and replace the system `.m2` folder.
4. Clone the git repository:
```bash
git clone https://github.com/lamisplus/Core.git
```
5. Open the project in your IDE of choice.

All front-end related static files are located in `lamisplus/src/main/resources/static`.
### Update Configuration File
1. Update database access details in `db-config.yml` file.
2. Update other Maven application properties as required.

> WARNING: All files in `src/main/resources` will be packaged and deployed with the website.
> Do not put any files anywhere in that folder if they are not supposed to be deployed!
### Run Build and Install Commands
1. Change the directory to `starter-module`:
```bash
cd starter-module
```
2. Run Frontend Build Command:
```bash
npm run build
```
3. Run Maven clean install:
```bash
mvn clean install
```

### LiveReload integration
The application supports LiveReload.
If you have the plugin in your browser, just activating it on the site should be enough.
## How to Package for Production Environment
1. Run Maven package command:
```bash
mvn clean package
```

### Front end system
The application is built using react native for frontend.
## Launch Packaged JAR File
1. Launch the JAR file:
```bash
java -jar <path-to-jar-file>
```
2. Optionally, run with memory allocation:
```bash
java -jar -Xms4096M -Xmx6144M <path-to-jar-file>
```

## Troubleshooting
### Resetting the database
Create a database property in the application.yml
## Visit the Application
- Visit the application on a browser at the configured port:
```
http://localhost:8080
```

## Access Swagger Documentation
- Visit the application at:
```
http://localhost:8080/swagger-ui.html#/
```

## Access Application Logs
- Application logs can be accessed in the `application-debug` folder.

## Authors & Acknowledgments
### Main contributors
- Victor Ajor https://github.com/AJ-DataFI
- Mathew Adegbite https://github.com/mathewade
- Emeka https://github.com/drjavanew
- Abisayo Peter Abiodun https://github.com/Asquarep
- John gichangi https://github.com/gichangi
- Joshua https://github.com/JOSH2019GABRIEL
- Kennedy Kirui https://github.com/kenkirui
- Tyav Barnabas https://github.com/tyavbarnabas

### Special mentions
- Dr Karim Usman https://github.com/drkusman
15 changes: 15 additions & 0 deletions base-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,21 @@
<artifactId>zip4j</artifactId>
<version>2.11.5</version>
</dependency>
<!-- Caching Dependencies -->
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.8</version>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package org.lamisplus.modules.base.configurer;

import org.ehcache.config.CacheConfiguration;
import org.ehcache.config.builders.CacheConfigurationBuilder;
import org.ehcache.config.builders.ExpiryPolicyBuilder;
import org.ehcache.config.builders.ResourcePoolsBuilder;
import org.ehcache.config.units.MemoryUnit;
import org.ehcache.core.config.DefaultConfiguration;
import org.ehcache.expiry.ExpiryPolicy;
import org.ehcache.jsr107.EhcacheCachingProvider;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.jcache.JCacheCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.cache.Caching;
import java.time.Duration;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Configuration
@EnableCaching
public class CacheConfig {
@Value("${cache.names}")
private List<String> cacheNames;

@Value("${cache.heap.size}")
private int heapSize;

@Value("${cache.offheap.size}")
private int offheapSize;

@Value("${cache.offheap.unit}")
private String offheapUnit;

@Value("${cache.expiry.ttl.minutes}")
private int ttlMinutes;

@Value("${cache.expiry.idle.minutes}")
private int idleMinutes;

@Bean
public CacheManager jCacheCacheManager() {
Map<String, CacheConfiguration<?, ?>> cacheMap = new HashMap<>();

// Configure each cache from properties (both explicit configs and names list)
cacheNames.forEach(cacheName -> {
ResourcePoolsBuilder resourcePoolsBuilder = ResourcePoolsBuilder
.heap(heapSize)
.offheap(offheapSize, MemoryUnit.valueOf(offheapUnit));

ExpiryPolicy<Object, Object> expiryPolicy = createExpiryPolicy(
Duration.ofMinutes(ttlMinutes),
Duration.ofMinutes(idleMinutes)
);

CacheConfiguration<Object, Object> cacheConfiguration = CacheConfigurationBuilder
.newCacheConfigurationBuilder(Object.class, Object.class, resourcePoolsBuilder)
.withExpiry(expiryPolicy)
.build();

cacheMap.put(cacheName.trim(), cacheConfiguration);
});

EhcacheCachingProvider ehcacheCachingProvider =
(EhcacheCachingProvider) Caching.getCachingProvider(EhcacheCachingProvider.class.getName());

DefaultConfiguration defaultConfiguration =
new DefaultConfiguration(cacheMap, ehcacheCachingProvider.getDefaultClassLoader());

javax.cache.CacheManager cacheManager =
ehcacheCachingProvider.getCacheManager(ehcacheCachingProvider.getDefaultURI(), defaultConfiguration);

return new JCacheCacheManager(cacheManager);
}

private static ExpiryPolicy<Object, Object> createExpiryPolicy(Duration timeToLive, Duration timeToIdle) {
return ExpiryPolicyBuilder
.expiry()
.create(timeToLive)
.access(timeToIdle)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void registerStompEndpoints(StompEndpointRegistry registry) {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.setApplicationDestinationPrefixes("/app");
config.enableSimpleBroker("/topic");
config.enableSimpleBroker("/topic", "specific");
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.lamisplus.modules.base.configurer;


import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.lamisplus.modules.base.domain.entities.ChatMessage;
import org.lamisplus.modules.base.domain.entities.MessageType;
import org.springframework.context.event.EventListener;
import org.springframework.messaging.simp.SimpMessageSendingOperations;
import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.messaging.SessionDisconnectEvent;


@Component
@RequiredArgsConstructor
@Slf4j
public class WebSocketEventListener {

private final SimpMessageSendingOperations messagingTemplate;


@EventListener
public void handleWebSocketDisconnectListener(SessionDisconnectEvent event) {
StompHeaderAccessor accessor = StompHeaderAccessor.wrap(event.getMessage());
String username = (String) accessor.getSessionAttributes().get("username");
if (username == null) {
// log.info("Username is disconnected {}", username);
System.out.println("Username is disconnected {}" + username);
var chatMessage = ChatMessage.builder()
.type(MessageType.LEAVE)
.sender(username)
.build();
messagingTemplate.convertAndSend("/topic/public", chatMessage);
}
}
}
Loading