Learn from the people you follow: share short lessons, tap "Remember this" on the ones worth keeping, and Sharewise brings them back for review right before you would forget them.
Live app: https://sharewise.vercel.app · API: https://sharewise-api.vercel.app/api
Log in with any seeded demo account. Every account uses the password sharewise123.
| Name | Password | What to try | |
|---|---|---|---|
| Maya Chen | maya@sharewise.dev |
sharewise123 |
Clear her review queue: swipe a card right for "Got it" or left for "Forgot", or use the keys. Then check her streak and the heatmap on Stats. Her JavaScript lessons have highlighted code with a copy button, and she curates the "JavaScript gotchas" deck. |
| Omar Haddad | omar@sharewise.dev |
sharewise123 |
Write a lesson with markdown and a code snippet, using the Write/Preview toggle. Open his "Git rescue kit" deck and add another lesson to it with Add to deck. |
| Priya Nair | priya@sharewise.dev |
sharewise123 |
The most consistent reviewer, so her profile heatmap is the fullest. Answer a multiple-choice quiz on Review with the lettered keys. She owns the "Interview patterns" deck. |
| Sam Okafor | sam@sharewise.dev |
sharewise123 |
A light reviewer with CSS lessons. Open Lena's "Career habits" deck and tap Remember all to fill his queue in one go. |
| Lena Vogel | lena@sharewise.dev |
sharewise123 |
Her older review history is weekdays only, which shows on her heatmap. Her career lessons include text-answer quizzes. She curates the "Career habits" deck. |
Anyone can also sign up for a new account; after sign-up Sharewise suggests people to follow. Signed in with a demo account, visit /restore and confirm Restore demo data to reset the demo community. Opening the page alone changes nothing. npm run seed initializes the demo accounts locally (see Getting started).
| Lesson with code (desktop) | Stats (desktop) |
|---|---|
![]() |
![]() |
| Review (mobile) | Profile (mobile) |
|---|---|
![]() |
![]() |
Share a lesson ──> Others tap "Remember this" ──> Card due tomorrow ──> Review: Got it / Forgot
^ │
└── next due date ◄───────┘
│
streaks, mastered count, Stats ◄┘
- Share. Anyone writes a short lesson: a title, a markdown body, and optionally a code snippet, a link, up to five tags and a quiz (a text answer or 2-4 choices).
- Remember. Readers tap Remember this on a lesson worth keeping (not their own). That creates a review card due the next day. Decks let you remember a whole collection at once.
- Review. Due cards show up on the Review screen and mixed into the Feed. You answer by grading yourself ("Got it" or "Forgot") or by answering the lesson's quiz, which the server grades.
- Space it out. A binary-grade SM-2 variant schedules the next review. Each "Got it" in a row pushes the card out to 3 days, then 7, then 30, then roughly
interval × ease(ease starts at 2.5). A "Forgot" sends it back to tomorrow and lowers its ease. Cards come due at local midnight in your time zone. - Track it. A card is mastered once its interval reaches 21 days. Your streak counts consecutive days, in your time zone, on which you answered at least one review. Stats, profiles and the activity heatmap all count answered reviews.
The Feed mixes one due review with two new lessons, repeating; of the new lessons, two come from people you follow for every one from someone else. Lessons you already remember come back only as reviews.
The full rules, data shapes and endpoints are in the API reference: backend/API.md.
The UI is mobile-first: a bottom tab bar on phones, an icon rail on tablets and a full sidebar on desktop, in light and dark mode.
- Feed: due reviews mixed with new lessons from people you follow and from the rest of the community, with a count of reviews due today.
- Explore: every lesson, newest first, filterable by tag, plus a Popular decks row. Explore and deck pages work without logging in.
- Lessons: bodies render as safe markdown (lists, bold, italic, inline code, links and fenced code blocks), with syntax-highlighted code and a copy button. The composer has a Write/Preview toggle and a card preview. Authors see their quiz answer; readers see it after they answer.
- Review: one card at a time with progress. Swipe right for "Got it" and left for "Forgot", or use the keys: Space/Enter to show the lesson,
1/←/Ffor Forgot,2/→/Gfor Got it,A-Dor1-4for a quiz choice, and Enter for the next card. - Decks: curated, ordered collections of up to 50 lessons by anyone, with an emoji and a cover colour. Remember all adds every lesson you do not remember yet in one tap. Add lessons from any lesson page with Add to deck.
- Stats: current and best streak, mastered and due counts, reviews this week by day, a twelve-week review activity heatmap, the most remembered lessons, top teachers and community totals.
- Profiles: bio, streak and mastered count, the review activity heatmap, the user's decks, and lessons, followers and following tabs. Follow or unfollow from here.
- Account: sign up, log in, edit your name, handle, bio and time zone.
| Layer | Stack |
|---|---|
| Frontend | React 19, Vite 8, Chakra UI 3, React Router 7, TanStack React Query 5, Axios 1, highlight.js 11, React Icons 5, ESLint 10 |
| Backend | Node.js 22, Express 5, Mongoose 9, JWT (jwt-simple), bcryptjs 3, Winston 3 |
| Database | MongoDB (MongoDB Atlas in production) |
| Tests | node:test, Supertest, mongodb-memory-server |
| Hosting | Vercel (two projects: frontend and backend) |
- Node.js 22.12 or later, with npm
- MongoDB running locally, or a MongoDB Atlas connection string
- Git
git clone https://github.com/itsApurba/sharewise.git
cd sharewise
(cd backend && npm install)
(cd frontend && npm install)Backend: copy the example file and adjust it.
cp backend/.env.example backend/.env| Variable | Default in .env.example |
Notes |
|---|---|---|
NODE_ENV |
development |
|
PORT |
3939 |
|
JWT_SECRET |
supersecret |
Use a long random value, e.g. openssl rand -base64 48. |
JWT_EXPIRATION_MINUTES |
10080 |
Session lifetime (one week). |
MONGO_URI |
mongodb://mongodb:27017/test |
The mongodb host is for Docker. For a local MongoDB use e.g. mongodb://localhost:27017/sharewise. MONGODB_URI also works. |
CORS_ORIGIN |
empty | Comma-separated allowed origins. Empty allows all. |
Frontend: copy its example file. VITE_BACKEND_URL is the backend origin without /api; the app appends /api itself.
cp frontend/.env.example frontend/.env # VITE_BACKEND_URL=http://localhost:3939cd backend
npm run seedThis loads the five demo accounts above with 26 lessons, 4 decks, follows, and twelve weeks of review history, so streaks, the heatmaps, mastered lessons and due reviews exist on the first day. It upserts the demo users, lessons and decks and rebuilds their follows, cards and history relative to now, without touching other users, so run it again any time to reset the demo.
In two terminals:
cd backend && npm run dev # API on http://localhost:3939/api
cd frontend && npm run dev # app on http://localhost:5173Open http://localhost:5173 and log in with a demo account.
cd backend && npm test # starts its own in-memory MongoDB, no .env needed
cd frontend && npm run lintSharewise deploys as two Vercel projects from this repository. Create each with Add New → Project, import the repo, and set its Root Directory.
backend/api/index.js is the serverless function and backend/vercel.json rewrites /api/* to it, so routes stay at https://<backend>.vercel.app/api/.... Each instance connects to MongoDB once and reuses the connection on warm requests. A missing required variable or an unreachable database answers 503, and the function log says which.
Set these under Settings → Environment Variables, then redeploy:
| Variable | Required | Value |
|---|---|---|
MONGO_URI or MONGODB_URI |
yes | Atlas connection string including the database name, e.g. mongodb+srv://user:pass@cluster.mongodb.net/sharewise. The Vercel MongoDB Atlas integration sets MONGODB_URI for you. If both are set, MONGO_URI wins. |
JWT_SECRET |
yes | A long random value, e.g. openssl rand -base64 48. Changing it logs everyone out. |
JWT_EXPIRATION_MINUTES |
no | Session lifetime in minutes (default one week). |
CORS_ORIGIN |
no | Comma-separated allowed origins, e.g. https://sharewise.vercel.app. Unset allows every origin. |
NODE_ENV |
no | Vercel already runs functions with production. |
MongoDB Atlas: Vercel functions have no fixed outbound IP. Under Network Access, allow 0.0.0.0/0 (access from anywhere) so the function can connect. The integration may do this for you.
Demo data (one time): seed Atlas from your machine. A variable set in the shell wins over backend/.env:
cd backend
npm install
MONGODB_URI='mongodb+srv://user:pass@cluster.mongodb.net/sharewise' npm run seedThe feature uses MongoDB transactions (Atlas or a local replica set). Both /restore and the scheduler use the same atomic restore service. It reuses backend/src/seed/data.js and the seed's review simulator, retaining registered user/lesson/deck IDs. Demo profiles, authored lessons, owned decks, outgoing follows, cards, quiz answers and review logs are restored; extra demo-owned records are removed. Other users' records are never cascaded or reset, including their references to demo lessons. Removing an extra demo lesson can leave those references pointing to a removed lesson; preservation here means retaining other users' reference rows, not rewriting their collections. Password hashes and existing sessions are preserved.
npm run seed now registers demo identities. Existing deployments can bootstrap this private registry automatically only when all five immutable fixture emails and their seeded passwords are present. If identity cannot be established, restoration fails closed with 409 DEMO_IDENTITY; do not run a destructive seed against live data to work around it. Resolve the missing identity/handle collision explicitly. The registry also keeps the original password hash for recreating a deleted demo account; protect it like the users collection. Fixture emails are reserved from public sign-up.
To enable the hourly schedule after deploying the backend:
- Set backend
CRON_SECRETto a long random secret (separate fromJWT_SECRET). - Set GitHub Actions repository variable
SHAREWISE_DEMO_RESTORE_URLtohttps://<backend>/api/restore/hourly. - Set Actions repository secret
SHAREWISE_DEMO_RESTORE_SECRETto that sameCRON_SECRETvalue. - Enable
.github/workflows/restore-demo.ymlon the default branch. It runs at minute 17 every hour and can also be dispatched manually. Missing configuration fails visibly. No deployment or scheduler configuration is performed by the app itself.
GitHub Actions works with either Vercel plan (Hobby's native cron cannot run hourly). Scheduled jobs may be delayed by GitHub and may be disabled after prolonged repository inactivity; monitor the workflow. The authenticated endpoint checks at most once per UTC hour, including across serverless instances. It fingerprints only the five indexed demo ownership slices, detecting edits, deletions and additions even outside the API; no database-wide scan or process-local timer is used. When unchanged it writes only small scheduler metadata, not demo data. When changed it rebuilds the original fixtures relative to now inside one transaction. The last restored dates stay put until data changes. Concurrent restores serialize and become no-ops after the winner commits. Do not manually edit the private demostates registry.
Vercel detects Vite and builds dist. frontend/vercel.json rewrites every path to index.html, so deep links such as /stats or /deck/<id> load the app instead of a 404.
| Variable | Required | Value |
|---|---|---|
VITE_BACKEND_URL |
yes | The backend origin without /api, e.g. https://<backend>.vercel.app. The app appends /api itself. |
VITE_BACKEND_URL is compiled into the bundle, so redeploy the frontend after changing it, then set the backend's CORS_ORIGIN to the frontend's URL.
The backend API is documented in backend/API.md: auth, users and follows, lessons and quizzes, remembering and reviews, decks, the feed, analytics, and the spaced-repetition, feed-mixing and streak rules.



