{"id":18248768,"url":"https://github.com/esraakamel1195/fatura-backend-assignment","last_synced_at":"2026-04-11T19:32:02.866Z","repository":{"id":99577278,"uuid":"418689640","full_name":"esraaKamel1195/Fatura-Backend-Assignment","owner":"esraaKamel1195","description":"Solve Assignment for fatura company for backend node.js position","archived":false,"fork":false,"pushed_at":"2022-01-27T11:39:20.000Z","size":246,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T15:49:28.579Z","etag":null,"topics":["authentication","express","jwt","jwt-authentication","mongodb","nodejs","sessions"],"latest_commit_sha":null,"homepage":"https://fatura-backend-assignment.vercel.app","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/esraaKamel1195.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-10-18T22:34:33.000Z","updated_at":"2024-05-18T20:01:16.000Z","dependencies_parsed_at":"2023-07-31T00:01:07.149Z","dependency_job_id":null,"html_url":"https://github.com/esraaKamel1195/Fatura-Backend-Assignment","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/esraaKamel1195%2FFatura-Backend-Assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esraaKamel1195%2FFatura-Backend-Assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esraaKamel1195%2FFatura-Backend-Assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esraaKamel1195%2FFatura-Backend-Assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esraaKamel1195","download_url":"https://codeload.github.com/esraaKamel1195/Fatura-Backend-Assignment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247918928,"owners_count":21018044,"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":["authentication","express","jwt","jwt-authentication","mongodb","nodejs","sessions"],"created_at":"2024-11-05T09:38:14.624Z","updated_at":"2025-12-30T22:17:15.958Z","avatar_url":"https://github.com/esraaKamel1195.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Documentations\n\n  Thinking Process:\n    - At first creating package.json and installing important modules such as ( express, mongodb, mongoose, dotenv, nodemon, jsonwebtoken, bcryptjs).\n    - Second creating folders and files to build project structure.\n    - Using config folder and created file database.js to create connection with mongodb server using mongoose.\n    - Using user.js controller file inside controller folder to implement nessecery apis (register, login, logout).\n    - Using auth.js middleware file inside middleware folder to check if user authenticated or not.\n    - Using user.js model to implement user schema.\n    - Using user.js router file to implement RESTful API routes and calling it in app.js file.\n    \n    Registeration service:\n      - When the user trying to login the url \"localhost:4001/user/register\" called.\n      - At first check if email \u0026 first_name \u0026 last_name \u0026 password is exist in req.body to validate it if not back \n        with error as it required.\n      - Check if user exist or not, if not back with error that user not exist, and if it not exist bcrypt password \n        then store user in database, generate token, set session.\n      - then back with token and user date.\n      \n    Login service:\n      - When the user trying to login the url \"localhost:4001/user/login\" called.\n      - At first check if email \u0026 password is exist in req.body to validate it if not back with error as it required.\n      - Check if user exist or not, if not back with error that user not exist, and if it exist check password if correct,\n        then check email and password both are correct\n        if it are correct set session and generate token, then back with token and user date.\n    \n    Logout service:\n      - When the user trying to login the url \"localhost:4001/user/logout\" called.\n      - At first check if session and token are exist or not, if exist remove it. if not exist sent to user that \n        \"you are not authenticated\".\n      \n    Auth service:\n      - When user called any page or trying any action need to be authenticated auth function called.\n      - At first chect if session and token are exist or not.\n      - Then if it exist check session is valid, if it valid decode token and back to api if allow the user to\n        make action becouse user is authenticated,\n      - If there any issue not allow to user make the action as user not authenticated.\n      \n Useful Resources:\n \n    - https://www.section.io/engineering-education/how-to-build-authentication-api-with-jwt-token-in-nodejs/ \n      which explain who to use JWt in authentication.\n    - https://www.coursera.org/learn/server-side-nodejs/ this course which I already studing in it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesraakamel1195%2Ffatura-backend-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesraakamel1195%2Ffatura-backend-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesraakamel1195%2Ffatura-backend-assignment/lists"}