{"id":23916715,"url":"https://github.com/igornast/shop-crud","last_synced_at":"2026-05-16T04:47:54.764Z","repository":{"id":270724966,"uuid":"905359258","full_name":"igornast/shop-crud","owner":"igornast","description":"E-Commerce Backend with Symfony, API Platform, and JWT Authentication","archived":false,"fork":false,"pushed_at":"2025-01-12T11:03:50.000Z","size":316,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T11:29:38.125Z","etag":null,"topics":["api-platform","pestphp","php","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/igornast.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-18T17:01:14.000Z","updated_at":"2025-01-03T19:35:15.000Z","dependencies_parsed_at":"2025-01-02T17:41:53.758Z","dependency_job_id":"c2b90e53-485f-44b4-ae35-c6ced14fac7e","html_url":"https://github.com/igornast/shop-crud","commit_stats":null,"previous_names":["igornast/shop-crud"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igornast%2Fshop-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igornast%2Fshop-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igornast%2Fshop-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igornast%2Fshop-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igornast","download_url":"https://codeload.github.com/igornast/shop-crud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240371750,"owners_count":19790888,"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","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":["api-platform","pestphp","php","symfony"],"created_at":"2025-01-05T12:13:23.515Z","updated_at":"2026-05-16T04:47:54.690Z","avatar_url":"https://github.com/igornast.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shop-crud\n\n![PHPStan](https://img.shields.io/badge/PHPStan-Level%206-brightgreen)\n[![codecov](https://codecov.io/gh/igornast/shop-crud/graph/badge.svg?token=1HZCNIWEF4)](https://codecov.io/gh/igornast/shop-crud)\n\n---\n\n\u003e ## About This Project\n\u003e This repository was created as part of a recruitment process.\n\u003e The project is for demonstration purposes only and should not be used in a production environment.\n\n---\n## Setup ## \n\nFollow the steps below to set up the project:\n\n#### Build and Start Docker Containers ####\n\nBuild the `nginx` and `php` images from the provided Dockerfiles.\n\nStart the `nginx`, `php`, and `db` services.\n\n```shell\ndocker-compose up --build\n```\n\n#### Generate JWT Keys ####\n\n```shell\nmake jwt-keys\n```\n\n#### Database ####\n\nTo initialize or reset the database \n(drop, recreate, update schema, and load fixtures), use the following command:\n\n```shell\nmake db-reset\n```\nThis will:\n\n* Drop the existing database if it exists.\n* Create a new database.\n* Update the schema to match the current entities.\n* Load predefined data fixtures.\n\n### URLs\n\nThe following URLs are available in the system:\n\n- **API Documentation**:  \n  [http://localhost/api](http://localhost/api)  \n  Provides detailed API documentation, including available endpoints, request/response schemas, and authentication requirements.\n\n- **Login Endpoint**:  \n  [http://localhost/auth](http://localhost/auth)  \n  Use this endpoint to obtain a JWT token for authentication.  (Available int the API documentation)\n  Example request:\n  ```bash\n  curl -X 'POST' \\\n    'http://localhost/auth' \\\n    -H 'accept: application/json' \\\n    -H 'Content-Type: application/json' \\\n    -d '{\n    \"email\": \"admin@example.com\",\n    \"password\": \"password\"\n  }'\n\n## API Resources\n\n### Customers\n- **Base Path**: `/api/customers`\n- Manage customer-related data, including fetching, and updating, and deleting customer records.\n\n### Orders\n- **Base Path**: `/api/orders`\n- Handle order-related operations, such as creating orders, retrieving order details, updating, and deleting orders.\n\n### Products\n- **Base Path**: `/api/products`\n- Manage product information, including retrieving product details, updating, and deleting product records.\n\n## User Roles ##\nThe system supports two user roles:\n\n1. Admin User (`ROLE_ADMIN`):\n\n* Has access to all API resources and operations.\n* Can perform administrative tasks such as creating, updating, and deleting customers, products, and orders.\n\nRegular User (`ROLE_USER`):\n\n* Has limited access to API resources.\n* Can perform user-specific tasks like creating and viewing orders but cannot perform administrative operations.\n\n## Default Customer Accounts ## \nWhen loading fixtures, the system creates two default customer accounts:\n\n| Name           | Email               | Role         | Password  |\n|----------------|---------------------|--------------|-----------|\n| Admin User     | admin@example.com   | ROLE_ADMIN   | password  |\n| Regular User   | user@example.com    | ROLE_USER    | password  |\n\n- **Password for Both Accounts**: `password`\n- These accounts can be used for testing and development purposes.\n\n## API Documentation\n\nThe API documentation provides detailed information about all available endpoints, including:\n- HTTP methods\n- Request and response formats\n- Authentication and authorization requirements\n\nYou can access the API documentation at:\n\n[http://localhost/api](http://localhost/api)\n\n## **JWT Setup**\nThis project uses **JWT (JSON Web Tokens)** for authentication, \nmanaged by the LexikJWTAuthenticationBundle. T\no generate the required private and public keys for JWT, simply run the following command:\n\n```shell\nmake jwt-keys\n```\n\nThis command will generate the keys in the config/jwt directory and set the appropriate permissions automatically.\n\n## **Tests** ##\nTo run all tests (code style, static analysis, architecture, and PHPUnit), use the following Composer command:\n\n```shell\ncomposer test\n```\n\nThis command executes the following tasks:\n\n* **Code Style Check**: Ensures the codebase adheres to defined coding standards.\n* **Static Analysis**: Analyzes the code for potential bugs and type errors.\n* **Architecture Tests**: Validates architectural constraints.\n* **Unit Tests**: Runs PHPUnit for unit tests.\n* **Functional Tests**: Runs PHPUnit for functional tests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figornast%2Fshop-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figornast%2Fshop-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figornast%2Fshop-crud/lists"}