Practical Project 2: Personal Bookmark & Reading Vault
Difficulty: Beginner → Intermediate
Estimated Effort: 2 weekends
Core Skills Practiced: Multi-user accounts (login vs. ownership checks), setting up a real database (PostgreSQL), validating web links safely, search/filtering, permission tests, and production database migrations.
Overview
In this walkthrough, you will build a Personal "Read Later" Bookmark Vault—a private web app where you save articles, tutorials, and videos you want to read later, organize them with simple topic tags, and check them off once you've read them.
Think of it as your own clean, private alternative to leaving 40 browser tabs open or texting links to yourself in a chat app so you can open them on another device later:
- You open your website from either your laptop or your phone and log into your account.
- You paste a link (like a recipe, a coding guide, or a YouTube talk), give it a short title and an optional tag (like
cookingorcareer), and save it. - You can filter your list to show only Unread links or search by keyword, and mark items Read when finished.
How this differs from Project 1: Project 1 had no login—one person used one simple list. Project 2 introduces multiple private users, which teaches you how login works, how to connect two database tables (users and bookmarks), and how to guarantee User B can never see or delete User A's saved links.
Phase 1: Idea & Product Thinking
The Everyday Scenario
Imagine it is Tuesday afternoon. On your phone at lunch, you spot a great 10-minute article about negotiating a job offer. You open it, realize you don't have time right now, and either leave the tab buried among 25 other phone tabs or message the link to yourself. By Saturday morning on your laptop, you have forgotten where you saved it—or whether you already read it.
Problem Statement
Busy learners and working professionals regularly find useful articles and videos across their phone and laptop, but leave them scattered across open browser tabs, screenshots, and self-sent chat messages—making it frustrating to find a specific link later or know what they still haven't read.
Challenging AI Assumptions
- AI initially suggested: "Auto-scrape every webpage for preview images, generate AI summaries of each article, build a Chrome extension, and add public profile sharing!"
- Your engineering decision: Automatically fetching arbitrary URLs from a server breaks constantly on paywalled/anti-bot websites and introduces serious security risks (such as SSRF—where an attacker tricks your server into calling private internal URLs). For MVP, letting the user paste a link and type a short title + tag is fast, reliable, and safe.
MVP Scope
- Essential (In Scope for v1):
- Sign up, log in, and log out with your own private account.
- Save a bookmark (
url,title, and optionaltag). - View your saved bookmarks, filter by Unread / Read or search by title/tag.
- Mark a bookmark Read/Unread and delete a bookmark.
- Out of Scope (Later): Webpage scraping, AI article summaries, browser extensions, shared team folders, password-reset emails (keep v1 focused on core accounts + vault).
Phase 2: Requirements & Planning
Key User Stories & Acceptance Criteria
- Story 1 (Private Account & Data Isolation): As a registered user, I want to log into my vault so only I can see or change my saved links.
- Invalid login shows a generic message ("Invalid email or password", never revealing which one was wrong).
- Anyone who is not logged in requesting
/api/bookmarksgets401 Unauthorized. - User B cannot view, toggle, or delete User A's bookmark—even by guessing its ID in the URL.
- Story 2 (Save a Link): As a user, I want to save a web link with a title and optional tag so I can find it later from any device.
- Only valid
http://orhttps://links are accepted (javascript:...or malformed text is rejected with400). - The newly saved bookmark appears at the top of the list and stays saved after refreshing or logging back in.
- Only valid
- Story 3 (Find & Track Reading): As a user, I want to filter unread links, search by keyword/tag, and mark links as read.
- Filtering or searching updates the list cleanly and shows a clear message when zero matches are found.
- Toggling Read/Unread persists after refreshing the page.
Phase 3: UI/UX & Design
Screen Inventory (2 Clean Flows)
/login&/signup(Auth Screen): Simple centered card with email, password, inline error message area, and a link switching between Log In and Sign Up./(My Vault Screen): Header with app name + "Log out", a compact "Save a Link" form at the top (URL, Title, Tag), a search +All / Unread / Readfilter bar, and a clean vertical list of saved links.
(Putting the "Save a Link" form right at the top of / avoids needing a separate /add page!)
Text Wireframe (/ My Vault Screen)
+------------------------------------------------------------------+
| Reading Vault [Log out] |
+------------------------------------------------------------------+
| Save a Link: |
| [ https://... ] [ Title... ] [ Tag ] [ + Save Link ] |
+------------------------------------------------------------------+
| [ Search title or tag... ] [All] [Unread] [Read] |
+------------------------------------------------------------------+
| [Unread] Git Branching Guide #git [Del] |
| learngitbranching.js.org [Mark Read] |
|------------------------------------------------------------------|
| [Read] How HTTPS Works #web [Del] |
| howhttps.works [Mark Unread] |
+------------------------------------------------------------------+
Design Direction Rules
- Tone: Crisp digital bookshelf (
#F8FAFCbackground,#FFFFFFcards,#0F172Atext,#2563EBblue primary action). - Important UX & safety details: Show the clean website domain (e.g.,
developer.mozilla.org), open external links safely (target="_blank" rel="noopener noreferrer"), and use a clear pill badge for Unread vs. Read.
Phase 4: System Design & Architecture
Chosen Stack
- Backend + Frontend: A mainstream full-stack framework or clean API Server (Node/Express or Python/FastAPI) + Frontend.
- Database: PostgreSQL (recommended because users expect their saved links to sync across devices and stay stored reliably online).
- Auth Approach (Critical Decision): Hash passwords using a well-tested library (
bcryptorargon2) and track logins with signed HTTP-only session cookies (never store plain-text passwords, and never invent custom encryption).
Relational Data Model
userstable:id(primary key)email(unique, lowercase, not null)password_hash(text, not null — never store plain passwords!)created_at(timestamp)
bookmarkstable:id(primary key)user_id(foreign key referencingusers.id, not null — connects every link to its owner)url(text, not null)title(text, not null)tag(text, nullable)is_read(boolean, defaultfalse)created_at(timestamp)
Mandatory Authorization Rule
Every query on bookmarks MUST filter by user_id = current_authenticated_user_id taken from the verified server session—never from a user_id sent by the browser.
Phase 5: Project Setup (Including Database Setup)
(If you haven't set up a database before, read Lesson 5.3: Setting Up Your Database Locally first.)
- Initialize repo
bookmark-vault, set up.gitignore(excluding.env,node_modules/,.venv/), and create.env.example:PORT=3000DATABASE_URL=postgresql://user:password@localhost:5432/bookmark_vaultSESSION_SECRET=replace_with_a_long_random_string - Provision your development PostgreSQL database (choose the simplest option for your computer):
- Option A (Local PostgreSQL): Install PostgreSQL locally, start the service, and create one database (e.g.,
createdb bookmark_vault). - Option B (Free Cloud Dev Database — easiest if local installs give trouble): Create a free starter Postgres database in a hosting dashboard, copy its connection string, and paste it into your local
.envasDATABASE_URL(keeping separate dev and production databases later!).
- Option A (Local PostgreSQL): Install PostgreSQL locally, start the service, and create one database (e.g.,
- Create the tables (Run Initial Schema Migration):
- Ask your AI agent to generate a schema/migration script creating the
usersandbookmarkstables, run the migration command, and inspect the database to confirm both empty tables exist.
- Ask your AI agent to generate a schema/migration script creating the
- Verify connectivity: Add a
GET /api/healthroute that executes a tiny test query (likeSELECT 1) against Postgres so you know your app truly connects to the database before building any features. - Commit the clean starter skeleton to
main.
Phase 6: AI-Assisted Implementation (Vertical Slices)
Build strictly one slice at a time on separate feature branches:
- Branch 1 (
feat/auth-sessions):- Implement
POST /api/auth/signup,POST /api/auth/login,POST /api/auth/logout,GET /api/auth/me. - Verify yourself: Sign up with a test email, inspect the
userstable directly, and confirmpassword_hashis an unreadable hash (not your typed password!) and an HTTP-only cookie is set in Browser DevTools.
- Implement
- Branch 2 (
feat/create-list-bookmarks):- Implement
POST /api/bookmarks(with stricthttp:///https://URL validation!) andGET /api/bookmarks(scoped strictly toreq.user.id). - Connect the "Save a Link" form and Vault list UI, handling empty, loading, and invalid-URL errors.
- Implement
- Branch 3 (
feat/filter-toggle-delete):- Add
?q=search &?status=unreadfiltering inGET /api/bookmarks, plusPATCH /api/bookmarks/:idandDELETE /api/bookmarks/:idwithAND user_id = current_user_id.
- Add
Phase 7: Debugging, Security & Quality
Crucial Security Checks (Verify Every Single One!)
- Cross-User Isolation Test: Sign up as User A and save a bookmark (say ID
1). Log in as User B in an Incognito window and try sendingDELETE /api/bookmarks/1orPATCH /api/bookmarks/1. Verify the server rejects it (404/403) and User A's bookmark is untouched. - XSS / Unsafe URL Check: Try saving
javascript:alert(1)as a bookmark URL. Verify the backend rejects non-http(s)protocols with400and the frontend never executes user text as HTML. - SQL Injection Check: Inspect every database query in the diff—confirm 100% use parameterized placeholders (
$1, $2or?or an ORM), zero string concatenation. - Secret Leak Check: Search codebase (
git grep -i secret/ inspect files) to confirmSESSION_SECRETis read from environment variables with no weak hardcoded fallback in production.
Automated Integration Tests
- Signup with an already-registered email returns
409/400. - Unauthenticated
GET /api/bookmarksreturns401. - Saving a
javascript:alert(1)bookmark returns400. - User B attempting to delete User A's bookmark fails and preserves User A's record.
Phase 8: Git & Collaboration
- Review each PR diff on GitHub before merging (
feat/auth-sessions,feat/create-list-bookmarks,feat/filter-toggle-delete). - Keep commit messages clear (
feat(auth): hash passwords with bcrypt and issue httpOnly session cookie). - Run your full automated test suite after merging all slices into
main.
Phase 9: Deployment & Verification
- Provision a managed PostgreSQL database in your cloud host (separate from your local dev database).
- Add production environment variables (
DATABASE_URL, a newly generated 64-character randomSESSION_SECRET,NODE_ENV=production/ app env). - Run database migrations against the production database before or during app startup so
usersandbookmarkstables exist online. - Check cookie security flags for production HTTPS (
Secure,HttpOnly,SameSite=Lax). - Incognito Live Smoke Test:
- Sign up as a fresh user on
https://... - Log out and log back in (verifies session cookies work over HTTPS!)
- Save 2 bookmarks with tags, filter by tag, mark 1 read, refresh page, delete 1 -> confirm every state persists cleanly.
- Test on your phone over mobile data.
- Sign up as a fresh user on
Next Walkthrough: Project 3: RoomPulse — Real-Time Group Chat & Live Presence → | Practical Projects Index | Curriculum Index