A complete task management application built with Node.js, Express, MongoDB, and React Native (Expo). Features user authentication, CRUD operations, and cross-platform support.
- Backend API: [Deploy to Render/Heroku and add URL here]
- Frontend Web: [Deploy to Vercel/Netlify and add URL here]
- Mobile App: Use Expo Go to scan QR code
- User registration and login with JWT
- Secure password hashing with bcrypt
- Token-based authentication
- Auto-logout on token expiration
- Create, read, update, and delete tasks
- Toggle task completion status
- Add task descriptions and due dates
- Filter tasks (All, Pending, Completed)
- Overdue task highlighting
- Cross-platform support (iOS, Android, Web)
- Modern, responsive UI design
- Loading indicators and error handling
- Pull-to-refresh functionality
- Intuitive navigation flow
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database with Mongoose ODM
- JWT - JSON Web Tokens for authentication
- bcryptjs - Password hashing
- express-validator - Input validation
- CORS - Cross-origin resource sharing
- React Native - Mobile framework
- Expo - Development platform
- React Navigation - Navigation library
- Axios - HTTP client
- AsyncStorage - Local storage
- Node.js (v14 or higher)
- MongoDB Atlas account (free tier available)
- Expo CLI:
npm install -g @expo/cli
-
Clone the repository
git clone <your-repo-url> cd task-manager/task-manager-backend
-
Install dependencies
npm install
**π SECURITY WARNING**: - Copy `.env.example` to `.env` and fill in your REAL values - NEVER commit `.env` files to version control - Use strong, unique passwords and secrets - Keep your MongoDB Atlas credentials secure -
Start the server
# Development npm run dev # Production npm start
-
Navigate to frontend directory
cd ../task-manager-frontend -
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the frontend directory:EXPO_PUBLIC_API_URL=http://localhost:5000
π SECURITY WARNING:
- Use placeholder URLs in documentation
- Set real URLs only in your local
.envfile - Never commit
.envfiles to version control
-
Start the application
npm start
-
Push to GitHub
git add . git commit -m "Ready for deployment" git push origin main
-
Deploy on Render
- Go to render.com
- Create new Web Service
- Connect your GitHub repository
- Select
task-manager-backendfolder - Set build command:
npm install - Set start command:
npm start - Add environment variables:
MONGO_URIJWT_SECRETNODE_ENV=productionFRONTEND_URL
-
Build for web
cd task-manager-frontend npx expo export:web -
Deploy to Vercel
npm install -g vercel vercel
-
Update API URL
- Set
EXPO_PUBLIC_API_URLto your deployed backend URL - Rebuild and redeploy
- Set
- App Start β Login screen appears
- New Users β Register β Success message β Login screen
- Existing Users β Login β Task Manager dashboard
- Auto-logout β Invalid/expired token redirects to Login
- Add Task β Click "+ Add" button
- Edit Task β Click "Edit" on any task
- Toggle Status β Click "Done/Undo" button
- Delete Task β Click "Delete" with confirmation
- Filter Tasks β Use All/Pending/Completed tabs
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/test- Test endpoint
GET /api/tasks- Get all user tasksPOST /api/tasks- Create new taskGET /api/tasks/:id- Get single taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
Headers Required:
x-auth-token: <jwt_token>
OR
Authorization: Bearer <jwt_token>
cd task-manager-backend
npm run test-local # Test without databasecd task-manager-frontend
npm start # Test on multiple platformstask-manager/
βββ π task-manager-backend/
β βββ π config/
β β βββ db.js # Database connection
β βββ π controllers/
β β βββ authController.js # Authentication logic
β β βββ taskController.js # Task management logic
β βββ π middleware/
β β βββ authMiddleware.js # JWT verification
β βββ π models/
β β βββ User.js # User schema
β β βββ Task.js # Task schema
β βββ π routes/
β β βββ auth.js # Auth routes
β β βββ tasks.js # Task routes
β βββ server.js # Main server file
β βββ package.json # Dependencies
β βββ Procfile # Heroku configuration
βββ π task-manager-frontend/
β βββ π components/
β β βββ TaskItem.js # Task display component
β βββ π navigation/
β β βββ AppNavigator.js # App navigation
β βββ π screens/
β β βββ LoginScreen.js # Login interface
β β βββ RegisterScreen.js # Registration interface
β β βββ TaskListScreen.js # Main task interface
β β βββ AddTaskScreen.js # Add/edit task interface
β β βββ SplashScreen.js # Loading screen
β βββ π utils/
β β βββ api.js # HTTP client
β β βββ auth.js # Token management
β βββ App.js # Main app component
β βββ package.json # Dependencies
βββ README.md # This file
- JWT authentication with 7-day expiration
- Password hashing with bcrypt (10 rounds)
- Input validation and sanitization
- CORS protection with configurable origins
- MongoDB injection protection
- Secure token storage with AsyncStorage
- NEVER commit
.envfiles to version control - Use
.env.exampleas a template - Set real values only in your local
.envfile - Use strong, unique passwords and secrets
- Set environment variables in your hosting platform
- Use secure MongoDB Atlas credentials
- Generate new JWT secrets for production
- Configure CORS for your specific domain
- No hardcoded secrets in source code
- All sensitive data in environment variables
- Input validation on both frontend and backend
- Proper error handling without exposing internals
Duration: 2 minutes
-
0:00-0:15 - Introduction
- Show app overview and tech stack
- Demonstrate cross-platform support
-
0:15-0:30 - Authentication
- Register new user
- Show success message and redirect
- Login with credentials
-
0:30-0:60 - Task Management
- Create task with title, description, due date
- Edit existing task
- Toggle task completion
- Delete task with confirmation
-
0:60-0:90 - Advanced Features
- Show task filtering (All/Pending/Completed)
- Demonstrate overdue task highlighting
- Show pull-to-refresh functionality
-
0:90-2:00 - Conclusion
- Recap key features
- Show GitHub repository
- Mention deployment links
# Backend
cd task-manager-backend
npm install
cp .env.example .env # Configure your environment
npm run dev
# Frontend (new terminal)
cd task-manager-frontend
npm install
npm start- β Authentication Flow - Login β Register β Task Manager
- β JWT Security - Token-based authentication
- β Task CRUD - Create, Read, Update, Delete operations
- β Status Toggle - Pending β Completed
- β User Isolation - Tasks only visible to logged-in user
- β Database Storage - MongoDB with proper schemas
- β Input Validation - Frontend and backend validation
- β Error Handling - Consistent JSON responses
- β Environment Config - MONGO_URI, JWT_SECRET, PORT
- β Deployment Ready - Render/Heroku configuration
- β Cross-Platform - iOS, Android, Web support
- β Professional UI - Loading states, error messages
- β Documentation - Comprehensive README
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Josna Fernandes
- GitHub: @Josna126
- Email: fernandesjosna2005@gmail.com