diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/README.md b/README.md index c7115de..aa9e57b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@  Main repo for ChatMaps, our COS420 Project. -ChatMaps is a web-based social networking service that allows users to connect to others in their local geographic area. It will implement an interactable mapping utility to show general user locations relative to other users, as well as a chat room feature that allows users to start public conversations based on a specified topic. ChatMaps is primarily intended for use in densely populated areas, such as college campuses or metropolitan areas, so people of similar interests can start conversations. The goal of this project is to create a web app that plots locations, gives a radius of the local area, and connects users into different topic-based chat rooms. +ChatMaps is a web-based social networking service that allows users to connect to others in their local geographic area. It implements an interactable mapping utility to show general user locations relative to other users, as well as a chat room feature that allows users to start public conversations based on a specified topic. ChatMaps is primarily intended for use in densely populated areas, such as college campuses or metropolitan areas, so people of similar interests can start conversations. The goal of this project is to create a web app that plots locations, gives a radius of the local area, and connects users into different topic-based chat rooms. -This service will implement user login and profiles, allowing users to add each other as friends and start private conversations. There will be several default chat rooms of varying topics, but users will also have the ability to create their own topics that will be viewable by other users. For example, a user at the University of Maine could create a joinable chat room titled “COS420”, which would be visible to others near this campus. +This service implements user login and profiles, allowing users to add each other as friends and start private conversations. There are several default chat rooms of varying topics, but users also have the ability to create their own topics that will be viewable by other users. For example, a user at the University of Maine could create a joinable chat room titled “COS420”, which would be visible to others near this campus. This app shares some similarities to other social networks that implement location-based content. ChatMaps’ novel approach is to utilize user location to facilitate real-time communication with others within a given radius. @@ -15,6 +15,8 @@ A local version can be run with: cd frontend-next/ +npm install + npm run build npm run dev diff --git a/deliverables/ChatMaps Proposal Presentation.pptx b/deliverables/ChatMaps Proposal Presentation.pptx new file mode 100644 index 0000000..7339674 Binary files /dev/null and b/deliverables/ChatMaps Proposal Presentation.pptx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_DomainModel.docx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_DomainModel.docx new file mode 100644 index 0000000..7764b77 Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_DomainModel.docx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_ProductBacklog_3.xlsx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_ProductBacklog_3.xlsx new file mode 100644 index 0000000..4b2ba13 Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_ProductBacklog_3.xlsx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_SRS.docx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SRS.docx new file mode 100644 index 0000000..c99da14 Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SRS.docx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_SequenceDiagram.docx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SequenceDiagram.docx new file mode 100644 index 0000000..819585d Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SequenceDiagram.docx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_SoftwareArchitecture.docx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SoftwareArchitecture.docx new file mode 100644 index 0000000..ccc65bf Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SoftwareArchitecture.docx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_SprintBacklog_3.xlsx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SprintBacklog_3.xlsx new file mode 100644 index 0000000..7124631 Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SprintBacklog_3.xlsx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_SprintReview_3.docx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SprintReview_3.docx new file mode 100644 index 0000000..4269180 Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_SprintReview_3.docx differ diff --git a/deliverables/deliverable_3/ChatMaps_Deliverable_3_UseCaseModel.docx b/deliverables/deliverable_3/ChatMaps_Deliverable_3_UseCaseModel.docx new file mode 100644 index 0000000..d2133d8 Binary files /dev/null and b/deliverables/deliverable_3/ChatMaps_Deliverable_3_UseCaseModel.docx differ diff --git a/frontend-next/src/app/app/layout.js b/frontend-next/src/app/app/layout.js index 18a5f84..632275f 100644 --- a/frontend-next/src/app/app/layout.js +++ b/frontend-next/src/app/app/layout.js @@ -11,9 +11,7 @@ export const metadata = { export default function RootLayout({ children }) { return ( -
- {children} - + {children} ); } diff --git a/frontend-next/src/app/app/page.js b/frontend-next/src/app/app/page.js index b0e0a5b..30ccac9 100644 --- a/frontend-next/src/app/app/page.js +++ b/frontend-next/src/app/app/page.js @@ -4,9 +4,8 @@ import { useState, useEffect } from "react"; import { auth, database } from "../../../firebase-config"; import { ref, onValue, set, remove, get } from "firebase/database"; import { useBeforeunload } from "react-beforeunload"; -import {Marker} from "pigeon-maps"; -import {onAuthStateChanged} from "firebase/auth" - +import { Marker } from "pigeon-maps"; +import { onAuthStateChanged } from "firebase/auth"; // Refactored Component Imports // Data Structure Imports @@ -20,7 +19,7 @@ import { MainTabChatRoom } from "../../components/app/main_tab/chat"; import { MainTabHome } from "../../components/app/main_tab/home"; // Sidebar Imports -import {Home_Sidebar} from "../../components/app/sidebar/home"; +import { Home_Sidebar } from "../../components/app/sidebar/home"; import { Chat_Sidebar } from "../../components/app/sidebar/chat"; import { Profile_Sidebar } from "../../components/app/sidebar/profile"; @@ -32,100 +31,111 @@ function Home() { const [tab, setTab] = useState("nearby"); // Sidebar Tab const [chatRoomObj, setChatRoomObj] = useState(null); // Current chatroom object const [myRoomsObj, setMyRoomsObj] = useState(null); // My Rooms Object - const [myRooms, setRoomData] = useState(null); // Current user saved rooms list - const [isRoomLoading, setRoomLoading] = useState(true); // myRooms loading variable, true = myRooms loading, false = finished loading + const [roomData, setRoomData] = useState(null); // Current user saved rooms list + const [isRoomLoading, setIsRoomLoading] = useState(true); // myRooms loading variable, true = myRooms loading, false = finished loading const [isMyRoom, setIsMyRoom] = useState(false); // Is current room in myRooms? true, false const [location, setLocation] = useState(null); // location variable [lat,long] const [loadingLoc, setLoadingLoc] = useState(true); // location variable loading, true = loading, false = finished loading const [nearby, setNearby] = useState(null); // nearby rooms array const [loadingNearby, setLoadingNearby] = useState(true); // loading nearby rooms array, true = loading, false = finished loading - const [chatroomOnline, setChatRoomOnline] = useState(null); // holds online users + const [chatroomOnline, setChatroomOnline] = useState(null); // holds online users const [chatroomUsers, setChatroomUsers] = useState(null); // holds all chatroom users const [chatroomUsersLoading, setChatroomUsersLoading] = useState(true); const [markers, setMarkers] = useState([]); - const [isAuthenticated, setAuth] = useState(false) - const [user, setUser] = useState(null) - const [usingSearchParams, setUsingSearchParams] = useState(true) + const [isAuthenticated, setIsAuthenticated] = useState(false); + const [user, setUser] = useState(null); + const [usingSearchParams, setUsingSearchParams] = useState(true); useEffect(() => { const searchParams = new URLSearchParams(document.location.search); - var roomSwitch = null + var roomSwitch = null; if (searchParams.has("room") && usingSearchParams && user) { - roomSwitch = searchParams.get("room") - setUsingSearchParams(false) - get(ref(database, `rooms/${searchParams.get("room")}`)).then((snapshot) => { - selectChatRoom(snapshot.val()) - }); + roomSwitch = searchParams.get("room"); + setUsingSearchParams(false); + get(ref(database, `rooms/${searchParams.get("room")}`)).then( + (snapshot) => { + selectChatRoom(snapshot.val()); + } + ); } - }, [user]) + }, [user]); // Authentication useEffect(() => { onAuthStateChanged(auth, (user) => { if (user) { - get(ref(database, `users/${user.uid}`)) - .then((userData) => { - userData = userData.val() + get(ref(database, `users/${user.uid}`)).then((userData) => { + userData = userData.val(); if (userData) { - setUser(userData) - setAuth(true) + setUser(userData); + setIsAuthenticated(true); } else { - window.location.href = "/onboarding" + window.location.href = "/onboarding"; } - - }) + }); } else { - setAuth(false) - window.location.href = "/login" + setIsAuthenticated(false); + window.location.href = "/login"; } - }) - }, []) + }); + }, []); // Grabs user data, saves to user, then lists the users saved rooms useEffect(() => { - if (user) { - onValue(ref(database, "/users/" + user.uid + "/rooms"), (snapshot) => { - setRoomLoading(true); - var rooms = snapshot.val(); - setMyRoomsObj(rooms); - var roomArr = []; - var markerArr = markers; - for (var room in rooms) { - var newRoom = ( -
+
+ Chat with friends!
+
-
- Chat with friends!
-
-
+ Chat with friends!
+
-
- Chat with friends!
-
-
+ Chat with friends!
+
-
-
-
+
+
+