{"id":21534887,"url":"https://github.com/basantech89/users-dilemma","last_synced_at":"2025-03-17T20:15:42.166Z","repository":{"id":39234972,"uuid":"238712198","full_name":"basantech89/users-dilemma","owner":"basantech89","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T06:37:02.000Z","size":2629,"stargazers_count":1,"open_issues_count":47,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T07:12:09.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/basantech89.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}},"created_at":"2020-02-06T14:51:09.000Z","updated_at":"2023-03-09T00:58:44.000Z","dependencies_parsed_at":"2023-02-03T16:00:20.856Z","dependency_job_id":null,"html_url":"https://github.com/basantech89/users-dilemma","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/basantech89%2Fusers-dilemma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basantech89%2Fusers-dilemma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basantech89%2Fusers-dilemma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basantech89%2Fusers-dilemma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basantech89","download_url":"https://codeload.github.com/basantech89/users-dilemma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244102855,"owners_count":20398386,"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-11-24T03:12:58.678Z","updated_at":"2025-03-17T20:15:42.150Z","avatar_url":"https://github.com/basantech89.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Take Home Project - 2: Users-Dilemma ##\n\n`Problem Statement`\n\nThere are 4 users in a system with different roles. One user can only be assigned one role. The login IDs and passwords of the users who have been assigned these roles have been stored locally. We need to authenticate when any user tries to login and accordingly grant/deny access.The task would be to build the following APIs (in Node.js) which are required to achieve this objective: \n1. Signup - Passwords should be randomly generated at the time of signup. \n2. Login \n3. One sample API for each user rolePlease note that the system should be horizontally scalable.\n\n\n`Solution`\n\nTech-Stack: React, Express Server, MongoDB, Mongoose, Passport, Jsonwebtoken\n\nUsers can have 4 type of roles: unauthorized, basic, creator, admin\n\nunauthorized users have get access to all the movies\n\nbasic users have get access to all content and post/put/delete on movie comments\n\ncreators can get/post/put/delete all the movies\n\nadmins have access to everything except basic users's private data\n\nonly basic users can be created with UI, to create other users with other roles, mongo repl has to be used\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasantech89%2Fusers-dilemma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasantech89%2Fusers-dilemma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasantech89%2Fusers-dilemma/lists"}