A modern, full-stack digital notes application with React frontend and Node.js/Express backend, featuring real-time synchronization, user authentication, and comprehensive note management.
- Modern UI: Built with React, Tailwind CSS, and ShadCN UI components
- Responsive Design: Works seamlessly on desktop and mobile devices
- Real-time Updates: Instant synchronization with backend API
- Rich Text Editing: Advanced note editor with formatting support
- Smart Organization: Folders, tags, and search functionality
- Authentication: Secure JWT-based user authentication
- RESTful API: Complete CRUD operations for notes, folders, and tags
- MySQL Database: Robust data persistence with relational structure
- JWT Authentication: Secure user authentication and authorization
- Error Handling: Comprehensive error handling and validation
- CORS Support: Cross-origin resource sharing for frontend integration
Before running this application, make sure you have:
- Node.js (v16 or higher)
- MySQL (v8.0 or higher)
- npm or yarn package manager
git clone <repository-url>
cd Digital-Notescd digi-notes-backend
npm install- Create a MySQL database named
digi_notes - Copy environment variables:
cp .env.example .env- Update
.envfile with your database credentials:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=digi_notes
JWT_SECRET=your-super-secret-jwt-key-here-change-this-in-production
JWT_EXPIRES_IN=7d
FRONTEND_URL=http://localhost:8080npm run devThe backend will run on http://localhost:3001
cd ../digi-notes
npm install- Copy environment variables:
cp .env.example .env- Update
.envfile:
VITE_API_URL=http://localhost:3001/api
npm run devThe frontend will run on http://localhost:8080
The application uses the following database structure:
- users: User accounts and authentication
- folders: User-created folders for organizing notes
- notes: Individual notes with content and metadata
- tags: User-created tags for categorizing notes
- note_tags: Junction table for many-to-many note-tag relationships
- Foreign Key Constraints: Ensures data integrity
- Indexes: Optimized for performance
- Cascading Deletes: Automatic cleanup of related data
POST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/notes- Get all user notesGET /api/notes/:id- Get specific notePOST /api/notes- Create new notePATCH /api/notes/:id- Update noteDELETE /api/notes/:id- Delete notePATCH /api/notes/:id/pin- Toggle pin statusPATCH /api/notes/:id/archive- Toggle archive status
GET /api/folders- Get all user foldersPOST /api/folders- Create new folderPATCH /api/folders/:id- Update folderDELETE /api/folders/:id- Delete folder
GET /api/tags- Get all user tagsGET /api/tags/popular- Get popular tagsPOST /api/tags- Create new tagDELETE /api/tags/:id- Delete tag
- Registration/Login: User creates account or logs in
- JWT Token: Server returns JWT token upon successful authentication
- Token Storage: Frontend stores token in localStorage
- Authenticated Requests: All API requests include JWT token in Authorization header
- Auto-logout: Invalid/expired tokens trigger automatic logout
- AuthScreen: Handles user registration and login
- Index: Main application container with state management
- NoteEditor: Rich text editor for creating/editing notes
- NotesGrid: Grid view of all notes with filtering
- AppSidebar: Navigation sidebar with folders and tags
- React Hooks: useState and useEffect for local state
- API Client: Centralized API communication layer
- Error Handling: Global error handling with user feedback
cd digi-notes-backend
npm run dev # Uses nodemon for auto-restartcd digi-notes
npm run dev # Vite dev server with hot reloadnpm start # Production servernpm run build # Creates dist/ folder
npm run preview # Preview production build- Set up MySQL database on production server
- Update environment variables for production
- Run database initialization script
- Deploy using PM2, Docker, or your preferred method
- Update
VITE_API_URLto production backend URL - Build the application:
npm run build - Deploy
dist/folder to static hosting (Netlify, Vercel, etc.)
- Verify MySQL is running
- Check database credentials in
.env - Ensure database
digi_notesexists
- Verify
FRONTEND_URLin backend.env - Check API URL in frontend
.env
- Clear localStorage and try logging in again
- Verify JWT_SECRET is set in backend
.env
- Ensure backend server is running on correct port
- Check network connectivity between frontend and backend
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and commit:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue in the GitHub repository or contact the development team.
Happy note-taking! πβ¨