{"id":15597954,"url":"https://github.com/nalbion/appert-shopping","last_synced_at":"2025-04-03T07:44:56.299Z","repository":{"id":163576665,"uuid":"639051973","full_name":"nalbion/appert-shopping","owner":"nalbion","description":"Shopping Cart API","archived":false,"fork":false,"pushed_at":"2023-05-11T01:37:28.000Z","size":198,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T21:29:22.619Z","etag":null,"topics":["dev-challenge"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nalbion.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}},"created_at":"2023-05-10T16:50:52.000Z","updated_at":"2023-05-15T23:28:54.000Z","dependencies_parsed_at":"2023-05-26T00:00:39.806Z","dependency_job_id":null,"html_url":"https://github.com/nalbion/appert-shopping","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"7d6a393735daf2ac566dc852d613f1cacd21e86b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalbion%2Fappert-shopping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalbion%2Fappert-shopping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalbion%2Fappert-shopping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nalbion%2Fappert-shopping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nalbion","download_url":"https://codeload.github.com/nalbion/appert-shopping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246961923,"owners_count":20861177,"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":["dev-challenge"],"created_at":"2024-10-03T01:24:45.681Z","updated_at":"2025-04-03T07:44:56.269Z","avatar_url":"https://github.com/nalbion.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# appert-shopping\n[![Coverage Status](https://img.shields.io/coveralls/github/nalbion/appert-shopping/master.svg)](https://coveralls.io/r/nalbion/appert-shopping?branch=master)\n\n- Test the API at [https://appert-shopping.herokuapp.com/swagger](https://appert-shopping.herokuapp.com/swagger)\n- Each user is automatically assigned a `cartId` cookie which is used in subsequent requests.\n- The shopping cart API supports promotions which can be externally configured.\n Various instances of `freebie` etc can be configured, and new promotion types can be added without modifications to the `PromotionsService` code.\n\n## TODO\n- authorisation - users should be able to (optionally) log in and access the cart they were using anonymously or from a different device.\n- checkout \u0026 payment\n- load/persist to DB, database migration schemas\n- atomic DB transactions on take/return item from inventory\n- CI/CD pipeline (most supporting scripts are provided)\n- Monitor [http://localhost:9020/api/health](http://localhost:9020/api/health) \u0026 update to ping DB. If the optional query string `?version=0.0.1` does not match the build version a HTTP status `409` is returned.\n\n## Usage\n\n```bash\ndocker build -t nalbion/appert-shopping .\ndocker run --rm -p 9020:9020 nalbion/appert-shopping\n```\n\nAlternatively, use the npm scripts:\n\n```bash\nnpm run docker:build\nnpm run docker:run\n```\n\nWhen running, API documentation is available at [http://localhost:9020/swagger](http://localhost:9020/swagger). Example requests are provided in the \"Try it out\" sections.\n\nThe schema `appert-shopping-api.yml` is generated by `npm run generate-schema` and is also available at [http://localhost:9020/swagger/spec](http://localhost:9020/swagger/spec).\n\n### Development\n\n```bash\nnpm install\nnpm run test:tdd\n```\n\nor\n\n```bash\nnpm run start:dev\n```\n\nIntelliJ users can execute requests from `shopping-cart.http`\n\n\n## CI/CD\nScripts to run in CI/CD are provided in `ci/scripts`\n\n___\n## **Folder Structure**\n\n- **src/api**: routes and controllers for api endpoints\n- **src/models**: definitions of data structure\n- **src/service**: contains business logic that may be shared amongst routes\n\n___\n## **Getting Started**\n\n- Need a database? Consider [Prisma](https://www.prisma.io/)\n\n### Prerequisites\n\n- NPM 6\n- [Typescript](https://www.typescriptlang.org/)\n\n\n### Running on localhost\n\nCreate an environment (**.env**) file by copying the (**.env.example**) and replacing empty variables.\n\n___\n## **Testing**\n### Lint\n    $ npm run lint\n    $ npm run format\n\nor, do it all together as the pre-commit hook does:\n\n    $ npm run format:lint:fix\n\n### Unit Tests\n    $ npm test\n\n### Coverage Report\n    $ npm run coverage\n\n___\n## Technology\n- [Typescript](https://www.typescriptlang.org) - Typescript transpiler\n- [Swagger](https://swagger.io/) - API Specification (Version 3)\n- [Mocha](https://github.com/mochajs/mocha) - Unit testing framework\n- [Chai](https://github.com/chaijs/chai) - Unit testing assertions\n- [Istanbul](https://istanbul.js.org) - Code coverage\n- [ChanceJS](https://chancejs.com/) - Values random generator for unit testing\n- [Open API Generator](https://github.com/OpenAPITools/openapi-generator) - Swagger code generation\n- [Helmet](https://github.com/helmetjs/helmet) - Security headers\n\n___\n## Best Practices and Coding Patterns\n- [Clean Code](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnalbion%2Fappert-shopping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnalbion%2Fappert-shopping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnalbion%2Fappert-shopping/lists"}