How whyeric92-eng/bookmark-api works
Bookmark API is a personal bookmark manager: users register or log in, then manage their own bookmarks and tags, search/filter bookmarks, and update their profile. The React app routes users through these workflows and sends authenticated requests to FastAPI; the backend validates identity and ownership before route handlers use SQLModel sessions and relational models. The README documents PostgreSQL persistence and stateless JWT logout. Edges are limited to relationships shown in excerpts, SOURCE INDEX references, or README; sampled code does not expose every frontend request or database interaction.
Main entry points: session.py Database session · App.jsx Client routes · api.js API client · router.py API router
Components 19
React client
- Client routes
frontend/src/App.jsx - Register and login
frontend/src/pages/Register.jsx - Bookmark workspace
frontend/src/pages/Bookmarks.jsx - Tag workspace
frontend/src/pages/Tags.jsx - Profile
frontend/src/pages/Profile.jsx - Navigation and logout
frontend/src/components/NavBar.jsx - Confirmation modal
frontend/src/components/ConfirmModal.jsx - API client
frontend/src/api.js
FastAPI API
- API router
app/api/router.py - User endpoints
app/api/routes/users.py - Bookmark endpoints
app/api/routes/bookmarks.py - Tag endpoints
app/api/routes/tags.py
Identity and access
- Token and ownership checks
app/api/deps.py - JWT and password security
app/core/security.py
Persistence model
- Database session
app/db/session.py - User model
app/models/user.py - Bookmark model
app/models/bookmark.py - Tag and link model
app/models/tag.py
Other components
- User
Connections 31
- User → Client routes: uses app
frontend/src/App.jsx - Client routes → Register and login: routes to
frontend/src/App.jsx - Client routes → Bookmark workspace: routes to
frontend/src/App.jsx - Client routes → Tag workspace: routes to
frontend/src/App.jsx - Client routes → Profile: routes to
frontend/src/App.jsx - Bookmark workspace → API client: calls
frontend/src/pages/Bookmarks.jsx - Tag workspace → API client: calls
frontend/src/pages/Tags.jsx - Profile → API client: calls
frontend/src/pages/Profile.jsx - Register and login → API client: calls
frontend/src/pages/Register.jsx - Bookmark workspace → Navigation and logout: renders
frontend/src/pages/Bookmarks.jsx - Tag workspace → Navigation and logout: renders
frontend/src/pages/Tags.jsx - Profile → Navigation and logout: renders
frontend/src/pages/Profile.jsx - Navigation and logout → Confirmation modal: renders
frontend/src/components/NavBar.jsx - API client → API router: sends requests
- API router → Bookmark endpoints: registers
app/api/router.py - API router → Tag endpoints: registers
app/api/router.py - API router → User endpoints: registers
app/api/router.py - User endpoints → JWT and password security: hashes and issues tokens
app/api/routes/users.py - Token and ownership checks → JWT and password security: decodes tokens
app/api/deps.py - Token and ownership checks → Database session: loads resources
app/api/deps.py - Bookmark endpoints → Token and ownership checks: requires ownership
app/api/routes/bookmarks.py - Tag endpoints → Token and ownership checks: requires ownership
app/api/routes/tags.py - User endpoints → Database session: uses session
app/api/routes/users.py - Bookmark endpoints → Database session: queries and commits
app/api/routes/bookmarks.py - Tag endpoints → Database session: queries and commits
app/api/routes/tags.py - Database session → Bookmark model: persists
- Database session → Tag and link model: persists
- Database session → User model: persists
- Bookmark model → Tag and link model: many-to-many link
app/models/bookmark.py - User model → Bookmark model: owns bookmarks
app/models/user.py - User model → Tag and link model: owns tags
app/models/user.py