Rochetta is a full-stack MERN web application designed to simulate a real-world pharmacy environment. It enables users to browse and purchase medications and provides administrators with a dashboard to manage catalog operations.
- Key Features
- Technical Interface Preview
- System Architecture and Tech Stack
- Directory Structure
- Getting Started
- Quality Assurance and CI Pipelines
- Database Design (ERD)
- Contributors
- Catalog Exploration: Browse and filter medications by therapeutic categories.
- Flexible Purchasing: Purchase medicines by the individual strip or by the full box.
- Prescription Control: Certain medications are marked as requiring a prescription and cannot be checked out without upload/pharmacist review.
- Cart and Orders: Live management of cart quantities and real-time checkout flows.
- Optimized Shopping Experience: Fully optimized and rewritten cart backend ensuring atomic database updates, handles inventory reservation edge-cases, and speeds up shopping cart load times.
- Profile Management: View order histories, manage delivery addresses, and track pending prescriptions.
- Responsive Styling: Fully optimized for mobile, tablet, and desktop views.
- Delivery Dashboard: View delivery metrics such as active, completed, and canceled assignments.
- Order Management & Tracking: Search and filter assigned deliveries by ID, customer name, phone, or status.
- Real-time Status Updates: Update delivery progress states directly (e.g., from Pending to Out for Delivery or Delivered).
- Detailed Order Modals: Instantly view customer contacts, delivery addresses, payment types (COD amounts to collect), and specific order items.
- Catalog Management: Create, read, update, and delete products, including product images uploaded directly to Cloudinary.
- Inventory Control: Monitor stock, change pricing structures, and manage categories.
- AI-Powered Analytics: Real-time revenue telemetry charts, inventory management tables, and a specialized AI Analytics Tab for sales prediction and forecasting.
- Authentication Controls: View and manage user accounts and system permissions.
- Interactive AI Help: Ask medical or platform questions directly to Rochetta Assistant via a floating chat widget.
- Persistent Chat History: Seamlessly retrieve and browse past conversation history.
- Secure Access Control: Requires user authentication to prevent unauthorized API requests and manage chat history safely.
- Framework: React.js (Vite bundler)
- State Management: Redux Toolkit & RTK Query
- Routing: React Router DOM
- Form Handling: React Hook Form & Zod Validation
- Styling: Tailwind CSS
- Runtime Environment: Node.js
- Framework: Express.js
- Database Access: Mongoose (MongoDB ODM)
- Security: Helmet, Express Rate Limit, Express Mongo Sanitize, HPP (HTTP Parameter Pollution protection), and XSS-clean.
- Storage Provider: Cloudinary (for media uploads)
- API Documentation: Swagger UI (integrated with swagger-jsdoc)
├── Web/ # Frontend application (Vite + React)
│ ├── src/ # React source code (components, store, router, pages)
│ ├── eslint.config.js # Frontend linting rules
│ └── package.json # Frontend dependencies and scripts
├── Server/ # Backend application (Express)
│ ├── config/ # Database and environment configurations
│ ├── controllers/ # Request handling logic
│ ├── models/ # Mongoose schemas
│ ├── routers/ # API route definitions
│ ├── services/ # Services (AI, Email, JWT)
│ ├── eslint.config.js # Backend linting rules
│ └── package.json # Backend dependencies and scripts
└── .github/
└── workflows/ # CI/CD GitHub Actions pipelines
Make sure you have the following installed on your machine:
- Node.js (v18.x or above)
- npm (v9.x or above)
- MongoDB (Local instance or MongoDB Atlas URI)
-
Clone the Repository:
git clone https://github.com/aelaraby6/PharmaXpress.git cd PharmaXpress -
Configure the Backend (Server): Navigate to the
Serverfolder and install dependencies:cd Server # Install dependencies npm install
Create a
.envfile in theServerdirectory based on the following template:NODE_ENV=development PORT=4000 MONGO_URI=your_mongodb_connection_uri JWT_SECRET=your_jwt_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret EMAIL_USER=your_smtp_email_address EMAIL_PASS=your_smtp_app_password GROQ_API_KEY=your_groq_ai_api_key
-
Configure the Frontend (Web): Navigate to the
Webfolder and install dependencies:cd ../Web # Install dependencies npm install
-
Start Backend Server: Navigate to the
Serverfolder and run:npm run dev
The backend server will run on
http://localhost:4000. -
Start Frontend Web: Navigate to the
Webfolder and run:cd ../Web npm run devThe frontend will run on
http://localhost:5173.
This repository is configured with automated Continuous Integration (CI) checks on GitHub Actions that trigger on pushes and pull requests targeting the main branch.
- Frontend Quality Check: Verifies that the web project compiles without any ESLint warnings or build-time compilation errors.
- Backend Quality Check: Runs ESLint on the Express server folder to ensure consistency, variable safety, and code quality.
To run the linters locally:
- For Web:
cd Web && npm run lint - For Backend:
cd Server && npm run lint
The entity relationships mapping the collection schemas (Users, Products, Orders, Carts, etc.) are illustrated below:
The Rochetta project is developed and maintained by the following contributors:
|
Abdelrahman Elaraby |
Abdelrahman Selim |