A lightweight, secure full-stack web application for managing text notes. Built with React (Frontend) and Express.js (Backend) to demonstrate client-server architecture, secure communication, and dynamic data routing.
- Two-Way Data Routing: Seamlessly switch between Local File System (Public Mode) and PocketHost API (Instructor Mode).
- Dynamic Authentication: Handles multiple authorization contexts securely via backend middleware.
- Modern UI/UX: Features Dark Mode, Grid Layout, Markdown support, and Optimistic UI updates.
- Node.js (v16 or higher recommended)
- npm or yarn
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install
- Create a
.envfile in thebackenddirectory and add your configuration:(Note: Never commit thePORT=3000 SECRET_TOKEN=your_secret_password_here
.envfile to version control) - Start the server:
The backend will run on
npm start
http://localhost:3000.
- Open a new terminal and navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Create a
.envfile in thefrontenddirectory:VITE_API_URL=http://localhost:3000/api/notes
- Start the development server:
npm run dev
- Open your browser and go to the local URL provided by Vite (usually
http://localhost:5173).
- The application features Two-Way Data Routing: Public Mode (Local FS) and Instructor Mode (PocketHost API).
- Authentication Requirement: For security compliance, all data mutation operations (Create, Update, Delete) strictly require a valid token.
- Dynamic Token Injection: - In Public Mode, enter your local
SECRET_TOKENfrom the.envfile into the UI.- In Instructor Mode, enter the external target database token (e.g.,
20260301eink).
- In Instructor Mode, enter the external target database token (e.g.,
- The Express.js backend acts as a secure proxy, automatically handling the formatting of the
Authorizationheader (injecting theBearerprefix) and fulfilling schema requirements before reaching the upstream PocketHost server.