Objective:
Develop a mobile application with authentication and profile management using Flutter/React Native for the UI and Node.js/Express with MongoDB for the backend.
Task Breakdown
Frontend (Flutter/React Native)
Navigation System:
Side Navigation (Drawer): Menu with Home, Profile, Logout.
Bottom Navigation: Persistent Home, Profile, Settings menu.
Tab Navigation (Profile Page):
Profile Overview Tab: Displays user details (name, email, profile picture).
Settings Tab: Editable fields for user details (name, email, phone, profile picture, password).
UI Components & Screens:
Home Page: Displays a welcome message and navigation options.
Profile Page: Includes both Profile Overview and Settings tabs.
Backend (Node.js, Express, MongoDB)
User Model (MongoDB Schema):
Fields: name, email, password (hashed), phone (optional), profilePicture (optional).
API Endpoints:
Signup (POST /api/auth/signup) → Registers a new user.
Login (POST /api/auth/login) → Authenticates user and returns JWT token.
Fetch Profile (GET /api/auth/profile) → Returns user details (protected route).
Update Profile (PUT /api/auth/profile) → Updates user details (protected route).
Authentication & Security:
Use bcrypt for password hashing.
Implement JWT-based authentication for protected routes.
Additional Requirements
✅ Form Validation: Ensure valid email, strong password, and proper input handling.
✅ Error Handling: Provide meaningful error messages for failed operations.
✅ Responsive UI: Ensure mobile and tablet compatibility.
Tech Stack
Frontend: Flutter / React Native.
Backend: Node.js, Express.js.
Database: MongoDB: mongodb+srv://<db_username>:<db_password>@cluster0.ugppvfq.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0 (username: abhi and password: 123cluster)
Authentication: JWT + bcrypt.
I'll create a full-stack mobile-friendly web application with authentication and profile management using Next.js with a responsive UI that works well on mobile devices. Let's start by building both the frontend and backend components.
This application implements a full-stack user management system with authentication and profile management. Here's a breakdown of what I've created:
Authentication System
Navigation System
Profile Management
User Model
API Endpoints
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/logoutGET /api/auth/profilePUT /api/auth/profileAuthentication & Security
Authentication
Profile Management
Navigation
The application is fully responsive and works well on both mobile and desktop devices. It includes form validation, error handling, and provides meaningful feedback to users through toast notifications 1.
Please make sure to add the following environment variables to your project:
Great! Now that you've added the environment variables, your application is ready to be deployed and used. Here's what you need to know about deploying and using your user management application:
Deploy to Vercel
Environment Variables
You've already added the required environment variables:
JWT_SECRET: Used for signing and verifying JWT tokensMONGODB_URI: Connection string for your MongoDB databaseOnce deployed, your application will provide:
Authentication Flow
/auth/signup/auth/loginNavigation
Profile Management
Here are some features you might want to add in the future:
Image Upload
Social Authentication
Email Verification
Two-Factor Authentication
User Roles and Permissions
Activity Logging
Theme Customization
To test your application:
The application is built with Flutter-like navigation patterns as requested, including drawer navigation, bottom navigation, and tab navigation, making it familiar for mobile app developers transitioning to web development.
Is there any specific part of the application you'd like me to explain in more detail?