A full-stack web application designed to manage visitor registrations and product requests. Built with the MERN stack (MongoDB, Express, React, Node.js) and Redux for state management.
- User Authentication: Secure login and registration for administrators/staff.
- Visitor Management: Register and track visitor details including name, company, mobile, and reason for visit.
- Product Request Management: Record and manage product requests with detailed specifications (category, brand, model, units, etc.).
- Admin Dashboard: Overview and control center for managing users, visitors, and products.
- Production Ready: Configured for both development and production environments.
- Frontend: React, Redux (Redux Toolkit), React Router, Axios.
- Backend: Node.js, Express.
- Database: MongoDB (via Mongoose).
- Authentication: JWT (JSON Web Tokens), Bcryptjs for password hashing.
- Utilities: Concurrently (run client and server together), Nodemon (auto-restart server), Express-fileupload.
-
Clone the repository:
git clone <repository-url> cd vistors_regester/my-react-app
-
Install Root Dependencies:
npm install
-
Backend Setup:
- Navigate to the backend folder:
cd vistor-backend - Install dependencies:
npm install - Create a
.envfile in thevistor-backenddirectory and add:NODE_ENV=development PORT=8000 MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
- Navigate to the backend folder:
-
Frontend Setup:
- Navigate to the frontend folder:
cd vistor-frontend - Install dependencies:
npm install - (Optional) Configure environment variables if needed.
- Navigate to the frontend folder:
From the root directory (my-react-app), run:
npm run devThis will start both the backend server (port 8000) and the React frontend (port 3000) simultaneously using concurrently.
- Build the frontend:
cd vistor-frontend npm run build - Start the server from the root:
npm start
To create an initial admin user, run the following command from the root:
npm run create-adminvistor-backend/: Express server, API routes, Mongoose models, and controllers.vistor-frontend/: React application, Redux slices, and UI components.vistor-frontend/src/pages/: Main views (Dashboard, Login, Register, Visitor/Product Control).vistor-frontend/src/features/: Redux logic and API services.
ISC License