A serverless notebook app built with React, Vite, MongoDB, and Vercel API routes. Users can create, edit, and delete notes with a title and content.
- React + Vite frontend
- MongoDB persistence
- Strictly serverless backend on Vercel
- Create, edit, and delete notebook entries
- Responsive, polished UI
- Install dependencies:
npm install- Create a
.env.localfile with your MongoDB connection string:
MONGODB_URI="your-mongodb-connection-string"
MONGODB_DB="notebook"
AUTH_USERNAME="your-username"
AUTH_PASSWORD="your-password"
AUTH_SECRET="generate-a-long-random-secret"- Start the local frontend:
npm run devThis starts Vite on port 5173 and Vercel's local function emulator on port 3000, with the frontend proxying /api requests to the emulator. Sign in with the username and password from your environment variables.
- Push this repository to GitHub.
- Import it into Vercel.
- Add
MONGODB_URI,MONGODB_DB,AUTH_USERNAME,AUTH_PASSWORD, andAUTH_SECRETas environment variables in Vercel. - Deploy with the default build command
npm run build.
GET /api/notebooksreturns all notes.POST /api/notebookscreates a note.GET /api/notebooks/:idreturns one note.PATCH /api/notebooks/:idupdates a note.DELETE /api/notebooks/:idremoves a note.