{"id":48774806,"url":"https://github.com/rangegowdaym/sr-trading","last_synced_at":"2026-04-13T12:04:18.843Z","repository":{"id":323051681,"uuid":"1091939937","full_name":"rangegowdaym/sr-trading","owner":"rangegowdaym","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-07T19:16:43.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-07T21:07:08.777Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/rangegowdaym.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-11-07T18:42:22.000Z","updated_at":"2025-11-07T19:16:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rangegowdaym/sr-trading","commit_stats":null,"previous_names":["rangegowdaym/sr-trading"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/rangegowdaym/sr-trading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangegowdaym%2Fsr-trading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangegowdaym%2Fsr-trading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangegowdaym%2Fsr-trading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangegowdaym%2Fsr-trading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rangegowdaym","download_url":"https://codeload.github.com/rangegowdaym/sr-trading/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rangegowdaym%2Fsr-trading/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-13T12:04:16.657Z","updated_at":"2026-04-13T12:04:18.836Z","avatar_url":"https://github.com/rangegowdaym.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SR Trading Management System\n\nA comprehensive Desktop and Web UI-based Trading Management System built using Java Spring Boot, MySQL, HTML, CSS, and AngularJS.\n\n## Features\n\n### Purchase Management\n- Add/Update purchase records with date, shop, item, bags, amount, and discount\n- Search purchases by date range and shop name\n- Display total bags and total amount\n- Edit and delete purchase records\n\n### Sales Management\n- Add/Update sales records with date, item, customer, bags, and amount\n- Search sales by date range and customer name\n- Automatic customer balance update when sales are added\n- Display total bags and total amount\n- Edit and delete sales records\n\n### Payment Management\n- View all customer balances in real-time\n- Make payments against customer balances\n- Automatic balance deduction when payment is made\n- Add payment notes for record-keeping\n- View payment history\n- Delete payment records\n\n### Master Data Management\n- Add, list, and delete Items\n- Add, list, and delete Shops with address and contact information\n- Add, list, and delete Customers with address and contact information\n- View customer balance information\n\n## Technology Stack\n\n### Backend\n- **Java 11**\n- **Spring Boot 2.7.14**\n- **Spring Data JPA**\n- **MySQL 8**\n- **Maven**\n\n### Frontend\n- **HTML5**\n- **CSS3**\n- **AngularJS 1.8.2**\n\n### Database\n- **MySQL 8.0**\n\n## Project Structure\n\n```\nsr-trading/\n├── src/\n│   ├── main/\n│   │   ├── java/com/trading/srtrading/\n│   │   │   ├── controller/          # REST Controllers\n│   │   │   │   ├── CustomerController.java\n│   │   │   │   ├── ItemController.java\n│   │   │   │   ├── PaymentController.java\n│   │   │   │   ├── PurchaseController.java\n│   │   │   │   ├── SalesController.java\n│   │   │   │   └── ShopController.java\n│   │   │   ├── entity/              # JPA Entities\n│   │   │   │   ├── Customer.java\n│   │   │   │   ├── Item.java\n│   │   │   │   ├── Payment.java\n│   │   │   │   ├── Purchase.java\n│   │   │   │   ├── Sales.java\n│   │   │   │   └── Shop.java\n│   │   │   ├── repository/          # JPA Repositories\n│   │   │   │   ├── CustomerRepository.java\n│   │   │   │   ├── ItemRepository.java\n│   │   │   │   ├── PaymentRepository.java\n│   │   │   │   ├── PurchaseRepository.java\n│   │   │   │   ├── SalesRepository.java\n│   │   │   │   └── ShopRepository.java\n│   │   │   ├── service/             # Business Logic Services\n│   │   │   │   ├── CustomerService.java\n│   │   │   │   ├── ItemService.java\n│   │   │   │   ├── PaymentService.java\n│   │   │   │   ├── PurchaseService.java\n│   │   │   │   ├── SalesService.java\n│   │   │   │   └── ShopService.java\n│   │   │   └── SrTradingApplication.java  # Main Application\n│   │   └── resources/\n│   │       ├── static/              # Frontend Files\n│   │       │   ├── css/\n│   │       │   │   └── styles.css\n│   │       │   ├── js/\n│   │       │   │   └── app.js\n│   │       │   └── index.html\n│   │       ├── application.properties\n│   │       └── schema.sql\n│   └── test/\n├── pom.xml\n└── README.md\n```\n\n## Prerequisites\n\nBefore running this application, ensure you have the following installed:\n\n1. **Java Development Kit (JDK) 11 or higher**\n   - Download from: https://adoptium.net/\n\n2. **Apache Maven 3.6+**\n   - Download from: https://maven.apache.org/download.cgi\n\n3. **MySQL 8.0+**\n   - Download from: https://dev.mysql.com/downloads/mysql/\n\n4. **Git** (for cloning the repository)\n   - Download from: https://git-scm.com/downloads\n\n## Installation and Setup\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/rangegowdaym/sr-trading.git\ncd sr-trading\n```\n\n### 2. Setup MySQL Database\n\n1. Start MySQL server\n2. Login to MySQL:\n   ```bash\n   mysql -u root -p\n   ```\n\n3. Create the database:\n   ```sql\n   CREATE DATABASE sr_trading;\n   ```\n\n4. (Optional) Create a dedicated user:\n   ```sql\n   CREATE USER 'trading_user'@'localhost' IDENTIFIED BY 'trading_password';\n   GRANT ALL PRIVILEGES ON sr_trading.* TO 'trading_user'@'localhost';\n   FLUSH PRIVILEGES;\n   ```\n\n### 3. Configure Database Connection\n\nEdit `src/main/resources/application.properties` if needed:\n\n```properties\nspring.datasource.url=jdbc:mysql://localhost:3306/sr_trading?createDatabaseIfNotExist=true\u0026useSSL=false\u0026allowPublicKeyRetrieval=true\u0026serverTimezone=UTC\nspring.datasource.username=root\nspring.datasource.password=root\n```\n\n**Note:** Update the username and password to match your MySQL credentials.\n\n### 4. Build the Application\n\n```bash\nmvn clean install\n```\n\n### 5. Run the Application\n\n```bash\nmvn spring-boot:run\n```\n\nAlternatively, you can run the JAR file:\n\n```bash\njava -jar target/sr-trading-1.0.0.jar\n```\n\n### 6. Access the Application\n\nOnce the application starts successfully:\n\n- **Backend API**: http://localhost:8080/api\n- **Frontend UI**: http://localhost:8080/index.html\n\n## API Endpoints\n\n### Items\n- `GET /api/items` - Get all items\n- `GET /api/items/{id}` - Get item by ID\n- `POST /api/items` - Create new item\n- `PUT /api/items/{id}` - Update item\n- `DELETE /api/items/{id}` - Delete item\n\n### Shops\n- `GET /api/shops` - Get all shops\n- `GET /api/shops/{id}` - Get shop by ID\n- `POST /api/shops` - Create new shop\n- `PUT /api/shops/{id}` - Update shop\n- `DELETE /api/shops/{id}` - Delete shop\n\n### Customers\n- `GET /api/customers` - Get all customers\n- `GET /api/customers/{id}` - Get customer by ID\n- `POST /api/customers` - Create new customer\n- `PUT /api/customers/{id}` - Update customer\n- `DELETE /api/customers/{id}` - Delete customer\n\n### Purchases\n- `GET /api/purchases` - Get all purchases\n- `GET /api/purchases/{id}` - Get purchase by ID\n- `GET /api/purchases/search?startDate={date}\u0026endDate={date}\u0026shopId={id}` - Search purchases\n- `POST /api/purchases` - Create new purchase\n- `PUT /api/purchases/{id}` - Update purchase\n- `DELETE /api/purchases/{id}` - Delete purchase\n\n### Sales\n- `GET /api/sales` - Get all sales\n- `GET /api/sales/{id}` - Get sales by ID\n- `GET /api/sales/search?startDate={date}\u0026endDate={date}\u0026customerId={id}` - Search sales\n- `POST /api/sales` - Create new sales (automatically updates customer balance)\n- `PUT /api/sales/{id}` - Update sales\n- `DELETE /api/sales/{id}` - Delete sales\n\n### Payments\n- `GET /api/payments` - Get all payments\n- `GET /api/payments/{id}` - Get payment by ID\n- `GET /api/payments/customer/{customerId}` - Get payments by customer\n- `POST /api/payments` - Create new payment (automatically deducts from customer balance)\n- `PUT /api/payments/{id}` - Update payment\n- `DELETE /api/payments/{id}` - Delete payment\n\n## Usage Guide\n\n### First-Time Setup\n\n1. **Add Master Data First**: Navigate to the \"Master Data\" tab and add:\n   - Items (e.g., Rice, Wheat, Sugar)\n   - Shops (with addresses and contact information)\n   - Customers (with addresses and contact information)\n\n2. **Record Purchases**: Go to the \"Purchase\" tab to record:\n   - Purchase date\n   - Shop name\n   - Items purchased\n   - Number of bags\n   - Amount and discount\n\n3. **Record Sales**: Go to the \"Sales\" tab to record:\n   - Sales date\n   - Item sold\n   - Customer name\n   - Number of bags\n   - Amount (automatically updates customer balance)\n\n4. **Manage Payments**: Go to the \"Payment\" tab to:\n   - View all customer balances\n   - Record payments made by customers\n   - View payment history\n\n## Key Features\n\n### Transaction Management\n- All sales and payment operations are transactional\n- Customer balance automatically updates when:\n  - New sales are added (balance increases)\n  - Payments are made (balance decreases)\n  - Sales or payments are deleted (balance is adjusted accordingly)\n\n### Search and Reporting\n- Date range filtering for purchases and sales\n- Filter by shop name for purchases\n- Filter by customer name for sales\n- Automatic calculation of totals (bags and amounts)\n\n### Data Validation\n- All forms have required field validation\n- Proper foreign key constraints in the database\n- Error handling for all operations\n\n## Troubleshooting\n\n### Application won't start\n- Verify MySQL is running\n- Check database credentials in `application.properties`\n- Ensure port 8080 is not in use\n\n### Database connection errors\n- Verify MySQL service is running\n- Check if the database `sr_trading` exists\n- Verify username and password in `application.properties`\n\n### Frontend not loading\n- Clear browser cache\n- Check browser console for JavaScript errors\n- Verify the backend is running on port 8080\n\n### CORS errors\n- The application is configured to accept requests from all origins\n- If issues persist, check browser console and network tab\n\n## Development\n\n### Running in Development Mode\n\n```bash\nmvn spring-boot:run -Dspring-boot.run.profiles=dev\n```\n\n### Building for Production\n\n```bash\nmvn clean package -DskipTests\n```\n\n## Database Schema\n\nThe application creates the following tables:\n- `item` - Stores item information\n- `shop` - Stores shop information\n- `customer` - Stores customer information with balance\n- `purchase` - Stores purchase records\n- `sales` - Stores sales records\n- `payment` - Stores payment records\n\nAll tables have proper foreign key relationships and indexes for optimal performance.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Support\n\nFor issues and questions, please create an issue in the GitHub repository.\n\n## Author\n\nSR Trading Management System Development Team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frangegowdaym%2Fsr-trading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frangegowdaym%2Fsr-trading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frangegowdaym%2Fsr-trading/lists"}