A Pinterest-style image-sharing single-page app built with React 19 + Vite. Frontend-only with a mock data layer — no real backend required.
npm install
npm run devThe dev server runs at http://localhost:5173/.
| Field | Value |
|---|---|
jenischristan@email.com |
|
| Password | password123 |
You can also sign up for a new account at /signup.
| Command | Description |
|---|---|
npm run dev |
Start the Vite dev server |
npm run lint |
Run ESLint |
npm run build |
Production build to dist/ |
npm run preview |
Preview the production build |
No tests or typecheck are configured.
- Feed — masonry home feed with responsive column widths
- Explore — search posts and creators, trending tags
- Post view — likes, comments (with sorting), bookmark, follow, share/download/report
- Bookmarks — saved posts, persisted to the mock store
- Profile — own and other users' profiles, follow/unfollow, follow requests for private accounts, block/unblock
- Notifications — follow requests with accept/decline, mark-all-read, clear-all
- Create — new post form
- Settings — edit profile, account visibility, change password, deactivate/delete account
- Auth — login, signup, logout, route guards, session persisted in
localStorage
src/
├── app/AppRoutes.jsx # All routes + auth guards + 404
├── layouts/AppLayout.jsx # SideNavBar + TopBar + Outlet
├── pages/<Name>/ # One folder per page (JSX + CSS)
├── components/
│ ├── layout/ # TopBar, SideNavBar
│ └── ui/ # Toast, Modal, ConfirmDialog, Grainient
├── mocks/
│ ├── api.js # All data reads/writes (single source of truth)
│ ├── store.js # Pub/sub store over fixture arrays
│ ├── auth.js # Session (localStorage), login/signup/logout
│ └── data/ # Static fixtures: users, posts, comments, ...
├── hooks/ # useMockData, useClickOutside, useMasonryColumnWidth
└── utils/ # date/time/count formatters, shareActions
- Data: every page reads through
src/mocks/api.js. Mutations go through the same module and notify subscribers; components re-render viauseMockData()(auseSyncExternalStorewrapper). - Session: current user id is stored in
localStorageunderfable_session_user_id. Passwords live only in the mock credentials fixture. - Routing: all routes live in
src/app/AppRoutes.jsx./loginand/signupare standalone; everything else nests underAppLayoutbehindRequireAuth.
server/is a separate Express stub (port 5000) not wired to the frontend — ignore it.- Mock images come from
picsum.photos. - Two router packages are installed (
react-routerv8,react-router-domv7). All imports usereact-router-dom.