From 6d6aa93638ee191c36bb9a04ba2258a38607dedd Mon Sep 17 00:00:00 2001 From: Aditya Jadhav Date: Thu, 2 Nov 2023 15:07:25 -0400 Subject: [PATCH 1/6] Documentation notes --- Documentation.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation.md diff --git a/Documentation.md b/Documentation.md new file mode 100644 index 0000000..d58e2fa --- /dev/null +++ b/Documentation.md @@ -0,0 +1,89 @@ +### How to Run + +- Clone the repository for this project by running the following command in a terminal: + ##### `git clone https://github.com/lugenx/ecohabit.git` +- Open the cloned folder in VS Code. Open the terminal and make sure its pointing to the root of the cloned project. + + +- Database creation + - Create a mongodb account through the [MongoDB Website](https://www.mongodb.com) + - Create a cluster (by default is Cluster0 which can be used) + - Once the cluster is up, you need to click on the 'Connect' tab and follow the drivers section to retrieve the mongodb connection url and save it for the next steps + +
+ +- Running Backend Node JS Application: + + - Change the directory to server folder using terminal command: `cd server` + - At the root of the server directory, create an .env file and copy the content from .env.example into the new .env file. + - update the 'MONGODB_URL' property in the .env file with the mongodb connection url saved during Database creation + - In the server directory, you can run: + + ##### `npm install` + + - It'll download all the packages/dependencies as defined in package.json file. Once the system completes this process, we can type below command: + + ##### `npm start` + + - Runs the app in the development mode. + - You can start making http calls to [http://localhost:3001](http://localhost:3001) + +- Running Frontend React JS Application: + + - Change the directory to client folder using terminal command: `cd client` + - In the client directory, you can run: + + ##### `npm install` + + - It'll download all the packages/dependencies as defined in package.json file. Once the system completes this process, we can type below command: + + ##### `npm start` + + - Runs the app in the development mode. + - Open [http://localhost:3000](http://localhost:3000) to view it in the browser + + - The page will reload if you make edits. + - You will also see any lint errors in the console. + +- Insert habit dummy data: + + - Go back to the MongoDB website to your project you created. + - You will see a 'test' collection populated + - Inside 'test', you will find 'habit' as a subcollection, open it and you can insert the below dummy documents + +``` +{ + category: "Recycle", + description: "Reduce the amount of waste by using reusable bags!", + question: "Which one of these did you use today?", + answerOptions: ["clothbag"], + __v:0 +} +``` + +``` +{ + category: "Commute", + description: "Carpool with coworker or friends", + question: "How did you commute to work today?", + answerOptions: ["Uber", "Lyft"], + __v:0 +} +``` + +``` +{ + category: "Recycle", + description: "Separate bin for recycle stuff", + question: "How much did you dump today for recycle", + answerOptions: ["3boxes", "4boxes"], + __v:0 +} +``` +- Note: When you insert a document, append the above json fields to the already defined unique id in the document + +- The link [MongoDB Insert Document](https://www.mongodb.com/docs/manual/tutorial/insert-documents/) + shows how to insert the document in the mongodb manually through the UI + + + From 8a1cd5951da3bae306f5b2b70bd8c4666ec92f6f Mon Sep 17 00:00:00 2001 From: Aditya Jadhav Date: Sat, 4 Nov 2023 11:13:13 -0400 Subject: [PATCH 2/6] added the documentation to Readme.md --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/README.md b/README.md index e816af7..6d9bf97 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,19 @@ If you prefer the command line way of downloading and installing things, then fe ##### `git clone https://github.com/lugenx/ecohabit.git` - Open the cloned folder in VS Code. Open the terminal and make sure its pointing to the root of the cloned project. + +- Database creation + - Create a mongodb account through the [MongoDB Website](https://www.mongodb.com) + - Create a cluster (by default is Cluster0 which can be used) + - Once the cluster is up, you need to click on the 'Connect' tab and follow the drivers section to retrieve the mongodb connection url and save it for the next steps + +
+ - Running Backend Node JS Application: - Change the directory to server folder using terminal command: `cd server` - At the root of the server directory, create an .env file and copy the content from .env.example into the new .env file. + - update the 'MONGODB_URL' property in the .env file with the mongodb connection url saved during Database creation - In the server directory, you can run: ##### `npm install` @@ -80,6 +89,50 @@ If you prefer the command line way of downloading and installing things, then fe - The page will reload if you make edits. - You will also see any lint errors in the console. +- Insert habit dummy data: + + - Go back to the MongoDB website to your project you created. + - You will see a 'test' collection populated + - Inside 'test', you will find 'habit' as a subcollection, open it and you can insert the below dummy documents + +``` +{ + category: "Recycle", + description: "Reduce the amount of waste by using reusable bags!", + question: "Which one of these did you use today?", + answerOptions: ["clothbag"], + __v:0 +} +``` + +``` +{ + category: "Commute", + description: "Carpool with coworker or friends", + question: "How did you commute to work today?", + answerOptions: ["Uber", "Lyft"], + __v:0 +} +``` + +``` +{ + category: "Recycle", + description: "Separate bin for recycle stuff", + question: "How much did you dump today for recycle", + answerOptions: ["3boxes", "4boxes"], + __v:0 +} +``` +- Note: When you insert a document, append the above json fields to the already defined unique id in the document + +- The link [MongoDB Insert Document](https://www.mongodb.com/docs/manual/tutorial/insert-documents/) + shows how to insert the document in the mongodb manually through the UI + + + - The page will reload if you make edits. + - You will also see any lint errors in the console. + ## Roadmap - _List any features planned_ From fb71034b2d2f0fb5f2243750dae99fa67617e2ec Mon Sep 17 00:00:00 2001 From: Aditya Jadhav Date: Sat, 4 Nov 2023 21:28:45 -0400 Subject: [PATCH 3/6] few more ideas --- docs/ideas.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/ideas.md b/docs/ideas.md index 5566745..1ae37ff 100644 --- a/docs/ideas.md +++ b/docs/ideas.md @@ -11,6 +11,11 @@ - environment-friendly online stores (+1) - environment-friendly events - environment-friendly alternatives of popular products and services +- When it comes to flying, tracking peoples monthly or half-yearly travels, whether they use economy or business + (business classes emits 3 times more CO2 than economy class) +- Help them to track their energy bills thus help them keep their energy usage as per the need (so less fuel usage and less greenhouse gases emission) + +- We could also provide some broader analysis (across the world or across US) as a analytics dashboard tab for them to understand the big picture and also means of attracting people to use the app - links to environmental charities (+1) - crowdfunding feature to donate to environmental charities From 6d94f7872a8e0743f3afe80bed37394a9d307d52 Mon Sep 17 00:00:00 2001 From: Aditya Jadhav Date: Tue, 7 Nov 2023 18:45:20 -0500 Subject: [PATCH 4/6] requested changes --- README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6d9bf97..b6c6d52 100644 --- a/README.md +++ b/README.md @@ -49,18 +49,21 @@ If you prefer the command line way of downloading and installing things, then fe - Open the cloned folder in VS Code. Open the terminal and make sure its pointing to the root of the cloned project. -- Database creation +- Create Database for development use: + - Create a mongodb account through the [MongoDB Website](https://www.mongodb.com) - Create a cluster (by default is Cluster0 which can be used) - - Once the cluster is up, you need to click on the 'Connect' tab and follow the drivers section to retrieve the mongodb connection url and save it for the next steps + - Once the cluster is up, you need to click on the 'Connect' tab + - Follow the drivers section to retrieve the mongodb connection url and save it for the next steps + - Connection url - mongodb+srv://:@cluster0.xqzlrqf.mongodb.net/?retryWrites=true&w=majority + - Replace the username and password you used for the mongo db account and put a databasename (eg. ecohabit) -
-- Running Backend Node JS Application: +- Run the backend NodeJS application: - Change the directory to server folder using terminal command: `cd server` - At the root of the server directory, create an .env file and copy the content from .env.example into the new .env file. - - update the 'MONGODB_URL' property in the .env file with the mongodb connection url saved during Database creation + - Update the 'MONGODB_URL' property in the .env file with the mongodb connection url saved - In the server directory, you can run: ##### `npm install` @@ -91,9 +94,10 @@ If you prefer the command line way of downloading and installing things, then fe - Insert habit dummy data: - - Go back to the MongoDB website to your project you created. - - You will see a 'test' collection populated - - Inside 'test', you will find 'habit' as a subcollection, open it and you can insert the below dummy documents + - Go back to the MongoDB website to your project. + - The collection with the databasename you provided will be present (created when you started the server app) + - Inside the collection, you will find 'habits' as a subcollection + - Open it and you can insert the below dummy documents ``` { From a552aed164920859c91af8b0b4f10f54fedbf075 Mon Sep 17 00:00:00 2001 From: Aditya Jadhav Date: Sun, 12 Nov 2023 18:05:16 -0500 Subject: [PATCH 5/6] deleted documentation.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6c6d52..8368ff9 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ If you prefer the command line way of downloading and installing things, then fe - Create a cluster (by default is Cluster0 which can be used) - Once the cluster is up, you need to click on the 'Connect' tab - Follow the drivers section to retrieve the mongodb connection url and save it for the next steps - - Connection url - mongodb+srv://:@cluster0.xqzlrqf.mongodb.net/?retryWrites=true&w=majority + - Connection url - mongodb+srv://(username):(password)@cluster0.xqzlrqf.mongodb.net/(databasename)?retryWrites=true&w=majority - Replace the username and password you used for the mongo db account and put a databasename (eg. ecohabit) From 94041ba6eed475bd520f311815c3013105c9fadb Mon Sep 17 00:00:00 2001 From: Aditya Jadhav <32817064+aditya4196@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:03:15 -0500 Subject: [PATCH 6/6] Update README.md changed the test data --- README.md | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8368ff9..42c00a3 100644 --- a/README.md +++ b/README.md @@ -100,33 +100,30 @@ If you prefer the command line way of downloading and installing things, then fe - Open it and you can insert the below dummy documents ``` -{ - category: "Recycle", - description: "Reduce the amount of waste by using reusable bags!", - question: "Which one of these did you use today?", - answerOptions: ["clothbag"], - __v:0 -} + { + "category": "Recycle", + "description": "Reduce the amount of waste by using reusable bags!", + "question": "Which one of these did you use today?", + "answerOptions": ["Reusable bag", "Plastic bag", "Both", "None"] + } ``` ``` -{ - category: "Commute", - description: "Carpool with coworker or friends", - question: "How did you commute to work today?", - answerOptions: ["Uber", "Lyft"], - __v:0 -} + { + "category": "Commute", + "description": "Carpool with coworker or friends", + "question": "How did you commute to work today?", + "answerOptions": ["Drived", "Carpooled", "Bike", "Public Transport"] + } ``` ``` -{ - category: "Recycle", - description: "Separate bin for recycle stuff", - question: "How much did you dump today for recycle", - answerOptions: ["3boxes", "4boxes"], - __v:0 -} + { + "category": "Recycle", + "description": "Separate your recycble materials", + "question": "Did you separate your recycble materials today?", + "answerOptions": ["Yes", "No"] + } ``` - Note: When you insert a document, append the above json fields to the already defined unique id in the document