{"id":29802311,"url":"https://github.com/bigfatdog/auth-flow-ssr","last_synced_at":"2025-10-31T07:47:12.493Z","repository":{"id":85542110,"uuid":"127362017","full_name":"BigFatDog/auth-flow-ssr","owner":"BigFatDog","description":"Full stack login/register flow with React Server Side Rendering, Apollo, Redux, Redux-saga and MongoDB.","archived":false,"fork":false,"pushed_at":"2018-06-14T14:08:40.000Z","size":1808,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T10:26:02.108Z","etag":null,"topics":["apollo","auth","auth-flow","express","graphql","login","mongodb","react","redux","redux-saga","register","reselect","ssr"],"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/BigFatDog.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,"zenodo":null}},"created_at":"2018-03-30T00:41:59.000Z","updated_at":"2023-03-25T07:25:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"90c84155-0e26-49c6-a582-313f9840af61","html_url":"https://github.com/BigFatDog/auth-flow-ssr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BigFatDog/auth-flow-ssr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigFatDog%2Fauth-flow-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigFatDog%2Fauth-flow-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigFatDog%2Fauth-flow-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigFatDog%2Fauth-flow-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BigFatDog","download_url":"https://codeload.github.com/BigFatDog/auth-flow-ssr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigFatDog%2Fauth-flow-ssr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281953493,"owners_count":26589146,"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","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apollo","auth","auth-flow","express","graphql","login","mongodb","react","redux","redux-saga","register","reselect","ssr"],"created_at":"2025-07-28T10:10:27.868Z","updated_at":"2025-10-31T07:47:12.485Z","avatar_url":"https://github.com/BigFatDog.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Full stack auth flow with server side rendering\n\nIf you're looking for a non-ssr version, please check [auth-flow-react-apollo-saga](https://github.com/BigFatDog/auth-flow-react-apollo-saga)\n\n# Main features (enabled by nextjs)\n* Server Side Rendering\n* Separate bundling for each page\n* Use service worker to preload scripts asynchronously\n* Pre data fetching. Page are immediately ready on the first visit\n\n# Technology Stack\nNextjs, Apollo, React, Redux, Redux-saga, Express, MongoDB, Re-select\n\n# Background\nThis is an alternative architecture to [auth-flow-react-apollo-saga](https://github.com/BigFatDog/auth-flow-react-apollo-saga). This project has similar technology stack and code base\nwith [auth-flow-react-apollo-saga](https://github.com/BigFatDog/auth-flow-react-apollo-saga). The major difference is this project is based on [Next.js](https://github.com/zeit/next.js/) framework.\n\n\n## Setup\n1. install mongodb\n2. clone this project from https://github.com/BigFatDog/auth-flow-ssr.git\n3. npm install\n4. npm run start\n5. visit localhost:3030\n\n## Features\nThis application aims to demonstrate a full stack login/register flow.\n\n* based on access token and refresh token. Tokens are stored in http-only cookie.\n* verify token on route change (implemented via High-Order-Component)\n* jwt middleware for both web endpoint and apollo endpoint\n* authentication status is stored as immutable object in Redux store\n* failures of verifying tokens will redirect user to login page\n* handling error messages in i18n\n\nCommon failures\n* lost server connection\n* opertation timeout\n* MongoDB down\n\nLogin failures\n* User not found\n* Invalid credentials\n\nRegister failures\n* user already exists\n* email already exists\n\n## Implementation\n### Project Structure\nI started this project with [React Boilerplate](https://github.com/react-boilerplate/react-boilerplate). The following adjustments are made per my own needs:\n1. server code are compiled to build/server\n2. .graphql support\n3. server logic are in ES6, built and run with babel-node\n4. add apollo server and client\n5. axios is used for rest call\n6. fontawesome 5\n\n### Web Server authentication v.s. GraphQL authentication\nIt has been introduced in this awesome tutorial: [Apollo Tutorial](https://dev-blog.apollodata.com/a-guide-to-authentication-in-graphql-e002a4039d1).\nI chose the web server approach.\n\n## Limitations\n* Apollo WebSocket failures haven't been verified\n* No 3rd party auth support. (passport-facebook, passport-github)\n* No tests\n\n## Credits\n* [React Boilerplate](https://github.com/react-boilerplate/react-boilerplate) the initial project structure\n* [Apollo Universal Starter Kit](https://github.com/sysgears/apollo-universal-starter-kit) implementation of access token and refresh token\n\n## License\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigfatdog%2Fauth-flow-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigfatdog%2Fauth-flow-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigfatdog%2Fauth-flow-ssr/lists"}