Skip to content

Tech Buddy #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 124 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,133 @@
# Code-with-Google-Maps-2023 - Hack2skill

Welcome to the official repository for the Code-with-Google-Maps-2023 organized by Hack2skill!
# Team Name -

## Getting Started
Tech Buddy

To get started with the Code-with-Google-Maps-2023 repository, follow these steps:
## Problem Statement -

### Submission Instruction:
1. Fork this repository
2. Create a folder with your Team Name
3. Upload all the code and necessary files in the created folder
4. Upload a **README.md** file in your folder with the below mentioned informations.
5. Generate a Pull Request with your Team Name. (Example: submission-XYZ_team)
Real-Time Road Blockage Reporting System with Google

### README.md must consist of the following information:
## Team Leader Email -

#### Team Name -
#### Problem Statement -
#### Team Leader Email -
[email protected]

**Demo link-** https://www.youtube.com/watch?v=7grdZ-Ogf28

### A Brief of the Prototype:
This section must include UML Diagrams and prototype description

### Tech Stack:
List Down all technologies used to Build the prototype

### Step-by-Step Code Execution Instructions:
This Section must contain a set of instructions required to clone and run the prototype so that it can be tested and deeply analyzed

### Future Scope:
Write about the scalability and futuristic aspects of the prototype developed

This section must include UML Diagrams and prototype description
_Description_:
The RoadSafety Web Application Prototype aims to enhance road safety and improve traffic management by allowing users to report road blockages, faults, and other issues in real-time. This application utilizes the Google Maps API to provide a user-friendly interface for reporting and viewing road incidents. It promotes community engagement and enables efficient incident reporting.
_Key Features_:

1. _Real-Time Incident Reporting_: Users can report road incidents such as potholes, accidents, roadblocks, and other issues through the application. The location and details of the incident are captured through Google Maps Api.

2. _Interactive Map Interface_: The application integrates Google Maps to provide a familiar and intuitive map interface. Users can easily pinpoint the location of incidents and view the map interactively.

3. _Custom Markers_: Users can mark incidents on the map using custom markers, making it easy to identify the type and location of each incident.

4. _Community Engagement_: The platform encourages community engagement by allowing users to contribute to road safety. It fosters a sense of responsibility and collaboration among users.

