{"id":24719879,"url":"https://github.com/mikelpmc/react-context-api-auth","last_synced_at":"2025-10-09T17:32:17.150Z","repository":{"id":42087692,"uuid":"149285299","full_name":"mikelpmc/react-context-api-auth","owner":"mikelpmc","description":"React context api auth demo","archived":false,"fork":false,"pushed_at":"2023-01-06T11:47:22.000Z","size":2211,"stargazers_count":37,"open_issues_count":13,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T05:46:01.462Z","etag":null,"topics":["api","context-api","express","hooks","jwt","node","provider","react","react-hooks","react-router","reducer"],"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/mikelpmc.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":"2018-09-18T12:33:38.000Z","updated_at":"2024-12-04T14:27:17.000Z","dependencies_parsed_at":"2023-02-06T00:31:44.962Z","dependency_job_id":null,"html_url":"https://github.com/mikelpmc/react-context-api-auth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelpmc%2Freact-context-api-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelpmc%2Freact-context-api-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelpmc%2Freact-context-api-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikelpmc%2Freact-context-api-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikelpmc","download_url":"https://codeload.github.com/mikelpmc/react-context-api-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235843607,"owners_count":19054019,"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":["api","context-api","express","hooks","jwt","node","provider","react","react-hooks","react-router","reducer"],"created_at":"2025-01-27T11:44:45.117Z","updated_at":"2025-10-09T17:32:11.707Z","avatar_url":"https://github.com/mikelpmc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Context API Demo\n\nBasic demo to show the usage of the React context API with authentication flow\n\nProject Structure:\n\n```sh\n    -server\n        -src\n            -data\n                -schemas\n            -logic\n            -routes\n            -utils\n        -index.js\n        -.env\n\n    -client\n        -public\n        -src\n            -components\n            -pages\n            -providers\n            -services\n            -utils\n            -App.js\n            -index.js\n        -.env\n```\n\nSystem Requirements:\n\n-   Node\n-   Mongodb\n\nServer:\n\n1. Install the project dependencies\n\n```sh\n$ npm i\n```\n\n2. Create the .env file on the root of the server/ folder\n\n```sh\n$ touch .env\n```\n\n.env\n\n```sh\nDB_URL=mongodb://localhost:27017/your-database\nPORT=5000\nTOKEN_SECRET=your-secret\nTOKEN_EXP=3h\n```\n\n3. Start the Server\n\n```sh\n$ npm start\n```\n\nClient:\n\n1. Download dependencies\n\n```sh\n$ npm i\n```\n\n2. Create the .env file on the root of the client/ folder\n\n```sh\n$ touch .env\n```\n\n.env\n\n```sh\nREACT_APP_API_BASE_URL=http://localhost:5000/api\n```\n\n\\*Note: In order to enviroment variables work with this react project without touching any config file they all have to start with \\*\\*REACT_APP\\*\\*\n\n3. Start the client\n\n```sh\n$ npm start\n```\n\nAuthor: [http://github.com/mikelpmc](http://github.com/mikelpmc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikelpmc%2Freact-context-api-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikelpmc%2Freact-context-api-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikelpmc%2Freact-context-api-auth/lists"}