A minimalist, secure notes application with client-side encryption, built with React, Redux (MVI pattern), and Node.js/Express.
- Client-side encryption: Notes are encrypted using AES-GCM before being sent to the server
- Offline support: Full offline functionality with IndexedDB and automatic sync
- Minimalist design: Black and white UI with Arial font
- Mobile-first: Optimized for iPhone
- Secure authentication: JWT-based authentication with bcrypt password hashing
- React 18 + TypeScript
- Redux Toolkit (MVI pattern)
- Vite
- Vitest + React Testing Library
- IndexedDB (via idb)
- Service Worker
- Node.js + Express + TypeScript
- PostgreSQL + Prisma
- JWT authentication
- bcryptjs for password hashing
- Node.js 18+
- PostgreSQL database
- npm or yarn
cd frontend
npm install
npm run dev- Create a
.envfile in thebackenddirectory:
DATABASE_URL="postgresql://user:password@localhost:5432/secure_notes?schema=public"
JWT_SECRET="your_jwt_secret_here"
PORT=3000- Run Prisma migrations:
cd backend
npm run prisma:generate
npm run prisma:migrate- Start the backend server:
npm run devcd frontend
npm test(Add test setup as needed)
- Install Vercel CLI (if not already installed):
npm i -g vercel- Deploy:
cd frontend
vercel- Set environment variable:
vercel env add VITE_API_URL
# Enter your backend API URL- Install Railway CLI (if not already installed):
npm i -g @railway/cli- Login to Railway:
railway login- Initialize and deploy:
cd backend
railway init
railway up- Set environment variables:
railway variables set DATABASE_URL="your-postgres-url"
railway variables set JWT_SECRET="your_jwt_secret_here"
railway variables set PORT=3000- Run database migrations:
railway run npm run prisma:migratesecure-notes/
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── store/ # Redux store (MVI Model)
│ │ ├── intents/ # MVI Intent layer
│ │ ├── models/ # Type definitions
│ │ ├── views/ # MVI View layer
│ │ └── services/ # Encryption, API, offline
│ └── public/
│ └── sw.js # Service Worker
├── backend/
│ ├── src/
│ │ ├── routes/ # API routes
│ │ ├── middleware/ # Auth middleware
│ │ └── server.ts
│ └── prisma/
│ └── schema.prisma
└── README.md
- Passwords are hashed on the backend using bcrypt
- Notes are encrypted client-side using Web Crypto API (AES-GCM)
- JWT tokens are used for authentication
- All API requests require authentication
- HTTPS should be used in production
ISC