π A scalable web application with authentication and dashboard functionality built with React.js and Node.js.
frontend-intern-assignment/
βββ frontend/ # React.js + TypeScript application
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ context/ # React context for state management
β β βββ services/ # API service layer
β β βββ types/ # TypeScript type definitions
β βββ package.json
βββ backend/ # Node.js/Express API
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ middleware/ # Custom middleware
β βββ server.js
βββ postman_collection.json # API testing collection
βββ SCALING.md # Production scaling strategy
βββ README.md
β Authentication & Security
- JWT-based authentication with bcrypt password hashing
- Protected routes and middleware
- Form validation (client + server side)
- Secure token storage
β Dashboard Functionality
- User profile management
- CRUD operations on tasks
- Real-time search and filtering
- Responsive design with TailwindCSS
β Technical Implementation
- React.js with TypeScript
- Node.js/Express backend
- MongoDB database
- RESTful API design
- Error handling and validation
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn package manager
git clone <repository-url>
cd frontend-intern-assignmentcd backend
npm install
# Start MongoDB (if running locally)
# mongod
# Start the backend server
npm run devBackend will run on http://localhost:5001
cd frontend
npm install
# Install TailwindCSS
npx tailwindcss init -p
# Start the frontend application
npm startFrontend will run on http://localhost:3000
The project is pre-configured with MongoDB Atlas. Check backend/.env for connection details:
PORT=5001
MONGODB_URI=mongodb+srv://[configured]
JWT_SECRET=[configured]
NODE_ENV=developmentPOST /api/auth/register- User registrationPOST /api/auth/login- User login
GET /api/profile- Get user profile (Protected)PUT /api/profile- Update user profile (Protected)
GET /api/tasks- Get user tasks with optional filters (Protected)POST /api/tasks- Create new task (Protected)PUT /api/tasks/:id- Update task (Protected)DELETE /api/tasks/:id- Delete task (Protected)
search- Search in title and descriptionstatus- Filter by status (pending, in-progress, completed)priority- Filter by priority (low, medium, high)
Run the included test script:
node generate_logs.js- Import
postman_collection.jsoninto Postman - Register a new user or login
- Copy the JWT token from the response
- Set the
tokenvariable in Postman environment - Test all protected endpoints
Application generates comprehensive logs:
backend_application.log- Server and API logstest_logs.txt- Automated API testing results
- Password hashing with bcryptjs (12 rounds)
- JWT tokens with 7-day expiration
- Input validation and sanitization
- Protected routes with authentication middleware
- CORS configuration
- Error handling without sensitive data exposure
See SCALING.md for detailed production deployment and scaling strategies including:
- Docker containerization
- Database optimization
- Caching strategies
- Load balancing
- Monitoring and alerting
- Cost optimization
Frontend:
- React.js 18 with TypeScript
- React Router for navigation
- Axios for API calls
- TailwindCSS for styling
- Context API for state management
Backend:
- Node.js with Express.js
- MongoDB with Mongoose ODM
- JWT for authentication
- bcryptjs for password hashing
- express-validator for input validation
Frontend Requirements:
- β React.js with TypeScript
- β Responsive design with TailwindCSS
- β Form validation (client + server)
- β Protected routes with authentication
Backend Requirements:
- β Node.js/Express lightweight backend
- β JWT-based authentication APIs
- β Profile fetching/updating endpoints
- β CRUD operations on tasks entity
- β MongoDB database integration
Dashboard Features:
- β User profile display
- β Task CRUD operations
- β Search and filter functionality
- β Secure logout flow
Security & Scalability:
- β bcrypt password hashing
- β JWT authentication middleware
- β Comprehensive error handling
- β Modular code structure for scaling
Frontend Scaling:
- CDN deployment for static assets
- Code splitting and lazy loading
- Service worker for offline functionality
- Performance monitoring with Web Vitals
Backend Scaling:
- Horizontal scaling with load balancers
- Database indexing and query optimization
- Redis caching for session management
- API rate limiting and throttling
Infrastructure:
- Docker containerization
- Kubernetes orchestration
- CI/CD pipeline automation
- Monitoring with logging aggregation
This project is licensed under the MIT License.
See SCALING.md for detailed implementation.