Remove appwrite#146
Open
zsklav wants to merge 2 commits intoFlashl3opard:mainfrom
Open
Conversation
Previously lib/mongodb.ts threw at module load if MONGODB_URI was missing, which broke `next build` even for routes that never touch the database (Next collects page data for all routes at build time, including static ones). Now the URI is only validated when connectDB() is actually called. Build succeeds without env vars; runtime requests that need Mongo fail with a clear error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Appwrite was running in parallel with Firebase as a second auth+storage
provider. The dual-source-of-truth caused real production pain — Appwrite
Cloud's free tier auto-pauses after inactivity, which surfaced as a wall
of red 403 errors in DevTools on every page (AuthGuard, Dashboard,
ProfileSection, Forums all called authservice.checkUser() on mount).
This commit consolidates onto Firebase as the single auth provider and
removes Appwrite end-to-end:
Auth layer
- app/appwrite/auth.ts: rewritten as a Firebase-backed implementation
that preserves the existing AuthServiceContract shape ($id, name,
email, emailVerification). All callers (login, signup, forgot/reset
password, AuthGuard, Navbar, ProfileSection, Forums, Dashboard,
PersonalTODO, community) work unchanged.
- app/Dashboard/page.tsx, app/components/PersonalTODO.tsx: switch from
`account.get()` to `authservice.checkUser()`.
- app/community/page.tsx: replace appwrite Models import with the
locally-defined AuthUser type.
Data layer (clan feature)
- app/components/CommunityConnect.tsx: replaced ~300-line clan
create/join/leave UI (called Appwrite Databases directly) with a
placeholder card. Clan storage was never migrated to Mongo with the
rest of the data model and the standalone Express clan server is not
deployed, so the feature was already non-functional in production.
- Deleted app/api/clan/* (5 routes) — only callers were the now-stub
CommunityConnect component.
Dead code
- app/api/APIDebbuger.tsx: a 200-line in-app Appwrite JWT debugger
component that no other file imported.
- app/api/dev/users/* + app/dev/users/page.tsx: admin-only Appwrite
user listing that's not part of any user-facing flow.
- app/api/user/{solved-questions,mark-solved}/*: Appwrite-JWT-verifying
routes that no page in the app actually called.
Dependencies
- Removed `appwrite` and `node-appwrite` from package.json.
- lib/appwrite.ts (the Client/Account/Databases client) deleted.
Net: −1265 lines, +175. One auth source. No more 403 console wall on
auth-gated pages.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
👷 Deploy request for vibexcode pending review.Visit the deploys page to approve it
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.