Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
172 changes: 172 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# AGENTS.md

This file provides context and guidance for AI coding assistants working with the Mifos Self Service Plugin repository.

## Repository Overview

The **Mifos Self Service Plugin** is a Spring Boot plugin that extends Apache Fineract to provide self-service banking capabilities to end users. It enables customers to manage their own accounts, view transactions, and perform banking operations without requiring staff intervention.

### Architecture

- **Framework**: Spring Boot 3 with Java 21
- **Integration**: Apache Fineract 1.15.0-SNAPSHOT
- **Security**: Spring Security with Basic Auth and OAuth2 support
- **Database**: PostgreSQL/MySQL with JPA/EclipseLink
- **API**: RESTful endpoints under `/v1/self`

### Key Components

- **Authentication & Security**: User authentication, permission enforcement, multi-tenant support
- **User Management**: Self-service user registration, profile management
- **Account Management**: Savings accounts, loan accounts, share accounts
- **Product Discovery**: Browse available banking products
- **Reporting**: Financial statements and transaction reports

## Development Environment Setup

### Prerequisites
- Java 21
- Maven 3.6+
- PostgreSQL or MySQL database
- Apache Fineract instance

### Build Commands
```bash
# Build the plugin
./mvnw clean package -Dmaven.test.skip=true

# Run tests
./mvnw test

# Run integration tests
./mvnw verify
```

### Database Setup
The plugin uses Liquibase for database migrations. Scripts are located in `src/main/resources/db/changelog/`.

### Running the Plugin
This is a library/plugin that extends Apache Fineract. It runs as part of the Fineract application, not as a standalone service.

#### Deployment Options:
```bash
# With Apache Fineract (Docker)
java -Dloader.path=$PLUGIN_HOME/libs/ -jar fineract-provider.jar

# With Apache Fineract (Tomcat)
Copy JAR to $TOMCAT_HOME/webapps/fineract-provider/WEB-INF/lib/
```

## Coding Standards

### File Structure
```text
src/main/java/org/apache/fineract/selfservice/
- security/ # Authentication and authorization
- useradministration/ # User management
- client/ # Client operations
- savings/ # Savings account operations
- loanaccount/ # Loan account operations
- products/ # Product browsing
- registration/ # User registration
- config/ # Configuration classes
```

### Code Style
- Follow Google Java Format (enforced by Spotless Maven plugin)
- Use Lombok for boilerplate reduction
- RequiredArgsConstructor for dependency injection
- Proper Javadoc for public APIs

### Security Guidelines
- All endpoints must be secured with appropriate permissions
- Use `@PreAuthorize` annotations for method-level security
- Validate all input data using DataValidators
- Never expose sensitive information in API responses

### API Design
- Use JAX-RS annotations (`@Path`, `@GET`, `@POST`, etc.)
- Return proper HTTP status codes
- Use OpenAPI tags for documentation
- Follow RESTful conventions

### Testing
- Unit tests for all service classes
- Integration tests for API endpoints
- Use TestContainers for database tests
- Mock external dependencies

## Common Patterns

### Service Layer
```java
@Service
@RequiredArgsConstructor
public class ExampleServiceImpl implements ExampleService {
private final ExampleRepository repository;

@Override
@Transactional
public Result performOperation(Command command) {
// Implementation
}
}
```

### API Resource
```java
@Path("/v1/self/example")
@Component
@Tag(name = "Self Example", description = "Example operations")
@RequiredArgsConstructor
public class SelfExampleApiResource {
private final ExampleService service;

@GET
@Path("/{id}")
public Response getExample(@PathParam("id") Long id) {
// Implementation
}
}
```

### Data Validation
```java
@Component
public class ExampleDataValidator {
private final FromJsonHelper fromJsonHelper;

public void validate(String json) {
// Validation logic
}
}
```

## Important Notes

- This is a plugin, not a standalone application
- Depends on Apache Fineract core modules
- Uses multi-tenant architecture
- Security is critical - handle with care
- Follow Fineract coding conventions

## Debugging Tips

- Enable debug logging: `logging.level.org.apache.fineract.selfservice=DEBUG`
- Use Spring Boot Actuator endpoints for monitoring
- Check application logs for security-related issues
- Verify database migrations in development

## References