5. _Route Planning_: Users can plan routes, view traffic conditions, and receive real-time traffic updates to ensure safe and efficient travel.
## UML
![image](https://github.com/devil-1964/RoadSafety/assets/98086933/e8498383-9792-4933-9d67-a79bd2aa6e10)

## LOGIN
![WhatsApp Image 2023-10-26 at 22 15 51_fc2c10d2](https://github.com/devil-1964/RoadSafety/assets/98086933/3dcc5009-58df-4f2e-9027-65991f11c0b4)

## HOME PAGE
![WhatsApp Image 2023-10-26 at 22 16 46_b46472c5](https://github.com/devil-1964/RoadSafety/assets/98086933/acb9db6e-1550-4777-a3cb-88ec63470395)

## ROUTE
![WhatsApp Image 2023-10-26 at 22 18 09_742db4cb](https://github.com/devil-1964/RoadSafety/assets/98086933/1a83acc6-0aa2-4839-b606-55a7a7d3c9ae)

## REPORTING AN ISSUE
![WhatsApp Image 2023-10-26 at 22 19 57_1c79267c](https://github.com/devil-1964/RoadSafety/assets/98086933/5a0ffb72-adfa-44fa-bf97-a8c49a314e9f)

### Tech Stack:

- *HTML*

- *CSS*

- *JAVASCRIPT*

- *REACT*

- *NODE*

- *EXPRESS JS*

- *PASSPORT JS*

- *GOOGLE MAPS API*

- *mongo DB*

- *CHAKRA UI*

# Step-by-Step Code Execution Instructions:

## To Start The Backend

**Clone the repo**

``` git clone https://github.com/Tushar106/RoadSafety.git ```

**Open the RoadSafety**

``` cd RoadSafety ```

**Starting the backend**

``` cd backend ```

``` npm install ```

``` node index.js ```

**Create an .env**

```
PORT=8800
MONGO="mongodb+srv://<YOUR_MONGODB_NAME>:<PASSWORD>@cluster0.liyyi8h.mongodb.net/RoadSafety?retryWrites=true&w=majority"
GOOGLE_CLIENT_ID="YOUR_GOOGLE_ID"
GOOGLE_CLIENT_SECRET="YOUR_GOOGLE_SECRET"
```

- NOTE : **MUST CONTAIN THE ACCESS FOR AUTH0**

## To Start The Frontend

``` cd frontend ```

``` npm install ```

``` npm start ```

**create an .env file**

```
REACT_APP_GOOGLE_MAPS_API= "YOUR_API_KEY"
```

### Future Scope & Scalability:

**Futuristic Aspects:**

- Predictive Analytics: Incorporating machine learning and AI algorithms, the prototype can predict road safety issues based on historical incident data and current conditions. This can enable proactive measures to mitigate risks.

- Emergency Services Integration: In emergencies, the application can directly notify and coordinate with local emergency services, providing real-time information about incidents to expedite responses.

- Global Data Sharing: In the future, the application can facilitate data sharing with other road safety platforms and government agencies, creating a global network for incident reporting and analysis.

**Scalability:**

- Geographical Expansion: The prototype can scale to cover a broader geographical area, making it applicable to regions beyond its initial deployment. As the user base grows, it can accommodate reports from various locations, becoming a valuable tool for road safety worldwide.

- Additional Incident Categories: The application can scale by adding more incident categories, such as construction zones, traffic accidents, or weather-related issues. This enhances its utility for diverse road safety concerns.

- Multilingual Support: To cater to a global audience, multilingual support can be integrated, allowing users to report incidents and access information in their preferred language.

- User Profiles and Rewards: Scalability includes the addition of user profiles and reward systems. Users could earn points or incentives for their contributions to road safety, fostering increased engagement.
23 changes: 23 additions & 0 deletions Tech Buddy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
121 changes: 121 additions & 0 deletions Tech Buddy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Code-with-Google-Maps-2023 - Hack2skill

# Team Name -

Tech Buddy

## Problem Statement -

Real-Time Road Blockage Reporting System with Google

## Team Leader Email -

[email protected]

### A Brief of the Prototype:

This section must include UML Diagrams and prototype description
_Description_:
The RoadSafety Web Application Prototype aims to enhance road safety and improve traffic management by allowing users to report road blockages, faults, and other issues in real-time. This application utilizes the Google Maps API to provide a user-friendly interface for reporting and viewing road incidents. It promotes community engagement and enables efficient incident reporting.
_Key Features_:

1. _Real-Time Incident Reporting_: Users can report road incidents such as potholes, accidents, roadblocks, and other issues through the application. The location and details of the incident are captured through Google Maps Api.

2. _Interactive Map Interface_: The application integrates Google Maps to provide a familiar and intuitive map interface. Users can easily pinpoint the location of incidents and view the map interactively.

3. _Custom Markers_: Users can mark incidents on the map using custom markers, making it easy to identify the type and location of each incident.

4. _Community Engagement_: The platform encourages community engagement by allowing users to contribute to road safety. It fosters a sense of responsibility and collaboration among users.

5. _Route Planning_: Users can plan routes, view traffic conditions, and receive real-time traffic updates to ensure safe and efficient travel.
## UML
![image](https://github.com/devil-1964/RoadSafety/assets/98086933/e8498383-9792-4933-9d67-a79bd2aa6e10)

## LOGIN
![WhatsApp Image 2023-10-26 at 22 15 51_fc2c10d2](https://github.com/devil-1964/RoadSafety/assets/98086933/3dcc5009-58df-4f2e-9027-65991f11c0b4)

## HOME PAGE
![WhatsApp Image 2023-10-26 at 22 16 46_b46472c5](https://github.com/devil-1964/RoadSafety/assets/98086933/acb9db6e-1550-4777-a3cb-88ec63470395)

## ROUTE
![WhatsApp Image 2023-10-26 at 22 18 09_742db4cb](https://github.com/devil-1964/RoadSafety/assets/98086933/1a83acc6-0aa2-4839-b606-55a7a7d3c9ae)

## REPORTING AN ISSUE
![WhatsApp Image 2023-10-26 at 22 19 57_1c79267c](https://github.com/devil-1964/RoadSafety/assets/98086933/5a0ffb72-adfa-44fa-bf97-a8c49a314e9f)

### Tech Stack:

- *HTML*

- *CSS*

- *JAVASCRIPT*

- *REACT*

- *NODE*

- *EXPRESS JS*

- *PASSPORT JS*

- *GOOGLE MAPS API*

- *mongo DB*

- *CHAKRA UI*

### Step-by-Step Code Execution Instructions:

## To Start The Backend

**Clone the repo**

``` git clone https://github.com/Tushar106/RoadSafety.git ```

**Open the RoadSafety**

``` cd RoadSafety ```

**Starting the backend**

``` cd backend ```

``` npm install ```

``` node index.js ```

**Create an .env**

```
PORT=8800
MONGO="mongodb+srv://<YOUR_MONGODB_NAME>:<PASSWORD>@cluster0.liyyi8h.mongodb.net/RoadSafety?retryWrites=true&w=majority"
GOOGLE_CLIENT_ID="YOUR_GOOGLE_ID"
GOOGLE_CLIENT_SECRET="YOUR_GOOGLE_SECRET"
```

- NOTE : **MUST CONTAIN THE ACCESS FOR AUTH0**

## To Start The Frontend

``` cd frontend ```

``` npm install ```

``` npm start ```

**create an .env file**

```
REACT_APP_GOOGLE_MAPS_API= "YOUR_API_KEY"
```

### Future Scope:

**Futuristic Aspects:**

- Predictive Analytics: Incorporating machine learning and AI algorithms, the prototype can predict road safety issues based on historical incident data and current conditions. This can enable proactive measures to mitigate risks.

- Emergency Services Integration: In emergencies, the application can directly notify and coordinate with local emergency services, providing real-time information about incidents to expedite responses.

- Global Data Sharing: In the future, the application can facilitate data sharing with other road safety platforms and government agencies, creating a global network for incident reporting and analysis.
2 changes: 2 additions & 0 deletions Tech Buddy/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
55 changes: 55 additions & 0 deletions Tech Buddy/backend/controller/report.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const Report = require('../models/reportModel');
const nodemailer = require("nodemailer");

const reportRegister = async (req, res) => {
// console.log(req.isAuthenticated());
if (req.isAuthenticated()) {
try{const { longitude, latitude, icon, desc, title } = req.body;
// console.log(req.user)
if(!longitude || !latitude ||!icon || !desc){
return res.status(400).json({msg: "Please fill all fields"})
}
const transporter = nodemailer.createTransport({
host: 'smtp.ethereal.email',
port: 587,
auth: {
user: '[email protected]',
pass: 'QpNWpQGS1yfw5Jj6H6'
}
});

const info = await transporter.sendMail({
from: `"RoadSafety!" <${req.user._id}>`, // sender address
to: "[email protected]", // list of receivers
subject: "Reporting an Issue", // Subject line
text: `${desc}`, // plain text body
html: `<div>${desc}<div><br/><div>Image Link - <a href='${icon}'>Link</a></div>`, // html body
});
const newReport =await new Report({
longitude: longitude, latitude: latitude, icon: icon, description: desc, title: title,userId:req.user._id
})
await newReport.save();
res.status(200).json(newReport);
}
catch{
res.status(400).json("not created")
}
}
else {
res.status(403).json({ error: true, message: "Not Authorized" });
}
}
const getReport=async(req,res)=>{
try{
const reports = await Report.find();
res.status(200).json(reports);
}
catch(err){
res.status(500).json({ error: 'Internal server error' });
}
}




module.exports = { reportRegister, getReport};
Loading