{"id":23980732,"url":"https://github.com/aftermath22/ecom","last_synced_at":"2026-04-15T05:32:15.417Z","repository":{"id":270196867,"uuid":"909611198","full_name":"aftermath22/Ecom","owner":"aftermath22","description":"Ecom is a Spring Boot-based e-commerce application offering user authentication, role-based access, product management, a shopping cart, and admin controls. Built with Java 17, Spring Security, and Hibernate, it ensures secure and efficient operations. Its intuitive setup and robust features make it ideal for scalable e-commerce solutions.","archived":false,"fork":false,"pushed_at":"2024-12-29T09:44:51.000Z","size":469,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T22:33:01.051Z","etag":null,"topics":["backend","bcrypt","controllers","dao-design-pattern","ecom","ecommerce","hibernate-jpa","jpa","jparepository","jsp-servlet","mysql","owasp-top-10","repository-pattern","spring","spring-boot","spring-security"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aftermath22.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-12-29T08:44:28.000Z","updated_at":"2024-12-29T19:13:03.000Z","dependencies_parsed_at":"2024-12-29T09:25:15.894Z","dependency_job_id":"efbd36a9-b6aa-4e3a-ab01-a5dd5d5eac56","html_url":"https://github.com/aftermath22/Ecom","commit_stats":null,"previous_names":["aftermath22/ecom"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aftermath22/Ecom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aftermath22%2FEcom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aftermath22%2FEcom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aftermath22%2FEcom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aftermath22%2FEcom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aftermath22","download_url":"https://codeload.github.com/aftermath22/Ecom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aftermath22%2FEcom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"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":["backend","bcrypt","controllers","dao-design-pattern","ecom","ecommerce","hibernate-jpa","jpa","jparepository","jsp-servlet","mysql","owasp-top-10","repository-pattern","spring","spring-boot","spring-security"],"created_at":"2025-01-07T10:18:18.480Z","updated_at":"2026-04-15T05:32:15.392Z","avatar_url":"https://github.com/aftermath22.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ecom - Spring Boot E-Commerce Application\n\n## Overview\nEcom is a fully-featured e-commerce web application built using Spring Boot. It implements core e-commerce functionalities including user authentication, product management, shopping cart operations, and admin controls with role-based access. \\\n*ps : I have not made the front-end that appealing :') , but its fully functional ;)*\n\n## Features\n\n### User Management\n- User registration and authentication\n- Role-based access control (ADMIN and USER roles)\n- User profile management\n- User blacklisting system\n\n### Product Management\n- Product listing and details\n- Product availability status\n- Product CRUD operations (Admin only)\n- Product search and filtering\n\n### Shopping Cart\n- Add/remove items to cart\n- Update item quantities\n- View cart contents\n- Cart persistence across sessions\n\n### Admin Features\n- User management (view, ban/unban users)\n- Product inventory management\n- Access to blacklisted users\n- Admin profile management\n\n## Technology Stack\n\n### Backend\n- Java 17\n- Spring Boot\n- Spring Security\n- Spring Data JPA\n- Hibernate\n- BCrypt Password Encryption\n\n### Database\n- JPA/Hibernate for ORM\n- Compatible with any JPA-supported database (MySQL, PostgreSQL, etc.)\n\n### Frontend\n- JSP (JavaServer Pages)\n- HTML/CSS\n- Bootstrap (assumed based on the structure)\n\n## Project Structure\n\n```\n+---src\n¦   +---main\n¦   ¦   +---java\n¦   ¦   ¦   +---org\n¦   ¦   ¦       +---keval\n¦   ¦   ¦           +---ecom\n¦   ¦   ¦               ¦   EcomApplication.java\n¦   ¦   ¦               ¦   \n¦   ¦   ¦               +---config\n¦   ¦   ¦               ¦       SecurityConfig.java\n¦   ¦   ¦               ¦       \n¦   ¦   ¦               +---controller\n¦   ¦   ¦               ¦       AdminController.java\n¦   ¦   ¦               ¦       AuthController.java\n¦   ¦   ¦               ¦       CustomerController.java\n¦   ¦   ¦               ¦       ItemController.java\n¦   ¦   ¦               ¦       \n¦   ¦   ¦               +---model\n¦   ¦   ¦               ¦       Blacklist.java\n¦   ¦   ¦               ¦       Cart.java\n¦   ¦   ¦               ¦       Customer.java\n¦   ¦   ¦               ¦       CustomerPrincipal.java\n¦   ¦   ¦               ¦       Items.java\n¦   ¦   ¦               ¦       Role.java\n¦   ¦   ¦               ¦       \n¦   ¦   ¦               +---repo\n¦   ¦   ¦               ¦       BlacklistRepo.java\n¦   ¦   ¦               ¦       CartRepo.java\n¦   ¦   ¦               ¦       CustomerRepo.java\n¦   ¦   ¦               ¦       ItemRepo.java\n¦   ¦   ¦               ¦       \n¦   ¦   ¦               +---service\n¦   ¦   ¦                       BlacklistService.java\n¦   ¦   ¦                       CartService.java\n¦   ¦   ¦                       CustomerService.java\n¦   ¦   ¦                       ItemService.java\n¦   ¦   ¦                       \n¦   ¦   +---resources\n¦   ¦   ¦   ¦   application.properties\n¦   ¦   ¦   ¦   \n¦   ¦   ¦   +---static\n¦   ¦   ¦   ¦       ecom.jpg\n¦   ¦   ¦   ¦       \n¦   ¦   ¦   +---templates\n¦   ¦   +---webapp\n¦   ¦       +---META-INF\n¦   ¦           +---jsp\n¦   ¦                   addItems.jsp\n¦   ¦                   AdminPortal.jsp\n¦   ¦                   Blacklist.jsp\n¦   ¦                   EditAdmin.jsp\n¦   ¦                   EditUser.jsp\n¦   ¦                   error.jsp\n¦   ¦                   home.jsp\n¦   ¦                   ItemEditor.jsp\n¦   ¦                   login.jsp\n¦   ¦                   ManageItems.jsp\n¦   ¦                   register.jsp\n¦   ¦                   UserList.jsp\n¦   ¦                   UserPortal.jsp\n¦   ¦                   ViewCart.jsp\n¦   ¦                   ViewItems.jsp\n¦   ¦                   \n¦   +---test\n¦       +---java\n¦           +---org\n¦               +---keval\n¦                   +---ecom\n¦                           EcomApplicationTests.java\n¦                           \n+---target\n    +---classes\n    ¦   ¦   application.properties\n    ¦   ¦   \n    ¦   +---org\n    ¦   ¦   +---keval\n    ¦   ¦       +---ecom\n    ¦   ¦           ¦   EcomApplication.class\n    ¦   ¦           ¦   \n    ¦   ¦           +---config\n    ¦   ¦           ¦       SecurityConfig.class\n    ¦   ¦           ¦       \n    ¦   ¦           +---controller\n    ¦   ¦           ¦       AdminController.class\n    ¦   ¦           ¦       AuthController.class\n    ¦   ¦           ¦       CustomerController.class\n    ¦   ¦           ¦       ItemController.class\n    ¦   ¦           ¦       \n    ¦   ¦           +---model\n    ¦   ¦           ¦       Blacklist.class\n    ¦   ¦           ¦       Cart.class\n    ¦   ¦           ¦       Customer.class\n    ¦   ¦           ¦       CustomerPrincipal.class\n    ¦   ¦           ¦       Items.class\n    ¦   ¦           ¦       Role.class\n    ¦   ¦           ¦       \n    ¦   ¦           +---repo\n    ¦   ¦           ¦       BlacklistRepo.class\n    ¦   ¦           ¦       CartRepo.class\n    ¦   ¦           ¦       CustomerRepo.class\n    ¦   ¦           ¦       ItemRepo.class\n    ¦   ¦           ¦       \n    ¦   ¦           +---service\n    ¦   ¦                   BlacklistService.class\n    ¦   ¦                   CartService.class\n    ¦   ¦                   CustomerService.class\n    ¦   ¦                   ItemService.class\n    ¦   ¦                   \n    ¦   +---static\n    ¦           ecom.jpg\n    ¦           \n\n\n```\n\n## Setup and Installation\n\n### Prerequisites\n1. Java 17 or higher\n2. Maven\n3. Your preferred IDE (IntelliJ IDEA recommended)\n4. MySQL or any other compatible database\n\n### Steps to Run\n\n1. Clone the repository:\n```bash\ngit clone [repository-url]\ncd ecom\n```\n\n2. Configure database connection in `application.properties`:\n```properties\nspring.datasource.url=jdbc:mysql://localhost:3306/ecom_db\nspring.datasource.username=your_username\nspring.datasource.password=your_password\nspring.jpa.hibernate.ddl-auto=update\n```\n\n3. Create the database:\n```sql\nCREATE DATABASE ecom_db;\n```\n\n4. Build the project:\n```bash\nmvn clean install\n```\n\n5. Run the application:\n```bash\nmvn spring-boot:run\n```\n\nThe application will be available at `http://localhost:8080`\n\n## Initial Setup\n\n### Creating an Admin User\nYou can create an admin user by directly inserting into the database:\n\n```sql\nINSERT INTO customer (name, email, password, role)\nVALUES ('Admin', 'admin@ecom.com', '[bcrypt-encoded-password]', 'ROLE_ADMIN');\n```\n\nNote: Use BCryptPasswordEncoder to generate the password hash.\n\n## Usage\n\n### User Functions\n1. Register a new account\n2. Login with credentials\n3. Browse products\n4. Add products to cart\n5. Manage cart\n6. Update profile\n\n### Admin Functions\n1. Login with admin credentials\n2. Manage products (add/edit/delete)\n3. View all users\n4. Ban/unban users\n5. View blacklisted users\n6. Edit admin profile\n\n## Security Features\n\n- Session management\n- CSRF protection (disabled for this implementation)\n- Password encryption using BCrypt\n- Role-based access control\n- Blacklist system for banned users\n\n## API Endpoints\n\n### Authentication\n- GET `/login` - Login page\n- POST `/auth` - Authentication endpoint\n- GET `/logout` - Logout\n- POST `/register` - User registration\n- GET `/register` - Registration page\n\n### User Operations\n- GET `/user/portal` - User dashboard\n- GET `/user/cart` - View cart\n- POST `/user/buyItem` - Add to cart\n- POST `/user/adds` - Update cart quantity\n- POST `/user/remove` - Remove from cart\n- GET `/user/edit` - Edit profile page\n- POST `/user/edit` - Update profile\n\n### Admin Operations\n- GET `/admin/portal` - Admin dashboard\n- POST `/admin/addItem` - Add new product\n- GET `/admin/users` - View all users\n- GET `/admin/ban` - Ban user\n- GET `/admin/unban` - Unban user\n- GET `/admin/blacklist` - View blacklisted users\n- GET `/admin/manage` - Manage products\n- GET `/admin/editItem` - Edit product page\n- POST `/admin/editIt` - Update product\n- GET `/admin/deleteItem` - Delete product\n\n## Contributing\nPlease follow these steps for contributing:\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n[MIT License](https://github.com/aftermath22/Ecom?tab=MIT-1-ov-file#)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faftermath22%2Fecom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faftermath22%2Fecom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faftermath22%2Fecom/lists"}