A full-stack note-taking application built with the MERN stack (MongoDB, Express.js, React.js, Node.js) featuring Google OAuth authentication and modern UI design.
-
Traditional Email/Password Login
- User registration with email validation
- Secure password hashing with bcryptjs
- JWT token-based authentication
- Session management with HTTP-only cookies
-
Google OAuth Integration
- One-click Google sign-in
- Automatic user creation for new Google users
- Seamless integration with existing accounts
- Profile picture and name from Google account
-
Create Notes
- Rich text editor with formatting options
- Add tags for organization
- Auto-save functionality
- Real-time preview
-
Edit & Update
- In-place editing
- Version history tracking
- Bulk operations support
-
Search & Filter
- Real-time search across all notes
- Filter by tags
- Sort by date, title, or priority
- Advanced search with multiple criteria
-
Organization
- Tag-based categorization
- Color-coded notes
- Pin important notes
- Archive functionality
-
Modern Design
- Clean, responsive UI with Tailwind CSS
- Dark/Light theme support
- Mobile-first design approach
- Smooth animations and transitions
-
User Experience
- Intuitive navigation
- Toast notifications for feedback
- Loading states and error handling
- Keyboard shortcuts support
-
Data Protection
- Encrypted password storage
- JWT token validation
- CORS configuration
- Input sanitization
-
Session Management
- Secure HTTP-only cookies
- Automatic token refresh
- Session timeout handling
- Multi-device support
- React 18.3.1 - Modern UI library
- Redux Toolkit - State management
- React Router DOM - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client
- React Toastify - Toast notifications
- @react-oauth/google - Google OAuth integration
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB ODM
- JWT - JSON Web Tokens
- bcryptjs - Password hashing
- Passport.js - Authentication middleware
- Vite - Build tool and dev server
- ESLint - Code linting
- Nodemon - Development server
- PostCSS - CSS processing
Note-App-Using-MERN-Stack--main/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── Cards/ # Note and profile cards
│ │ │ ├── Input/ # Form input components
│ │ │ ├── SearchBar/ # Search functionality
│ │ │ └── GoogleLogin.jsx # Google OAuth component
│ │ ├── pages/ # Page components
│ │ │ ├── Home/ # Main dashboard
│ │ │ ├── Login/ # Authentication pages
│ │ │ └── Signup/
│ │ ├── redux/ # State management
│ │ │ ├── store.js # Redux store configuration
│ │ │ └── user/ # User state slice
│ │ └── utils/ # Utility functions
│ ├── package.json
│ └── vite.config.js
├── backend/ # Node.js backend application
│ ├── controller/ # Request handlers
│ │ ├── auth.controller.js # Authentication logic
│ │ └── note.controller.js # Note CRUD operations
│ ├── models/ # Database models
│ │ ├── user.model.js # User schema
│ │ └── note.model.js # Note schema
│ ├── routes/ # API routes
│ │ ├── auth.route.js # Authentication endpoints
│ │ └── note.route.js # Note endpoints
│ ├── utils/ # Utility functions
│ │ ├── error.js # Error handling
│ │ └── verifyUser.js # JWT verification
│ ├── index.js # Server entry point
│ └── package.json
└── README.md
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- Google OAuth credentials
-
Clone the repository
git clone <repository-url> cd Note-App-Using-MERN-Stack--main
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install -
Environment Setup
Backend (.env file in backend folder):
MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key
Frontend (.env file in frontend folder):
VITE_GOOGLE_CLIENT_ID=your_google_oauth_client_id
-
Google OAuth Setup
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API and Google OAuth2 API
- Create OAuth 2.0 credentials
- Add authorized origins:
http://localhost:5173 - Add authorized redirect URIs:
http://localhost:5173
-
Start the application
Backend:
cd backend npm run devFrontend:
cd frontend npm run dev -
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
POST /api/auth/signup- User registrationPOST /api/auth/signin- User loginPOST /api/auth/google- Google OAuth authenticationGET /api/auth/signout- User logout
GET /api/note/getnotes- Get all notes for userPOST /api/note/createnote- Create new notePUT /api/note/updatenote/:id- Update existing noteDELETE /api/note/deletenote/:id- Delete note
The app seamlessly integrates Google OAuth for enhanced user experience:
- One-Click Login: Users can sign in with their Google account
- Automatic Account Creation: New Google users get accounts created automatically
- Profile Integration: Google profile picture and name are imported
- Account Linking: Existing email users can link their Google account
- Instant Results: Search updates as you type
- Multi-field Search: Search across title, content, and tags
- Smart Filtering: Filter results by date, tags, or status
- Mobile-First: Optimized for all screen sizes
- Touch-Friendly: Gesture support for mobile devices
- Progressive Enhancement: Works on all modern browsers
- Password Security: All passwords are hashed using bcryptjs
- JWT Tokens: Secure token-based authentication
- CORS Protection: Configured for specific origins
- Input Validation: All user inputs are validated and sanitized
- HTTPS Ready: Configured for production HTTPS deployment
- Build the project:
npm run build - Deploy the
distfolder to your hosting platform - Set environment variables in your hosting platform
- Set up MongoDB Atlas for database
- Configure environment variables
- Deploy to your preferred platform
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
- Google OAuth for authentication
- Tailwind CSS for styling
- React community for excellent documentation
- MongoDB for database solution
Built with ❤️ using MERN Stack