Skip to content

swnst/secure-note-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecureNote Application

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.

Features

  • 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.

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm or yarn

1. Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Install dependencies:
    npm install
  3. Create a .env file in the backend directory and add your configuration:
    PORT=3000
    SECRET_TOKEN=your_secret_password_here
    (Note: Never commit the .env file to version control)
  4. Start the server:
    npm start
    The backend will run on http://localhost:3000.

2. Frontend Setup

  1. Open a new terminal and navigate to the frontend directory:
    cd frontend
  2. Install dependencies:
    npm install
  3. Create a .env file in the frontend directory:
    VITE_API_URL=http://localhost:3000/api/notes
  4. Start the development server:
    npm run dev
  5. Open your browser and go to the local URL provided by Vite (usually http://localhost:5173).

Usage

  • 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_TOKEN from the .env file into the UI.
    • In Instructor Mode, enter the external target database token (e.g., 20260301eink).
  • The Express.js backend acts as a secure proxy, automatically handling the formatting of the Authorization header (injecting the Bearer prefix) and fulfilling schema requirements before reaching the upstream PocketHost server.

About

A secure, full-stack React and Node.js application featuring dynamic data routing (Local FS & PocketHost API), secure CRUD operations, and modern UI/UX.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors