Love-Journal

My Love Letters β€” Express + SQLite Journal πŸ’Œ

A romantic-themed journaling web app. Users register, log in to get a JWT, and then create/read/update/delete their own private β€œlove letters”. Styled with a soft pastel love theme featuring floating hearts, elegant script fonts, and a dreamy aesthetic.

Love Theme Preview License Tech DB

Features

Project Structure

journal-app/
β”œβ”€β”€ index.js                  # Server entry point + all routes + static file serving
β”œβ”€β”€ package.json
β”œβ”€β”€ public/
β”‚   └── index.html             # Full frontend: auth screens + entry editor (vanilla JS, no build step)
β”œβ”€β”€ db/
β”‚   β”œβ”€β”€ schema.sql             # Table definitions (user, entry)
β”‚   └── journal.db             # SQLite DB file (auto-created on first run)
└── middleware/
    β”œβ”€β”€ logger.js               # Logs query params on each request
    └── authenticateToken.js    # Verifies JWT, attaches request.userId

Setup

npm install
npm run dev      # uses nodemon, auto-restarts on file changes
# or
npm start

Server runs at http://localhost:3000/ β€” open that URL in a browser to use the app (register, log in, write/edit/delete entries). The same server also exposes the JSON API below if you want to hit it directly (curl, Postman, etc).

Love Theme Design Details

Frontend notes

API Reference

Auth

Register β€” POST /users/

{ "username": "rahul", "name": "Rahul", "password": "pass123", "gender": "Male", "location": "Hyderabad" }

Login β€” POST /login

{ "username": "rahul", "password": "pass123" }

Returns: { "jwtToken": "..." }

All /entries/ routes below require the header: Authorization: Bearer <jwtToken>

Journal Entries

Method Path Description
GET /entries/ List your entries (supports offset, limit, order, order_by, search_q)
GET /entries/:entryId/ Get a single entry
POST /entries/ Create an entry β€” body: { "title", "content", "mood" }
PUT /entries/:entryId/ Update an entry β€” same body as POST
DELETE /entries/:entryId/ Delete an entry

Example: list with filters

GET /entries/?limit=5&offset=0&order=DESC&order_by=date_created&search_q=grateful

Running the App

After starting the server, open http://localhost:3000 in your browser:

  1. Register a new account or log in if you already have one
  2. Click β€œNew love note” to start a new entry
  3. Add a title, select a mood, and write your thoughts
  4. Click β€œSave love note” to store it
  5. Search and browse your love letters from the sidebar

Notes