{"id":31593032,"url":"https://github.com/desbasito/bank-mvc","last_synced_at":"2026-05-07T05:39:39.081Z","repository":{"id":315642206,"uuid":"1054221944","full_name":"DesBasito/Bank-mvc","owner":"DesBasito","description":"Bank MVC is a comprehensive web-based banking card management system built with Spring Boot, implementing the Model-View-Controller (MVC) architecture pattern.","archived":false,"fork":false,"pushed_at":"2025-09-27T14:51:33.000Z","size":340,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-27T15:24:54.365Z","etag":null,"topics":["aes-encryption","aop-aspects","bcrypt","custom-annotation","freemarker","html-css-javascript","integration-testing","jpa-hibernate","liquibase","luhn-algorithm","maven","postgresql","scheduling","spring-boot","spring-data-audit","spring-mvc","spring-security","swagger","unit-testing","validation"],"latest_commit_sha":null,"homepage":"https://github.com/DesBasito/Bank-mvc","language":"FreeMarker","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DesBasito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-10T14:31:38.000Z","updated_at":"2025-09-27T15:04:07.000Z","dependencies_parsed_at":"2025-09-19T21:26:18.029Z","dependency_job_id":"a285ae65-44f9-4639-a14d-f4270a072550","html_url":"https://github.com/DesBasito/Bank-mvc","commit_stats":null,"previous_names":["desbasito/bank-mvc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DesBasito/Bank-mvc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesBasito%2FBank-mvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesBasito%2FBank-mvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesBasito%2FBank-mvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesBasito%2FBank-mvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DesBasito","download_url":"https://codeload.github.com/DesBasito/Bank-mvc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DesBasito%2FBank-mvc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278556226,"owners_count":26006079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-encryption","aop-aspects","bcrypt","custom-annotation","freemarker","html-css-javascript","integration-testing","jpa-hibernate","liquibase","luhn-algorithm","maven","postgresql","scheduling","spring-boot","spring-data-audit","spring-mvc","spring-security","swagger","unit-testing","validation"],"created_at":"2025-10-06T03:36:02.572Z","updated_at":"2025-10-06T03:36:43.332Z","avatar_url":"https://github.com/DesBasito.png","language":"FreeMarker","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bank MVC - Bank Card Management System\n\n## Overview\n\nBank MVC is a comprehensive web-based banking card management system built with Spring Boot, implementing the Model-View-Controller (MVC) architecture pattern. The application provides both traditional web interface using FreeMarker templates and RESTful API endpoints for managing bank cards, users, transactions, and card applications.\n\n## Target Audience\n\n### Primary Users\n- **Bank Employees** - Administrative staff who manage user accounts, approve/reject card applications, and oversee system operations\n- **Bank Customers** - End users who apply for cards, view their card details, check balances, and perform transfers\n- **System Administrators** - Technical staff responsible for system maintenance and user management\n\n### Secondary Users\n- **API Consumers** - Third-party applications or services that integrate with the banking system via REST APIs\n- **Developers** - Software developers who maintain, extend, or integrate with the system\n\n## System Purpose\n\nThe Bank MVC system serves multiple critical banking functions:\n\n### Core Banking Operations\n- **Card Lifecycle Management** - From application submission to card activation, blocking, and closure\n- **Financial Transactions** - Secure money transfers between cards with full audit trails\n- **User Account Management** - Complete user profile management with role-based access control\n- **Application Processing** - Streamlined workflow for card application approval/rejection\n\n### Administrative Functions\n- **User Administration** - Account activation/deactivation, role management, and user oversight\n- **Transaction Monitoring** - Real-time transaction tracking and status management\n- **System Security** - Secure authentication, data encryption, and access control\n\n## Technology Stack\n\n### Core Framework\n- **Spring Boot 3.2.0** - Primary application framework\n- **Java 17** - Programming language and runtime environment\n- **Maven** - Dependency management and build automation\n\n### Web \u0026 API Technologies\n- **Spring MVC** - Web framework for traditional web pages\n- **Spring REST** - RESTful API implementation\n- **FreeMarker** - Template engine for server-side rendering\n- **Vanilla JS** - Client-side scripting and dynamic interactions\n- **Bootstrap 5.3.0** - Frontend CSS framework\n- **Swagger/OpenAPI 3** - API documentation and testing interface\n\n### Data \u0026 Persistence\n- **Spring Data JPA** - Object-relational mapping and data access\n- **PostgreSQL** - Production database system\n- **H2 Database** - In-memory database for testing\n- **Liquibase** - Database version control and migration management\n\n### Security \u0026 Authentication\n- **Spring Security** - Authentication and authorization framework\n- **Basic Authentication** - API security mechanism\n- **BCrypt** - Password hashing algorithm\n- **Custom Encryption** - Card number encryption for data protection\n\n### Testing \u0026 Quality Assurance\n- **JUnit 5** - Unit testing framework\n- **Mockito** - Mocking framework for isolated testing\n- **Spring Boot Test** - Integration testing support\n- **TestContainers-compatible** - Database testing setup\n\n## Architecture \u0026 Design Patterns\n\n### MVC Architecture\n- **Model** - JPA entities (User, Card, Transaction, CardApplication)\n- **View** - FreeMarker templates with responsive Bootstrap UI\n- **Controller** - Separate web controllers and REST controllers\n\n### Key Design Patterns\n- **Repository Pattern** - Data access abstraction with Spring Data JPA\n- **Service Layer Pattern** - Business logic encapsulation\n- **DTO Pattern** - Data transfer objects for API responses\n- **Specification Pattern** - Dynamic query building with JPA Criteria API\n- **Builder Pattern** - Entity construction (using Lombok)\n\n### Security Implementation\n- **Role-Based Access Control (RBAC)** - USER and ADMIN roles\n- **Method-Level Security** - @PreAuthorize annotations\n- **Data Encryption** - Sensitive card information protection\n- **SQL Injection Prevention** - Parameterized queries via JPA\n\n## Algorithms \u0026 Methodologies\n\n### Card Number Generation\n- **Luhn Algorithm** - Card number validation\n- **Encryption Algorithm** - AES encryption for card number storage\n- **Random Generation** - Secure card number generation with validation\n\n### Transaction Processing\n- **Atomic Transactions** - Database ACID compliance\n- **Balance Validation** - Insufficient funds checking\n- **Idempotency** - Duplicate transaction prevention\n- **State Machine** - Transaction status management (PENDING → SUCCESS/FAILED)\n\n### Search \u0026 Filtering\n- **JPA Specifications** - Dynamic query building\n- **Pagination** - Performance optimization for large datasets\n- **Sorting** - Multi-criteria sorting implementation\n\n### Audit \u0026 Compliance\n- **Entity Auditing** - Automatic timestamp tracking\n- **Transaction Logging** - Complete audit trail\n- **Data Masking** - Sensitive information protection in logs\n\n## Project Structure\n\n```\nsrc/\n├── main/\n│   ├── java/kg/manurov/bankmvc/\n│   │   ├── config/          # Configuration classes\n│   │   ├── controllers/     # Web and REST controllers\n│   │   │   ├── rest/       # REST API endpoints\n│   │   │   └── web/        # MVC web controllers\n│   │   ├── dto/            # Data Transfer Objects\n│   │   ├── entities/       # JPA entity classes\n│   │   ├── enums/          # System enumerations\n│   │   ├── repositories/   # Data access layer\n│   │   ├── service/        # Business logic layer\n│   │   └── util/           # Utility classes\n│   └── resources/\n│       ├── db/migrations/  # Liquibase database migrations\n│       ├── templates/      # FreeMarker templates\n│       │   ├── admin/     # Admin interface templates\n│       │   ├── user/      # User interface templates\n│       │   └── layouts/   # Layout templates\n│       └── static/        # CSS, JS, images\n└── test/                  # Test classes and resources\n```\n\n## How to Execute\n\n### Prerequisites\n- **Java 17** or higher\n- **PostgreSQL 12+** database server\n- **Maven 3.6+** build tool\n- **Git** for version control\n\n### Environment Setup\n\n1. **Clone the Repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd Bank-mvc\n   ```\n\n2. **Database Setup**\n   ```bash\n   # Create PostgreSQL database\n   createdb bank_mvc_db\n   \n   # Create user (optional)\n   psql -c \"CREATE USER bank_user WITH PASSWORD 'your_password';\"\n   psql -c \"GRANT ALL PRIVILEGES ON DATABASE bank_mvc_db TO bank_user;\"\n   ```\n\n3. **Environment Configuration**\n\n   Create `.env.local` file in project root:\n   ```.env.local\n   # Database Configuration\n   DB_URL={your db url}\n   DB_USERNAME={username}\n   DB_PASSWORD={password}\n\n   # Encryption Configuration\n   ENCRYPTION_KEY={encryption key}\n\n   # Application Configuration\n   SERVER_PORT={your port}\n   APP_EXPIRY_DATE={expiry date for cards}\n   SERVER_CONTEXT_PATH={rest api path}\n\n   # Logging Configuration\n   LOG_LEVEL_ROOT={choose your LOG_LEVEL_ROOT}\n   LOG_LEVEL_APP={choose your LOG_LEVEL_APP}\n   LOG_FILE_PATH=logs{path for saving your logs}\n   ```\n\n### Build and Run\n\n#### Option 1: Maven Build\n```bash\n# Clean and build\nmvn clean compile\n\n# Run database migrations\n./run-liquibase.sh\n\n# Start application\nmvn spring-boot:run\n```\n\n#### Option 2: JAR Execution\n```bash\n# Build JAR file\nmvn clean package\n\n# Run application\njava -jar target/bankmvc-0.0.1-SNAPSHOT.jar\n```\n\n#### Option 3: IDE Execution\n- Import project into IntelliJ IDEA or Eclipse\n- Configure environment variables\n- Run `BankMvcApplication.main()` method\n\n### Testing\n\n```bash\n# Run all tests\nmvn test\n\n# Run specific test class\n#Unit tests:\nmvn test -Dtest=CardApplicationServiceTest\nmvn test -Dtest=UserServiceTest\n#Inegration tests:\nmvn test -Dtest=RestApplicationControllerTest\nmvn test -Dtest=ApplicationControllerTest\nmvn test -Dtest=ApplicationRepositoryTest\n\n```\n\n### Access Points\n\nAfter successful startup, access the application at:\n\n- **Web Interface**: `http://localhost:8080`\n- **API Documentation**: `http://localhost:8080/api/v1/swagger-ui.html`\n- **API Endpoints**: `http://localhost:8080/api/v1/*`\n\n### Default Login Credentials\n\n**Administrator:**\n- Phone: `+7(900)1234567`\n- Password: `qwe`\n\n**Regular User:**\n- Phone: `+7(900)1234568`\n- Password: `qwe`\n\n### Database Migration\n\n```bash\n# Run migrations manually\n./run-liquibase.sh\n\n# Rollback to previous version\nmvn liquibase:rollback -Dliquibase.rollbackCount=1\n```\n\n## API Documentation\n\nThe system provides comprehensive REST API documentation accessible via Swagger UI. Key endpoints include:\n\n- **Authentication**: Basic Auth required for all API calls\n- **Card Management**: `/api/v1/cards/*`\n- **User Management**: `/api/v1/users/*`\n- **Transactions**: `/api/v1/transactions/*`\n- **Applications**: `/api/v1/applications/*`\n\n## Development Notes\n\n### Code Style\n- All code comments and documentation in English\n- Lombok used for reducing boilerplate code\n- Service layer handles all business logic\n- Controllers act as thin layer between web/API and services\n\n### Security Considerations\n- Card numbers are encrypted in database\n- Passwords use BCrypt hashing\n- Role-based access control implemented\n- SQL injection prevention via JPA\n- Input validation on all endpoints\n\n### Performance Optimization\n- Database indexing on frequently queried fields\n- Pagination implemented for large datasets\n- Lazy loading for JPA relationships\n- Connection pooling configured\n\n## Contributing\n\n1. Follow existing code style and patterns\n2. Write unit tests for new functionality\n3. Update documentation for API changes\n4. Use English for all code comments and documentation\n5. Ensure database migrations are backwards compatible\n\n## Support\n\nFor technical issues or questions:\n- **Email**: out1of1mind1exception@gmail.com\n- **GitHub**: https://github.com/DesBasito\n- **Documentation**: Check Swagger UI for API details","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesbasito%2Fbank-mvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdesbasito%2Fbank-mvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesbasito%2Fbank-mvc/lists"}