A full-stack notes application with separate frontend and backend architecture, featuring OTP-based authentication and CRUD operations for notes.
- React 18 - UI Library
- TypeScript - Type safety
- Vite - Build tool and development server
- React Router DOM - Client-side routing
- TailwindCSS - Utility-first CSS framework
- Radix UI - Headless UI components
- Lucide React - Icon library
- React Hook Form - Form handling
- Zod - Schema validation
- Express.js - Web framework
- MongoDB/Mongoose - Database
- JWT - Authentication
- Nodemailer - Email service
- bcryptjs - Password hashing
- CORS - Cross-origin resource sharing
├── backend/ # Backend API server
│ ├── middleware/ # Express middleware
│ ├── models/ # MongoDB models
│ ├── .env.example # Environment variables template
│ ├── package.json # Backend dependencies
│ ├── server.js # Main server file
│ └── README.md # Backend documentation
├── frontend/ # Frontend React app
│ ├── src/ # React source code
│ │ ├── components/ # Reusable UI components
│ │ │ ├── auth/ # Authentication components
│ │ │ ├── dashboard/ # Dashboard components
│ │ │ └── ui/ # Base UI components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # Utility functions
│ │ ├── pages/ # Page components
│ │ ├── App.tsx # Main app component
│ │ └── main.tsx # Entry point
│ ├── public/ # Static assets
│ ├── .env # Frontend environment variables
│ ├── package.json # Frontend dependencies
│ └── README.md # Frontend documentation
├── start-dev.bat # Windows batch startup script
├── start-dev.ps1 # PowerShell startup script
└── README.md # This file
- Node.js (v14 or higher)
- MongoDB (local or MongoDB Atlas)
- SMTP email service (for OTP delivery)
-
Navigate to backend directory:
cd backend -
Install backend dependencies:
npm install
-
Create environment file:
cp .env.example .env
-
Configure your
.envfile with:- MongoDB connection string
- SMTP email settings
- JWT secret
- Other configurations
-
Start backend development server:
npm run dev
-
Navigate to frontend directory:
cd frontend -
Install frontend dependencies:
npm install
-
Configure environment variables: The
.envfile should already contain:VITE_BASE_URL=http://localhost:3001/api
-
Start frontend development server:
npm run dev
-
Start the backend server:
cd backend && npm run dev
Backend will run on: http://localhost:3001
-
Start the frontend server (in another terminal):
cd frontend && npm run dev
Frontend will run on: http://localhost:5173
- OTP-based signup and signin
- JWT token authentication
- Email verification
- Protected routes
- Create, read, update, delete notes
- Tag notes for organization
- Mark notes as important
- Search and filter functionality
- Responsive design
- Modern UI with Radix components
- Toast notifications
- Loading states
- Error handling
/- Dashboard (protected)/signin- User sign in page/signup- User sign up page
POST /api/send-signup-otp- Send signup OTPPOST /api/send-signin-otp- Send signin OTPPOST /api/verify-signup-otp- Verify signup OTPPOST /api/verify-signin-otp- Verify signin OTPGET /api/notes- Get user notes (protected)POST /api/notes- Create note (protected)PUT /api/notes/:id- Update note (protected)DELETE /api/notes/:id- Delete note (protected)
VITE_BASE_URL=http://localhost:3001/api
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
SMTP_HOST=your_smtp_host
SMTP_PORT=your_smtp_port
SMTP_USER=your_email
SMTP_PASS=your_email_password
ADMIN_EMAIL=your_admin_email
APP_NAME=Notes App
PORT=3001
cd frontend
npm run build
npm run previewcd backend
npm start- Backend: Deploy the
backend/folder to your server (Heroku, Railway, etc.) - Frontend: Deploy the
frontend/folder to a static hosting service (Vercel, Netlify, etc.) - Update the
VITE_BASE_URLin frontend.envto point to your production backend URL
- Add unit tests for both frontend and backend
- Implement note sharing functionality
- Add file attachments to notes
- Implement real-time synchronization
- Add mobile app with React Native
- Set up CI/CD pipeline
- Add Docker containerization
Happy coding! 🎉