{"id":17997530,"url":"https://github.com/danielhe4rt/leaderboard-rust","last_synced_at":"2025-03-26T04:31:22.021Z","repository":{"id":221407039,"uuid":"753786570","full_name":"danielhe4rt/leaderboard-rust","owner":"danielhe4rt","description":"A Leaderboard made of Actix, Rust and ScyllaDB (Charybdis)","archived":false,"fork":false,"pushed_at":"2025-01-09T14:07:21.000Z","size":88,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T02:09:31.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/danielhe4rt.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":"2024-02-06T19:41:53.000Z","updated_at":"2025-01-06T13:15:21.000Z","dependencies_parsed_at":"2024-10-29T21:59:28.472Z","dependency_job_id":null,"html_url":"https://github.com/danielhe4rt/leaderboard-rust","commit_stats":null,"previous_names":["danielhe4rt/leaderboard-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhe4rt%2Fleaderboard-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhe4rt%2Fleaderboard-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhe4rt%2Fleaderboard-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielhe4rt%2Fleaderboard-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielhe4rt","download_url":"https://codeload.github.com/danielhe4rt/leaderboard-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245589264,"owners_count":20640254,"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-29T21:19:19.315Z","updated_at":"2025-03-26T04:31:21.607Z","avatar_url":"https://github.com/danielhe4rt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Gaming Leaderboard\r\n\r\nThis is a simple Rust Gaming Leaderboard that uses [ScyllaDB](https://scylladb.com) [Charybdis ORM](https://github.com/nodecosmos/charybdis) and Actix Web Framework.\r\n\r\n## Prerequisites\r\n\r\n- Rust: You need to have Rust installed on your machine. You can download it from the [official website](https://www.rust-lang.org/tools/install).\r\n- ScyllaDB: This project uses ScyllaDB as its database. Make sure you have it installed and running. You can download it from the [official website](https://www.scylladb.com/download/).\r\n\r\n## Environment Variables\r\n\r\nThis project uses environment variables for configuration. You need to create a `.env` file in the root directory of the project with the following variables:\r\n\r\n- `SCYLLA_NODES`: A comma-separated list of ScyllaDB nodes.\r\n- `SCYLLA_USERNAME`: The username for ScyllaDB.\r\n- `SCYLLA_PASSWORD`: The password for ScyllaDB.\r\n- `SCYLLA_CACHED_QUERIES`: The number of cached queries for ScyllaDB.\r\n- `APP_NAME`: The name of the application.\r\n- `APP_VERSION`: The version of the application.\r\n\r\n\u003e [!NOTE]\r\n\u003e You can use the `.env.example` file as a template for your `.env` file.\r\n\r\n## Running the Project\r\n\r\n1. Clone the repository to your local machine.\r\n2. Navigate to the project directory.\r\n3. Run `cargo build` to build the project.\r\n4. Run `cargo run` to start the server.\r\n\r\nThe server will start on `localhost:8000`.\r\n\r\n## Endpoints\r\n\r\nThis project has the following endpoints:\r\n\r\n- `post_submission`: Endpoint for posting a submission.\r\n- `get_submission`: Endpoint for getting a submission.\r\n- `get_leaderboard`: Endpoint for getting the leaderboard.\r\n\r\n## Features\r\n\r\nHere's a list of the features that are currently implemented:\r\n\r\n### Leaderboard\r\n\r\nURI: GET - /leaderboard/{song_id}\r\n\r\nSubmit a score will place you in a ranking for a song.\r\nThe ranking is partitioned by:\r\n- Song\r\n- Instrument\r\n- Difficulty\r\n- Modifiers\r\n\r\nand clustered by:\r\n\r\n- Score (descending)\r\n- Player Id (ascending)\r\n\r\n### Score Submission\r\n\r\nURI: POST - /submissions\r\n\r\nSubmit a score for a song that will also generate your place on the leaderboard.\r\n\r\nPayload Example:\r\n````json\r\n{\r\n    \"song_id\": \"song_id\",\r\n    \"player_id\": \"player_id\",\r\n    \"score\": 1000000,\r\n    \"difficulty\": \"expert\",\r\n    \"instrument\": \"guitar\",\r\n    \"modifiers\": \"None\"\r\n}\r\n````\r\nResponse Example:\r\n````json\r\n{\r\n  \"message\": \"Submission created successfully\",\r\n  \"submission\": {\r\n    \"difficulty\": \"daniel\",\r\n    \"id\": \"fef50174-dedf-4e78-8735-d3d04d41d26d\",\r\n    \"instrument\": \"guitar\",\r\n    \"modifiers\": [\r\n      \"no-modifiers\"\r\n    ],\r\n    \"played_at\": \"2024-02-07T19:20:30.864460605Z\",\r\n    \"player_id\": \"daniel\",\r\n    \"score\": 1100,\r\n    \"song_id\": \"unsainted-slipknot\"\r\n  }\r\n}\r\n````\r\n\r\nPlease refer to the source code for more details on the request and response formats for these endpoints.\r\n\r\n## Contributing\r\n\r\nPlease read `CONTRIBUTING.md` for details on our code of conduct, and the process for submitting pull requests to us.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the `LICENSE.md` file for details.\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielhe4rt%2Fleaderboard-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielhe4rt%2Fleaderboard-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielhe4rt%2Fleaderboard-rust/lists"}