How santosh5358/pharmacy-management works
Overall Architecture
• The system is divided into a Frontend (React.js) and a Backend (Express.js) that communicates with a MongoDB database.
• Additionally, there is a Netlify directory for serverless functions – these likely provide an alternative deployment strategy for backend endpoints or additional utilities.
Main Components
a. Frontend Component:
• User Interface (React components such as Header, Footer, Login, Register, Dashboard, etc.)
• Routing (React Router)
• HTTP Client (Axios for calling backend API endpoints)
• That the “ForntEnd” folder contains both the development (src) and the built assets (build).
b. Backend Component:
• Server Script (server.js)
• Data Models (Inside Backend/models: Contact.js, Item.js, Order.js, User.js) which indicate the domain objects.
• API layer for handling authentication, CRUD operations for medicines, and user profile management.
c. Database:
• MongoDB database that stores user details, medicine data, orders, and invoices.
• That the backend communicates with MongoDB (via MONGO_URI environment variable).
d. Netlify Serverless Functions:
• Functions with the Frontend (if used in that deployment context) or as an alternative microservice.
Relationships and Interactions
• From the Frontend component to the Backend component, indicating API calls for operations like authentication, medicine retrieval, order creation.
• From the Backend to the Database (MongoDB) to show data persistence.
• If the Netlify functions are in use, add a connection between the Frontend and these serverless components (or between Netlify functions and the Backend, if they serve as subsets of the main API).
Architectural Patterns and Design Principles
• Separation of concerns:
• The Frontend handles presentation and client-side logic.
• The Backend handles business logic, data validation, and interaction with MongoDB.
• That the project emphasizes role-based access (admin vs. regular users) and RESTful API design.
• Mention use of environment variables for configuration (JWT_SECRET, MONGO_URI, PORT), reinforcing good security practices.
Technologies, Frameworks, and Libraries
• Frontend: React.js, React Router, Axios.
• Backend: Express.js, Node.js.
• Database: MongoDB.
• Additional: Netlify for hosting/deploying serverless functions.