A comprehensive full-stack CRUD application demonstrating modern client-server architecture with advanced features like search, sorting, pagination, optimistic concurrency control, bulk operations, and real-time statistics. Built with vanilla JavaScript and Node.js without external dependencies, showcasing professional web development practices.
- Modern UI/UX: Clean, responsive design with light/dark theme toggle
- Advanced Search: Real-time search across multiple fields (title, author, ID, tags)
- Smart Sorting: Click-to-sort on any column with visual indicators
- Pagination: Efficient navigation through large datasets with customizable page sizes
- Optimistic Concurrency: Version-based conflict resolution for safe updates
- Bulk Operations: Import/export JSON data with replace or append modes
- Real-time Statistics: Live dashboard showing book counts, ratings, top authors/tags
- Progressive Enhancement: Works offline once loaded, graceful degradation
- RESTful API: Clean, well-structured endpoints following REST conventions
- Atomic Persistence: Safe file-based storage with atomic writes
- ETag/304 Support: Efficient caching with conditional requests
- Rate Limiting: Built-in protection against abuse (100 req/5min per IP)
- CORS Enabled: Cross-origin resource sharing for flexible deployment
- Access Logging: Comprehensive request logging for monitoring
- Health Monitoring: Dedicated health check endpoint
- Data Migration: Automatic schema migration for backwards compatibility
- Full CRUD Operations: Create, Read, Update, Delete with validation
- Rich Book Model: ID, title, author, year, rating, tags, timestamps, versioning
- Flexible Querying: Search, sort, paginate with URL-based parameters
- Data Validation: Comprehensive input validation with detailed error messages
- Version Control: Optimistic concurrency control prevents data conflicts
- Bulk Import: JSON file import with error handling and conflict resolution
- Core: HTML5, CSS3, Vanilla JavaScript (ES6+)
- Styling: CSS Grid, Flexbox, CSS Custom Properties (Variables)
- Responsive Design: Mobile-first approach with breakpoint-based layouts
- Theme System: CSS-based light/dark theme with localStorage persistence
- Modern APIs: Fetch API, File API, Blob API for modern web functionality
- Runtime: Node.js (built-in modules only)
- HTTP Server: Native Node.js HTTP module
- File System: Atomic file operations with temporary files
- Security: Rate limiting, CORS headers, input validation
- Data Storage: JSON file-based persistence with migration support
- Zero Dependencies: No external packages required (frontend or backend)
- Vanilla JavaScript: Pure JS without frameworks for maximum compatibility
- Progressive Enhancement: Core functionality works without JavaScript
- Accessibility: Semantic HTML, ARIA attributes, keyboard navigation
- Performance: Efficient DOM manipulation, debounced search, lazy loading
The application follows a clean separation between client and server:
Frontend (Client):
- Pure HTML/CSS/JS single-page application
- RESTful API consumption via Fetch API
- State management through JavaScript objects
- Real-time UI updates with optimistic rendering
- Client-side validation and error handling
Backend (Server):
- Lightweight Node.js HTTP server
- File-based JSON storage with atomic writes
- RESTful API with proper HTTP status codes
- Built-in rate limiting and CORS support
- Comprehensive error handling and logging
- Client Actions: User interactions trigger API calls
- Server Processing: Validation, business logic, persistence
- Response Handling: Client updates UI based on server response
- State Synchronization: Real-time updates across multiple tabs/clients
- Node.js (v14+ recommended)
- Modern web browser (Chrome, Firefox, Edge, Safari)
-
Clone the repository:
git clone https://github.com/yourusername/client-server-pro-demo.git cd client-server-pro-demo -
Start the server:
node server.js
-
Open your browser: Navigate to
http://localhost:8080
client-server-pro-demo/
โโโ server.js # Node.js backend server
โโโ public/ # Static client assets
โ โโโ index.html # Main HTML file
โ โโโ app.js # Client-side JavaScript
โ โโโ styles.css # Styling and themes
โโโ data.json # Persistent data storage
โโโ README.md # This file
GET /api/health- Server health checkGET /api/stats- Book statistics and analyticsGET /api/books- List books with search/sort/paginationGET /api/books/:id- Get specific bookPOST /api/books- Create new bookPUT /api/books/:id- Update existing bookDELETE /api/books/:id- Delete bookPOST /api/books/bulk- Bulk import/replace books
- Adding Books: Fill out the form and click "Create"
- Editing Books: Click "Edit" on any row, modify, then click "Update"
- Deleting Books: Click "Delete" and confirm the action
- Searching: Type in the search box to filter results in real-time
- Sorting: Click column headers to sort (click again to reverse)
- Pagination: Use page size dropdown and navigation buttons
- Theme Toggle: Switch between light and dark themes
- Export Data: Download all books as JSON file
- Import Data: Upload JSON files to bulk import books
- Version Control: Updates check version numbers to prevent conflicts
- Multi-tab Support: Open multiple tabs to simulate multiple users
Books support the following fields:
{
"id": "string (auto-generated if not provided)",
"title": "string (required)",
"author": "string (optional)",
"year": "number (optional)",
"rating": "number 0-5 (optional)",
"tags": ["array", "of", "strings"] (optional),
"createdAt": "ISO date string",
"updatedAt": "ISO date string",
"version": "number (for concurrency control)"
}
- Authentication: User login/logout with JWT tokens
- Real-time Updates: WebSocket integration for live synchronization
- Advanced Search: Full-text search with fuzzy matching
- Data Visualization: Charts and graphs for book analytics
- File Attachments: Support for book covers and documents
- Backup System: Automated backups and restore functionality
- Performance: Database integration (SQLite/PostgreSQL)
- Deployment: Docker containerization and cloud deployment guides
- Testing: Unit and integration test suites
- TypeScript: Type safety for enhanced development experience
- PWA Support: Service workers for offline functionality
- Performance: Virtual scrolling for large datasets
- Security: Enhanced validation, sanitization, and HTTPS
- Monitoring: Application metrics and error tracking
This Client-Server Pro Demo was created by Shuddha Chowdhury (@shuddha2021) as a comprehensive demonstration of modern web development practices, showcasing both frontend and backend skills in building scalable, maintainable applications.
Portfolio: shuddha2021.vercel.app
GitHub: github.com/shuddha2021
This project is open-source and available under the MIT License. Feel free to use, modify, and distribute according to your needs.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Note: Open multiple browser tabs to simulate multiple clients and observe real-time synchronization and optimistic concurrency control in action!