{"id":13580207,"url":"https://github.com/International-Slackline-Association/Rankings-Backend","last_synced_at":"2025-04-06T02:31:16.703Z","repository":{"id":40244616,"uuid":"136613768","full_name":"International-Slackline-Association/Rankings-Backend","owner":"International-Slackline-Association","description":"Server-side client of ISA Rankings (Serverless, NestJS, DynamoDB)","archived":false,"fork":false,"pushed_at":"2024-01-10T14:41:13.000Z","size":3687,"stargazers_count":178,"open_issues_count":2,"forks_count":34,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-05T19:41:47.973Z","etag":null,"topics":["aws-dynamodb","dynamodb","nestjs","serverless","serverless-framework","serverless-offline","typeorm"],"latest_commit_sha":null,"homepage":"https://www.isa-rankings.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/International-Slackline-Association.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":"2018-06-08T12:05:21.000Z","updated_at":"2024-10-09T12:50:20.000Z","dependencies_parsed_at":"2024-08-01T15:31:51.206Z","dependency_job_id":"3636d2a2-4812-482b-9ec1-0d55051a5a66","html_url":"https://github.com/International-Slackline-Association/Rankings-Backend","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/International-Slackline-Association%2FRankings-Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/International-Slackline-Association%2FRankings-Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/International-Slackline-Association%2FRankings-Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/International-Slackline-Association%2FRankings-Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/International-Slackline-Association","download_url":"https://codeload.github.com/International-Slackline-Association/Rankings-Backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247425878,"owners_count":20937032,"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":["aws-dynamodb","dynamodb","nestjs","serverless","serverless-framework","serverless-offline","typeorm"],"created_at":"2024-08-01T15:01:48.670Z","updated_at":"2025-04-06T02:31:14.737Z","avatar_url":"https://github.com/International-Slackline-Association.png","language":"TypeScript","funding_links":[],"categories":["Resources","TypeScript","资源"],"sub_categories":[],"readme":"# Rankings-Backend\n\nServer-side client of [isa-rankings.org]\n\n**Technical Overview:**\n\n- The server-side is entirely designed to be `serverless` on AWS.\n- Requires knowledge on followings\n  - [Webpack]\n  - [NestJS]\n  - Typescript\n  - [Serverless Framework] (with [Serverless-Offline] plugin)\n  - AWS DynamoDB (main database)\n  - AWS DynamoDB Streams\n  - AWS Api Gateway\n  - AWS Lambda\n  - AWS CloudFormation (infrastructure as a code)\n  - AWS IAM Management (user, roles, policies)\n  - Redis (read through cache)\n\n---\n\n### Why `serverless`?\n\n- **Pay as you go:** You only pay for the resources you actively use, not when they are sitting idle. Perfect for low|inconsistent traffic applications.\n- **Costs:** Extremely **cheap** . This application costs less than 1 dolar/month.\n- **Maintenance \u0026 Operation:** You never manage infrastructure or any problem that comes with it. Only write the code and it works. Since its a volunteered project nobody wants to do anything but writing the application code\n\n---\n\n## Architecture Overview\n\n![Architecture]\n\n---\n\n## DynamoDB - (Database Design)\n\n**DynamoDB is designed in such a way (primary keys and sort keys) so that it supports all the query patterns this application needs. It has only a single table with aggregated GSIs, hierarchical SKs.**\n\nIn short, it is customized for application's access patterns.\n\n**_Overview of the table:_**\n\n### Main Table\n\n| PK           | SK_GSI                                                     | LSI            | GSI_SK           | ...Attributes |\n| ------------ | ---------------------------------------------------------- | -------------- | ---------------- | ------------- |\n| Athlete:{id} | AthleteDetails                                             |                | {normalizedName} | ...           |\n| Athlete:{id} | Contest:{discipline}:{id}                                  | Contest:{date} | {points}         | ...           |\n| Athlete:{id} | Rankings:{type}:{year}:{discipline}:{gender}:{ageCategory} |                | {points}         | ...           |\n| Contests     | Contest:{discipline}:{id}                                  | Contest:{date} |                  | ...           |\n\n**Possible Query Patterns:**\n\n- Get details of athlete\n- List contests of an athlete sorted by date\n- Get a contest of an athlete\n- Get a ranking of athlete\n- Get details of a contest\n- List details of contests sorted by date\n\n### GSI Table\n\n| GSI                                                 | SK               | PK           | ...Attributes |\n| --------------------------------------------------- | ---------------- | ------------ | ------------- |\n| AthleteDetails                                      | {normalizedName} | Athlete:{id} | ...           |\n| Contest:{discipline}:{id}                           | {points}         | Athlete:{id} | ...           |\n| Rankings:{year}:{discipline}:{gender}:{ageCategory} | {points}         | Athlete:{id} | ...           |\n\n**Possible Query Patterns:**\n\n- List details of athlete sorted by name\n- List athletes of a contest sorted by points\n- List athletes of a ranking sorted by points\n\n---\n\n# Getting Started\n\nTo start with, serverless installation must be completed on your local comptuter.\n\nHow to: [Installation Guide](https://serverless.com/framework/docs/providers/aws/guide/installation/)\n\nThere are 2 environment stages, therefore you should have valid credentials for them. Checkout the `secrets.example.yml` under `serverless` folder.\nReplace the values with real ones\n\n\u003e For deployment `aws-cli` should be installed and configured with `Profiles` needed in the `serverless.yml` file. To get your credentials contact to ISA.\n\n### Running on local\n\nFirst, credentials are obtained from `.env` file. Replace the values in `.env.example` file with real ones depending on the stage you want to run (in `secrets.yml` you can see the stages)\n\nInstall dependencies\n\n```shell\nnpm install\n```\n\nStart serverless-offline\n\n```shell\nnpm start\n```\n\nAPI is served at `localhost:3000/`\n\n### Project Folder Overview\n\n[Gource] output\n\n![GourceImage]\n\n[nestjs]: https://github.com/nestjs/nest\n[serverless-offline]: https://github.com/dherault/serverless-offline\n[webpack]: https://webpack.js.org/\n[dynamodb]: https://aws.amazon.com/dynamodb/\n[serverless framework]: https://serverless.com/framework/docs/providers/aws/guide/quick-start/\n[isa-rankings.org]: https://www.isa-rankings.org\n[architecture]: docs/AWS_Architecture.png\n[gource]: https://github.com/acaudwell/Gource\n[gourceimage]: docs/GourceOutput.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInternational-Slackline-Association%2FRankings-Backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FInternational-Slackline-Association%2FRankings-Backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInternational-Slackline-Association%2FRankings-Backend/lists"}