aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-18 11:14:58 +0000
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-18 11:14:58 +0000
commited01dc5e32172868dd210dd6eecac96680e47913 (patch)
tree57c0b3f2fbdbca3c2737229c956b9361fd330c0d
parentcb4a93dace30fcc21eac7d12c6ac08b8803a5f01 (diff)
downloadadmin-panel-ed01dc5e32172868dd210dd6eecac96680e47913.tar.gz
admin-panel-ed01dc5e32172868dd210dd6eecac96680e47913.tar.bz2
admin-panel-ed01dc5e32172868dd210dd6eecac96680e47913.zip
UPDATE README.md
-rw-r--r--README.md108
-rw-r--r--package-lock.json27
-rw-r--r--package.json2
3 files changed, 99 insertions, 38 deletions
diff --git a/README.md b/README.md
index 58beeac..e11ce92 100644
--- a/README.md
+++ b/README.md
@@ -1,70 +1,102 @@
-# Getting Started with Create React App
+# Admin Panel Application
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+This project is a full-stack application built with React.js for the frontend and Node.js/Express.js for the backend. It includes user authentication using Firebase, routing using React Router DOM, and data storage using MongoDB.
-## Available Scripts
+## Getting Started
-In the project directory, you can run:
+To get started with this project, follow these steps:
-### `npm start`
+### Prerequisites
-Runs the app in the development mode.\
-Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
+- Node.js and npm should be installed on your machine.
+- MongoDB should be installed and running locally or accessible remotely.
-The page will reload when you make changes.\
-You may also see any lint errors in the console.
+### Installation
-### `npm test`
+1. Clone the repository to your local machine:
-Launches the test runner in the interactive watch mode.\
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
+ ```bash
+ git clone <repository_url>
+ cd admin-panel
+ ```
-### `npm run build`
+2. Install dependencies for both the server and the client:
-Builds the app for production to the `build` folder.\
-It correctly bundles React in production mode and optimizes the build for the best performance.
+ ```bash
+ # Install server dependencies
+ cd server
+ npm install
-The build is minified and the filenames include the hashes.\
-Your app is ready to be deployed!
+ # Install client dependencies
+ cd ../src
+ npm install
+ ```
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
+### Configuration
-### `npm run eject`
+#### Server Configuration
-**Note: this is a one-way operation. Once you `eject`, you can't go back!**
+1. **Environment Variables**:
+ - Create a `.env` file in the `server` directory and configure it with necessary environment variables (e.g., MongoDB URI, Firebase configuration).
-If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
+ Example `.env` file:
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
+ ```plaintext
+ PORT=5000
+ MONGODB_URI=mongodb://localhost:27017/admin-panel
+ FIREBASE_API_KEY=your_firebase_api_key
+ FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
+ FIREBASE_PROJECT_ID=your_firebase_project_id
+ ```
-You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
+2. **Database Setup**:
+ - Ensure MongoDB is running. Modify the `MONGODB_URI` in `.env` to match your MongoDB setup.
-## Learn More
+3. **Firebase Configuration**:
+ - Update the Firebase configuration in `src/firebase/firebaseConfig.js` with your Firebase project credentials.
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
+#### Client Configuration
-To learn React, check out the [React documentation](https://reactjs.org/).
+1. **React Router DOM**:
+ - Ensure routes are correctly defined in `src/App.js` using `BrowserRouter`, `Route`, and `Switch` from `react-router-dom`.
-### Code Splitting
+2. **Firebase Integration**:
+ - Ensure Firebase authentication and Firestore integration is set up correctly in `src/firebase/firebaseConfig.js`.
-This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
+### Running the Application
-### Analyzing the Bundle Size
+1. Start the server:
-This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
+ ```bash
+ # From the server directory
+ cd server
+ npm start
+ ```
-### Making a Progressive Web App
+ The server should start on port specified in your `.env` file.
-This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
+2. Start the React application:
-### Advanced Configuration
+ ```bash
+ # From the src directory
+ cd ../src
+ npm start
+ ```
-This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
+ The React application should start and open in your default web browser.
-### Deployment
+### Usage
-This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
+- The application includes user authentication using Firebase. Users can sign up, log in, and log out.
+- Private routes are implemented using `PrivateRoute.js` to protect routes that require authentication.
+- MongoDB is used for storing user data and other application-related data.
+- React components are organized under `src/components`, and Firebase configuration is under `src/firebase`.
-### `npm run build` fails to minify
+### Troubleshooting
-This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
+- If encountering `react-chartjs-2` or other dependency-related issues, ensure all dependencies are installed (`npm install`).
+- Check console logs for errors related to Firebase initialization, React Router DOM setup, or MongoDB connection issues.
+
+### License
+
+This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
diff --git a/package-lock.json b/package-lock.json
index 0286962..d06ab4f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,8 +12,10 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.7.2",
+ "chart.js": "^4.4.3",
"firebase": "^10.12.3",
"react": "^18.3.1",
+ "react-chartjs-2": "^5.2.0",
"react-dom": "^18.3.1",
"react-router-dom": "^6.25.1",
"react-scripts": "5.0.1",
@@ -3781,6 +3783,11 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
+ "node_modules/@kurkle/color": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
+ "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
+ },
"node_modules/@leichtgewicht/ip-codec": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz",
@@ -6688,6 +6695,17 @@
"node": ">=10"
}
},
+ "node_modules/chart.js": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.3.tgz",
+ "integrity": "sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw==",
+ "dependencies": {
+ "@kurkle/color": "^0.3.0"
+ },
+ "engines": {
+ "pnpm": ">=8"
+ }
+ },
"node_modules/check-types": {
"version": "11.2.3",
"resolved": "https://registry.npmjs.org/check-types/-/check-types-11.2.3.tgz",
@@ -15540,6 +15558,15 @@
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
},
+ "node_modules/react-chartjs-2": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.2.0.tgz",
+ "integrity": "sha512-98iN5aguJyVSxp5U3CblRLH67J8gkfyGNbiK3c+l1QI/G4irHMPQw44aEPmjVag+YKTyQ260NcF82GTQ3bdscA==",
+ "peerDependencies": {
+ "chart.js": "^4.1.1",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/react-dev-utils": {
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
diff --git a/package.json b/package.json
index 1aaffc6..719d05d 100644
--- a/package.json
+++ b/package.json
@@ -7,8 +7,10 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.7.2",
+ "chart.js": "^4.4.3",
"firebase": "^10.12.3",
"react": "^18.3.1",
+ "react-chartjs-2": "^5.2.0",
"react-dom": "^18.3.1",
"react-router-dom": "^6.25.1",
"react-scripts": "5.0.1",