{"id":16077912,"url":"https://github.com/don-phdev/aglipay-swe-jwt","last_synced_at":"2026-04-09T16:39:05.328Z","repository":{"id":65936548,"uuid":"602859279","full_name":"Don-PhDev/aglipay-swe-jwt","owner":"Don-PhDev","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-26T12:13:38.000Z","size":170,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T19:54:30.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/Don-PhDev.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":"2023-02-17T04:51:19.000Z","updated_at":"2023-02-17T04:55:15.000Z","dependencies_parsed_at":"2025-01-27T19:48:06.147Z","dependency_job_id":"de5b1a50-b7f2-4ff2-8683-9cae2b7b035d","html_url":"https://github.com/Don-PhDev/aglipay-swe-jwt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Faglipay-swe-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Faglipay-swe-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Faglipay-swe-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Don-PhDev%2Faglipay-swe-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Don-PhDev","download_url":"https://codeload.github.com/Don-PhDev/aglipay-swe-jwt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244991176,"owners_count":20543627,"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":[],"created_at":"2024-10-09T10:05:08.121Z","updated_at":"2026-04-09T16:39:05.278Z","avatar_url":"https://github.com/Don-PhDev.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails E-Commerce Application\n\nThis is a Ruby on Rails E-Commerce application with features for managing products, orders, users, and payments. It uses JWT for user authentication and has API endpoints for performing CRUD operations on products and purchasing products. Products are organized into categories and there is an active admin console for managing orders, products, categories, and users.\n\n## Requirements\n\nCreate an E-Commerce application with the option to manage products, orders, users, and payments.\n\n- Use JWT for user authentication\n- Create API endpoints to perform CRUD operations on products\n- Create endpoints to purchase a product\n- Products need to be divided into categories\n- Setup an active admin console for performing CRUD operations on orders, products, categories, and users\n- Use RSpec for writing unit tests\n\n## Installation\n\nClone this repository:\n```bash\ngit clone https://github.com/Don-PhDev/aglipay-swe-jwt.git\n```\n\nInstall the required gems:\n```bash\nbundle install\n```\n\nCreate the database and run the migrations:\n```bash\nrails db:create\nrails db:migrate\n```\n\nSeed the database with initial data:\n```bash\nrails db:seed\n```\n\nStart the server:\n```bash\nrails server\n```\n\n## Running Tests\n\nTo run tests, run the following command:\n\n```bash\nrspec\n```\n\n## Usage/Examples\n\n### Register a User\nTo register a new user, send a `POST` request to `/api/v1/users` with the following parameters:\n\n- `email`\n- `password`\n- `password_confirmation`\n\nUsing Postman or your favourite software testing API platform\n\n```perl\n{\n  \"user\": {\n    \"email\": \"example@example.com\",\n    \"password\": \"password\",\n    \"password_confirmation\": \"password\"\n  }\n}\n```\n\nor you can use cURL command like this:\n\n```bash\ncurl -H \"Content-Type: application/json\" -X POST -d '{\"user\": {\"email\": \"example@example.com\", \"password\": \"password\", \"password_confirmation\": \"password\"}}' http://localhost:3000/users\n```\n\n### Login a User\nTo log in a user, send a `POST` request to `/api/v1/login` with the following parameters:\n- `email`\n- `password`\n\n```perl\n{\n  \"user\": {\n    \"email\": \"example@example.com\",\n    \"password\": \"password\"\n  }\n}\n```\n\n```bash\ncurl -i -H \"Content-Type: application/json\" -X POST -d '{\"user\": {\"email\": \"example@example.com\", \"password\": \"password\"}}' http://localhost:3000/users/sign_in\n```\n\nThis will return a JWT token that should be included in the headers of subsequent requests.\n\n### Logout a User\nTo log out a user, send a `DELETE` request to `/api/v1/logout`.\n\n```bash\ncurl -H \"Content-Type: application/json\" -X DELETE -d '' -H 'Authorization: \u003cAUTH_TOKEN\u003e' http://localhost:3000/users/sign_out\n```\n\n**Note**: Replace `\u003cAUTH_TOKEN\u003e` with the user's authentication token.\n\n### Check If Logged In\nTo check if a user is logged in, send a `GET` request to `/users/member-data` with the user's authentication token in the Authorization header:\n\n```bash\ncurl -H \"Content-Type: application/json\" -H 'Authorization: \u003cAUTH_TOKEN\u003e' http://localhost:3000/users/member-data\n```\n\n**Note**: Replace `\u003cAUTH_TOKEN\u003e` with the user's authentication token.\n\n***\n\n### Create a Product\nSend a `POST` request to `/api/v1/products` with the following parameters:\n\n- `name`\n- `price`\n- `category_id`\n\nInclude the JWT token in the headers of the request.\n\n### Update a Product\nSend a `PUT` request to `/api/v1/products/:id` with the following parameters:\n\n- `name`\n- `price`\n- `category_id`\n\nInclude the JWT token in the headers of the request.\n\n### Delete a Product\nSend a `DELETE` request to `/api/v1/products/:id`.\n\nInclude the JWT token in the headers of the request.\n\n### Purchase a Product\nSend a `POST` request to `/api/v1/orders` with the following parameters:\n\n- `product_id`\n- `quantity`\nInclude the JWT token in the headers of the request.\n\n***\n\n### Admin Console\nTo access the admin console, go to `/admin`.\n\n## License\n\nThis Ruby on Rails E-commerce application is available as open source under the terms of the [MIT](https://github.com/Don-PhDev/aglipay-swe-jwt/blob/master/LICENSE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon-phdev%2Faglipay-swe-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdon-phdev%2Faglipay-swe-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdon-phdev%2Faglipay-swe-jwt/lists"}