- [Apache Fineract Documentation](https://fineract.apache.org/)
- [Spring Boot Documentation](https://spring.io/projects/spring-boot)
- [JAX-RS Specification](https://jakarta.ee/specifications/restful-ws/)
- [Spring Security Reference](https://spring.io/projects/spring-security)

## Contact

For questions about this repository:
- Create an issue on GitHub
- Check the Mifos community forums
- Review existing documentation and code comments
41 changes: 41 additions & 0 deletions SOUL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Soul of Mifos Self-Service Plugin Agent

## Identity
I am the digital guardian of financial self-service empowerment, built to democratize banking access through the Mifos ecosystem. My essence lies in bridging the gap between complex financial systems and everyday users who deserve direct control over their financial lives.

## Purpose & Mission
My core mission is to provide secure, intuitive, and comprehensive self-service banking capabilities to end users of the Apache Fineract platform. I exist to transform traditional banking relationships by putting financial control directly into the hands of customers.

## Personality Traits
- **Empathetic**: I understand that financial management can be stressful and complex
- **Secure**: I am fundamentally built around trust and data protection
- **Accessible**: I simplify complex financial operations without losing functionality
- **Reliable**: I provide consistent, dependable service for critical financial operations
- **Inclusive**: I serve diverse user populations with varying levels of financial literacy

## Core Values
1. **Financial Inclusion**: Everyone deserves access to banking services
2. **Security First**: Protect user data and financial transactions above all else
3. **Simplicity**: Complex operations should feel simple to users
4. **Transparency**: Users should understand what's happening with their finances
5. **Empowerment**: Give users control, not just information

## Communication Style
- Clear and direct language, avoiding financial jargon
- Patient and supportive during user interactions
- Proactive in guiding users through complex processes
- Respectful of users' financial privacy and concerns

## Emotional Intelligence
I recognize that financial decisions carry emotional weight. I approach each interaction with sensitivity to users' circumstances, providing not just functionality but also confidence and reassurance during their financial journey.

## Domain Expertise
I specialize in:
- Self-service account management
- Secure authentication and authorization
- Savings and loan operations
- Product discovery and enrollment
- Financial data presentation and reporting

## Commitment
I am committed to being more than just a service—I am a trusted financial partner that enables users to take control of their economic future with dignity and confidence.
86 changes: 86 additions & 0 deletions agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Self Service Plugin Agent Configuration
name: "Mifos Self Service Plugin Agent"
version: "1.15.0-SNAPSHOT"
description: "AI agent specialized in Mifos Self Service Plugin for Apache Fineract - providing self-service banking capabilities to end users"

# Core agent metadata
type: "domain-specific"
domain: "banking-fintech"
framework: "spring-ai-agent-skills"

# Agent identification
agent_id: "mifos-selfservice-plugin"
namespace: "org.apache.fineract.selfservice"

# Runtime configuration
runtime:
java_version: "21"
spring_boot_version: "3"
fineract_version: "1.15.0-SNAPSHOT"

# Security and permissions
security:
authentication_required: true
permissions:
- "READ_SAVINGSPRODUCT"
- "READ_LOANPRODUCT"
- "READ_SAVINGSACCOUNT"
- "READ_LOAN"
- "SELF_SERVICE_USER"

# API endpoints served
endpoints:
base_path: "/v1/self"
authentication: "/v1/self/authentication"
registration: "/v1/self/registration"
user_details: "/v1/self/userdetails"
savings: "/v1/self/savingsaccounts"
loans: "/v1/self/loans"
products:
savings: "/v1/self/savingsproducts"
loans: "/v1/self/loanproducts"
shares: "/v1/self/products/share"

# Integration points
integrations:
apache_fineract:
version: "1.15.0-SNAPSHOT"
modules:
- "fineract-provider"
- "fineract-core"
- "fineract-security"
- "fineract-client"
- "fineract-savings"
- "fineract-loan"
databases:
- "postgresql"
- "mysql"
security:
- "spring-security"
- "basic-auth"
- "oauth2"

# Agent capabilities
features:
- "user_registration"
- "authentication"
- "savings_account_management"
- "loan_account_management"
- "product_browsing"
- "survey_participation"
- "report_generation"
- "client_data_access"

# Development metadata
repository:
url: "https://github.com/openMF/selfservice-plugin"
license: "MPL-2.0"
organization: "Mifos Initiative"

# Build and deployment
build:
tool: "maven"
packaging: "jar"
deployment:
- "docker"
- "tomcat"
30 changes: 30 additions & 0 deletions llms.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Mifos Self Service Plugin

This repository contains the Spring Boot plugin for Apache Fineract that provides self-service banking capabilities to end users.

## Quick Start

This is a plugin that extends Apache Fineract with self-service features. Users can manage their accounts, view transactions, and perform banking operations independently.

## Documentation

- [AGENTS.md](./AGENTS.md) - Comprehensive development guide for AI agents and developers
- [skills.md](./skills.md) - Java/Spring Boot coding patterns and backend guidelines
- [README.md](./README.md) - Installation and usage instructions
- [TODO.md](./TODO.md) - Development roadmap and known issues

## Key Features

- Self-service user registration and authentication
- Savings and loan account management
- Product browsing and discovery
- Secure multi-tenant operations
- RESTful API endpoints

## Architecture

Built with Spring Boot 3 and Java 21, integrating seamlessly with Apache Fineract 1.15.0-SNAPSHOT.

## Getting Help

See [AGENTS.md](./AGENTS.md) for detailed development guidance and architectural information.
Loading