A Vite frontend and Express/TypeScript API for user notes, authentication, admin user management, and analytics.
- Node.js 20 or later
- Docker Desktop (only for the local MongoDB option)
- A MongoDB Atlas database (only for the hosted option)
-
Start MongoDB:
docker compose up -d
-
Create
backend/.envfrombackend/.env.example, then enable the Docker database:USE_DOCKER_MONGODB=true MONGODB_URI_DOCKER=mongodb://localhost:27017/secure-notes
Set
JWT_SECRETto a long random value. KeepCORS_ORIGIN=http://localhost:5173for the Vite dev server. -
Create
frontend/.envfromfrontend/.env.example:VITE_API_URL=http://localhost:5000
-
In separate terminals, install and run both apps:
cd backend npm install npm run devcd frontend npm install npm run dev
Open the address printed by Vite, normally http://localhost:5173.
Stop the local database with docker compose down. Its data persists in the mongodb_data Docker volume.
From backend:
npm run dev
npm run build
npm startFrom frontend:
npm run dev
npm run build
npm run preview