{"id":16969686,"url":"https://github.com/devlinduldulao/leaderboard-nextjs-cosmosdb","last_synced_at":"2026-04-11T14:37:10.664Z","repository":{"id":102789191,"uuid":"431662669","full_name":"webmasterdevlin/leaderboard-nextjs-cosmosdb","owner":"webmasterdevlin","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-12T13:46:40.000Z","size":1024,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T13:42:32.499Z","etag":null,"topics":["appservice","cosmosdb","github-actions","nextjs"],"latest_commit_sha":null,"homepage":"https://webapp-dev.xyz","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/webmasterdevlin.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":"2021-11-25T00:09:14.000Z","updated_at":"2022-01-12T19:05:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"3117274a-2aef-4067-90f0-ea57b16b9b96","html_url":"https://github.com/webmasterdevlin/leaderboard-nextjs-cosmosdb","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/webmasterdevlin%2Fleaderboard-nextjs-cosmosdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fleaderboard-nextjs-cosmosdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fleaderboard-nextjs-cosmosdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fleaderboard-nextjs-cosmosdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterdevlin","download_url":"https://codeload.github.com/webmasterdevlin/leaderboard-nextjs-cosmosdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852680,"owners_count":20521159,"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":["appservice","cosmosdb","github-actions","nextjs"],"created_at":"2024-10-14T00:26:07.444Z","updated_at":"2025-12-30T23:56:33.082Z","avatar_url":"https://github.com/webmasterdevlin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaderboard\n- Built using full-stack Next.js and Microsoft Azure CosmosDB\n- Next.js is a full-stack React framework\n- The Microsoft Azure CosmosDB database is used to store the data\n- https://docs.microsoft.com/en-us/azure/cosmos-db/introduction\n- The frontend side of Next.js sends requests to its own APIs (backend) using Axios to read and write to the database\n- The backend side of Next.js reads and writes to the CosmosDB database by sending and receiving requests to the CosmosDB endpoints/APIs\n- The requests to CosmosDB needs to be authenticated using the Azure CosmosDB API key which is stored in the .env file\n\n## SPA (create-react-app) vs SSR (next.js)\n\n### SPA\n- for JWT authentication\n- JWT is a stateless authentication makes web servers scalable but harder to make the security right\n- SPA is usually seen on cases where the server accepts requests from different web apps and mobiles apps\n- can still navigate even if the app is disconnected from the internet\n- faster because it doesn't need to load the entire app on every page load\n\n### SSR\n- for cookie based authentication which maintains a session IDs\n- SEO friendly\n- can store api_keys\n- reverse proxy\n- do caching\n- rate limiting for DDOS protections\n- can't navigate if the app is disconnected from the internet\n\n## Frontend\n- React components are located inside the src directory, can be folders named views, components, layouts, etc.\n- Web pages are located in the pages directory\n- Routes are based on the pathname of folders or Tsx files inside the src/pages directory\n\n## Backend\n- APIs codes are located inside the src/pages/api/**\n- Endpoints are based on the pathname of folders or Tsx files inside the src/pages/api directory\n\n## CosmosDB\n- the cosmosdb code is located in the src/services/api/playerService.ts\n- cosmosdb is a NoSQL database but different from MongoDB\n- It has partition key which is similar to Casandra db\n- CosmosDB alternatives are MongoDB Atlas and Google Firebase. Both have libraries and SDKs to connect to the database\n\n## Steps\n- npx create-next-app my-app --ts\n- cd my-app\n- code .\n- install material-ui\n- install react-lottie\n- install axios\n- install formik and yup\n- azure cosmosdb\n- set up the .env.local file\n- .env.local file needs properties from .env.local.copy plus the values from the cosmosDb service in Microsoft Azure\n\n## TODOS\n- only show the top 20 results\n- add ranking numbers from top 1 to top 20\n- make sure to sort after adding new profile in the list so that newly added profile will be inserted at the right position\n- change the color and design of the web app\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlinduldulao%2Fleaderboard-nextjs-cosmosdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevlinduldulao%2Fleaderboard-nextjs-cosmosdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevlinduldulao%2Fleaderboard-nextjs-cosmosdb/lists"}