Vi Notes is a full-stack writing-session manager with autosave, persistent DB storage, search/filter, tags, and private user notes.
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js + Express
- DB: MongoDB (Mongoose)
- Auth: JWT + bcrypt
client/frontend appserver/backend APIserver/src/modelsdatabase modelsclient/src/componentsreusable UI componentsclient/src/pagesapp pages
- Install dependencies:
npm install
npm install -w server
npm install -w client- Configure env files:
- Copy
server/.env.exampletoserver/.env - Copy
client/.env.exampletoclient/.env
- Start MongoDB (local or Atlas URI in
server/.env) - Run:
npm run dev- Client:
http://localhost:5173 - Server:
http://localhost:5000
Server (server/.env):
NODE_ENV=developmentPORT=5000MONGODB_URI= MongoDB connection stringJWT_SECRET= JWT signing secretCLIENT_ORIGIN= frontend URL
Client (client/.env):
VITE_API_URL=http://localhost:5000/api
Session
_iduserId(ObjectId refUser)title(string)content(string)wordCount(number)startTime(date)endTime(date|null)duration(seconds)tags(string[])lastEditedAt(date)createdAt(date)updatedAt(date)
Base URL: /api
Auth:
POST /auth/signup- body:
{ name, email, password }
- body:
POST /auth/login- body:
{ email, password }
- body:
Sessions (Bearer token required):
GET /sessions?q=&tag=&from=&to=list with search + filtersGET /sessions/tagslist tagsPOST /sessionscreate sessionGET /sessions/:idget onePUT /sessions/:idupdate (used by autosave)DELETE /sessions/:iddelete
Health:
GET /health
- Debounced autosave on typing stop (~1.2s)
- Timed autosave every 8s
- Manual Save button
- Live word count while typing
- Session duration recalculated server-side on update
- Export PDF/Markdown, streaks, goals, and offline sync can be added next as incremental modules.