I want to create a new MERN stack app for below client requirements
User Panel
Dashbord - stats Send campaign - national / international / button as per balance Credits history Current balance Reports Profile Terms & condition
Reseller Panel
Dashbord - stats Send campaign - national / international / button as per balance Credits history Current balance Reports Profile Terms & condition User management Credit management For create any user require: full name / email id / mobile number / city & state / username & password.
Admin Panel
All reseller features
Option to suspend any user or reseller and save comment with date y we suspending any user. If any reseller suspending then complete user list and reseller list below that reseller will also suspend and not able to login Pending campaigns Finished campaigns Finish deli campaigns listing Option to se complete hierarchy of any user adding campaign View msg and attachment before sending Option to upload reports for user Cutting option (only whitelisting / whitelisting & common or how much % want to send ) and in all condition msg need to go to whitelisting and common numbers Option to reject any camapign and default all credits will be refund to user but it should as you want to refund or not if no then no refund for users All non WhatsApp credits will be refunded to users with in 48 hours. There must option if admin do not want to refund non WhatsApp credits to any user then will able to activate same option In pending / finished campaign show for which country msg sent. In user list show credits status / uplink / current user role / login username & password
General Features
Less then 20 number should add with in whitelisting and in any condition msg should go to those numbers Less then 10 number called as demo and they should go instantly Option to select server for sending msg if campaign more then 10 numbers Filter campaign or filter later after finish campaign Save non WhatsApp data with in local host and as soon as campaign added immediately nonwhtsapp will checked from existing database Start and stop panel timing to accept campaign / demo and modify as require separate for button / international or indian. Default file size will be 2 image (1 mb each) + 1 video (3 mb) + attachment (1 mb) but for particular user admin will able to change file size upto 10 mb if require For button 1 attachment upto 3 mb Separate section for national / international / button campaigns and separate credits for each route Only admin will able to see password for all user / reseller. Resellers only having option for change password. Default 3 demo + 15 campaign can submit by a user with in a day but if admin want he can modify for particular user. Stats need for admin All countries need to add for international route Option to finish campaign with out sending / direct finish.
So we are going step by step first do basic auth setup with user management with roles. take the MUI for design and with latest things like don't use create-react-app you can use Vite without typescript. keep in mind design should be attractive.
I'll help you set up a MERN stack application with authentication and role-based user management using MUI for the frontend design and Vite for the React setup. Let's start with the basic structure and authentication components.
"eslint-plugin-react-refresh": "^0.4.3", "vite": "^4.4.5" } }
## Setting Up and Running the Application
Now that we've set up the basic authentication and user management with roles, let's go through how to run this MERN stack application:
### Backend Setup
1. Navigate to the server directory:
```bash
cd server
Install dependencies:
npm install
.env
file with your MongoDB connection string.Start the server:
npm run dev
Navigate to the client directory:
cd client
Install dependencies:
npm install
Start the Vite development server:
npm run dev
This application follows a typical MERN stack architecture:
React Frontend with Vite:
Express Backend:
MongoDB Database:
Authentication:
Role-Based Access Control:
User Management:
Based on your requirements, here are some features we should implement next:
Campaign Management:
Credit System:
Reporting:
Admin Tools:
Would you like me to focus on implementing any specific feature next?
Please make sure to add the following environment variables to your project:
Great! Now that we have the environment variables set up, let's continue building the application by implementing the campaign management functionality. This is a core feature of your application that will allow users to create and manage campaigns, while resellers and admins can review and approve them.
I've implemented the campaign management functionality for your MERN stack application. This includes:
Campaign Model: A comprehensive MongoDB schema for campaigns with fields for:
Campaign Routes: RESTful API endpoints for:
File Upload Handling: Using Multer middleware to:
User Campaign Management:
Reseller Campaign Management:
Role-Based Access Control:
Credit System Integration:
File Management:
With the authentication and campaign management functionality in place, we can now focus on:
Credit Management System:
Admin Dashboard Enhancements:
User Interface Refinements:
Would you like me to implement any of these next steps, or would you prefer to focus on a different aspect of the application?
I have setup version 2 now getting error