{"id":25437878,"url":"https://github.com/fabogit/jobinterview_tickets-server","last_synced_at":"2026-04-17T12:30:55.452Z","repository":{"id":48165114,"uuid":"513523897","full_name":"fabogit/JobInterview_tickets-server","owner":"fabogit","description":"API rest, jwt \u0026 crud","archived":false,"fork":false,"pushed_at":"2022-07-22T16:51:07.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T09:34:46.120Z","etag":null,"topics":["express","jwt","node"],"latest_commit_sha":null,"homepage":"","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/fabogit.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":"2022-07-13T13:03:14.000Z","updated_at":"2025-01-29T01:41:56.000Z","dependencies_parsed_at":"2022-09-13T12:02:54.388Z","dependency_job_id":null,"html_url":"https://github.com/fabogit/JobInterview_tickets-server","commit_stats":null,"previous_names":["fabogit/jobinterview_tickets-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabogit%2FJobInterview_tickets-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabogit%2FJobInterview_tickets-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabogit%2FJobInterview_tickets-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabogit%2FJobInterview_tickets-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabogit","download_url":"https://codeload.github.com/fabogit/JobInterview_tickets-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292067,"owners_count":22046427,"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":["express","jwt","node"],"created_at":"2025-02-17T09:27:38.530Z","updated_at":"2025-10-16T06:40:49.945Z","avatar_url":"https://github.com/fabogit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use case\n\n- main page allow to login/register/logout\n\n- on login ui will load all user available tickets (might add filter to show only the open/closed), data is paginated\n\n- users can create a new ticket\n\n- single tickets can be selected to show full details, admin users can update/delete tickets\n\nauth/roles:\n\nan user can read and create his tickets,\n\nan admin can read all users tickets and update the completed field\n\n\naccess token:\n\n```\nBearer pasteheretheAccessTokenFrom/users/login\n```\n\n# API\n\n## open api\n\n-\t`POST`\t\t`/users/`\t\t\t-\u003e Register a new user\n\n-\t`PUT`\t\t`/users/:userId`\t-\u003e logged in user can update username/password // TODO\n\n-\t`DELETE`\t`/users/`\t\t\t-\u003e Delete a user if is currently logged in\n\n-\t`GET`\t\t`/users/login`\t\t-\u003e Log in the user and create the access token\n\n-\t`GET`\t\t`/users/logout`\t\t-\u003e Remove jwt client side || DELETE session ?\n\n## auth api, access token needed\n\n-\t`GET` \t\t`/tickets`\t\t\t\t-\u003e fetch user tickets /paginated result, ADMINS will get all tickets\n\n-\t`POST`\t\t`/tickets`\t\t\t\t-\u003e user ticket creation\n\n-\t`GET`\t\t`/tickets/:id`\t\t\t-\u003e get ticket by id\n\n-\t`PUT`\t\t`/tickets/:id`\t\t\t-\u003e ADMINS update ticket status\n\n-\t`DELETE`\t`/tickets/:id`\t\t\t-\u003e ADMINS delete ticket\n\n- \t`POST`\t\t`/messages/:ticketId`\t-\u003e ADMINS and the ticket owner can create messages\n\n\n# data schema\n\ncollections:\n\n```\nusers: {\n\tusername: string,\n\tpassword: string,\n\tisAdmin: boolean\n\t}\n```\n\n```\ntickets: {\n\tusername: string,\n \tdescription: string,\n  \tisCompleted: boolean(default: false)\n\n\tcomunications: [\n\t\t{\n\t\tdate: Date\n\t\tuserId: ObjectId,\n\t\tusername: string\n\t\tmessage: string\n\t}, ...\n\t],\n  \tcreatedAt: Date\n  \tupdatedAt: Date\n\t}\n```\n\nto gen token\n\n`node` -\u003e `require('crypto').randomBytes(64).toString('hex')`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabogit%2Fjobinterview_tickets-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabogit%2Fjobinterview_tickets-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabogit%2Fjobinterview_tickets-server/lists"}