{"id":22478940,"url":"https://github.com/ajeasmith/auth-template-appwrite","last_synced_at":"2025-03-27T18:22:13.976Z","repository":{"id":260532077,"uuid":"881553673","full_name":"AjeaSmith/auth-template-appwrite","owner":"AjeaSmith","description":"auth template using Appwrite with Github OAuth","archived":false,"fork":false,"pushed_at":"2024-11-05T01:50:11.000Z","size":505,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T21:27:02.017Z","etag":null,"topics":[],"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/AjeaSmith.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":"2024-10-31T19:52:56.000Z","updated_at":"2024-11-05T01:50:14.000Z","dependencies_parsed_at":"2024-12-06T15:11:14.292Z","dependency_job_id":"9407be68-0cbe-4ea2-bb28-a4a221377fbd","html_url":"https://github.com/AjeaSmith/auth-template-appwrite","commit_stats":null,"previous_names":["ajeasmith/ssr-auth-example-appwrite","ajeasmith/auth-template-appwrite"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjeaSmith%2Fauth-template-appwrite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjeaSmith%2Fauth-template-appwrite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjeaSmith%2Fauth-template-appwrite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AjeaSmith%2Fauth-template-appwrite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AjeaSmith","download_url":"https://codeload.github.com/AjeaSmith/auth-template-appwrite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245898514,"owners_count":20690507,"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-12-06T15:11:04.345Z","updated_at":"2025-03-27T18:22:13.942Z","avatar_url":"https://github.com/AjeaSmith.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSR Auth Starter using Appwrite (with Github OAuth)\n\n## How to use this auth starter\n- run ```npm i``` \n- Fill ```.env``` file with appwrite configs\n- In appwrite, create API Key and set ```session.write``` permissions. \n![set collection permissions](public/images/apikey.png)\n\n\n- [follow this YouTube video](https://www.youtube.com/watch?v=Bx1JqfPROXA) on how to setup a OAuth app in Github.\n- all server actions are stored in ```@/lib/server/actions```\n\n\n## SSR Auth Flow\n\n### Sign In Page\n\nChecks for user session (```getLoggedInUser```). if it exist, user gets redirected to home page.\n\nif no user, form will be submitted, using the ```signInWithEmail``` method \n- store's the session in a cookie safely in the browser. \n- creates the account in appwrite DB.\n- redirects user to protected page\n\n### Header Component\nShow's basic info about current user\n\n### Home Page Route\nChecks for auth user, if not redirects to sign-up page\n\n\n### Additional Notes\n- Inside Appwrite DB when working with collections, grant authenticated users permission to either Read, Write, Update or delete collections. If not, a 403 error will occur saying user doesn't have permission to access that collection.\n*see image*\n![set collection permissions](public/images/screenshot.png)\n\n- The **AdminClient** is used to make unauthenticated requests, its used when a new user needs to signs up and set a session\n- The **SessionClient** is used to make authenticated requests, you need to have a valid session in order to make DB requests.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajeasmith%2Fauth-template-appwrite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajeasmith%2Fauth-template-appwrite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajeasmith%2Fauth-template-appwrite/lists"}