From 004539d4abfb4ac185da797e85ef07c7fc311e33 Mon Sep 17 00:00:00 2001 From: Bhagy3sh <141747782+Bhagy3sh@users.noreply.github.com> Date: Tue, 4 Mar 2025 14:50:09 +0530 Subject: [PATCH 1/2] Added basic files and routing Added basic files in frontend for Mood input, Calendar, Profile, Sign in / sign up , Conversations, Insights, Notifications, Badges / Streaks. Added basic routing for these files. --- backend/src/index.ts | 36 ++++++++++++++++++++++++++++++++++ frontend/App.tsx | 29 +++++++++++++++++++++++++++ frontend/src/BadgesStreaks.tsx | 12 ++++++++++++ frontend/src/CalendarInput.tsx | 10 ++++++++++ frontend/src/Conversations.tsx | 10 ++++++++++ frontend/src/Insights.tsx | 13 ++++++++++++ frontend/src/MoodInput.tsx | 10 ++++++++++ frontend/src/Notifications.tsx | 10 ++++++++++ frontend/src/Profile.tsx | 10 ++++++++++ frontend/src/SignIn.tsx | 10 ++++++++++ frontend/src/SignUp.tsx | 10 ++++++++++ frontend/src/routes.tsx | 19 ++++++++++++++++++ package.json | 18 ++++++++++------- 13 files changed, 190 insertions(+), 7 deletions(-) create mode 100644 frontend/src/BadgesStreaks.tsx create mode 100644 frontend/src/CalendarInput.tsx create mode 100644 frontend/src/Conversations.tsx create mode 100644 frontend/src/Insights.tsx create mode 100644 frontend/src/MoodInput.tsx create mode 100644 frontend/src/Notifications.tsx create mode 100644 frontend/src/Profile.tsx create mode 100644 frontend/src/SignIn.tsx create mode 100644 frontend/src/SignUp.tsx diff --git a/backend/src/index.ts b/backend/src/index.ts index 996ba53..fb984a9 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -9,6 +9,42 @@ app.get("/", (req, res) => { res.send("Hello from Express!"); }); +app.post("/api/signup", (req, res) => { + res.json({ message: "User signed up successfully" }); +}); + +app.post("/api/signin", (req, res) => { + res.json({ message: "Logged in" }); +}); + +app.get("/api/profile", (req, res) => { + res.json({ message: "User details fetched" }); +}); + +app.post("/api/mood", (req, res) => { + res.json({ message: "Mood recorded" }); +}); + +app.get("/api/calendar", (req, res) => { + res.json({ message: "Calendar data retrieved" }); +}); + +app.get("/api/conversations", (req, res) => { + res.json({ message: "Conversations fetched" }); +}); + +app.get("/api/insights", (req, res) => { + res.json({ message: "Insights generated" }); +}); + +app.get("/api/notifications", (req, res) => { + res.json({ message: "Notifications retrieved" }); +}); + +app.get("/api/badges_streaks", (req, res) => { + res.json({ message: "Badges and streaks updated" }); +}); + app.listen(port, () => { console.log(`Server running at http://localhost:${port}`); }); diff --git a/frontend/App.tsx b/frontend/App.tsx index 0329d0c..0fa18d4 100644 --- a/frontend/App.tsx +++ b/frontend/App.tsx @@ -1,11 +1,40 @@ import { StatusBar } from 'expo-status-bar'; import { StyleSheet, Text, View } from 'react-native'; +import { NavigationContainer } from '@react-navigation/native'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import BadgesStreaks from './src/BadgesStreaks'; +import CalendarInput from './src/CalendarInput'; +import Conversations from './src/Conversations'; +import Insights from './src/Insights'; +import MoodInput from './src/MoodInput'; +import Notifications from './src/Notifications'; +import Profile from './src/Profile'; +import SignIn from './src/SignIn'; +import SignUp from './src/SignUp'; +import About from './src/routes' +import Home from './src/routes' +const Stack = createNativeStackNavigator(); export default function App() { return ( Open up App.tsx to start working on your app! + + + + + + + + + + + + + + + ); } diff --git a/frontend/src/BadgesStreaks.tsx b/frontend/src/BadgesStreaks.tsx new file mode 100644 index 0000000..7b7bb0d --- /dev/null +++ b/frontend/src/BadgesStreaks.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function BadgesStreaks(){ + return ( + + Badges & Streaks + Streak: 5 days + Badge: Consistent + + ); +} \ No newline at end of file diff --git a/frontend/src/CalendarInput.tsx b/frontend/src/CalendarInput.tsx new file mode 100644 index 0000000..0456c2e --- /dev/null +++ b/frontend/src/CalendarInput.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function CalendarInput(){ + return ( + + Calender Page + + ); +} \ No newline at end of file diff --git a/frontend/src/Conversations.tsx b/frontend/src/Conversations.tsx new file mode 100644 index 0000000..9913488 --- /dev/null +++ b/frontend/src/Conversations.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function Conversations(){ + return ( + + Conversations + + ); +} \ No newline at end of file diff --git a/frontend/src/Insights.tsx b/frontend/src/Insights.tsx new file mode 100644 index 0000000..4a7487c --- /dev/null +++ b/frontend/src/Insights.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function Insights(){ + return ( + + Insights + Days active: 12 + Mood logs: 8 + Top mood: Happy + + ); +} \ No newline at end of file diff --git a/frontend/src/MoodInput.tsx b/frontend/src/MoodInput.tsx new file mode 100644 index 0000000..37e5be9 --- /dev/null +++ b/frontend/src/MoodInput.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function MoodInput(){ + return( + + Mood Input Page + + ); +} \ No newline at end of file diff --git a/frontend/src/Notifications.tsx b/frontend/src/Notifications.tsx new file mode 100644 index 0000000..0e46bf1 --- /dev/null +++ b/frontend/src/Notifications.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function Notifications(){ + return ( + + Notif Page + + ); +} \ No newline at end of file diff --git a/frontend/src/Profile.tsx b/frontend/src/Profile.tsx new file mode 100644 index 0000000..8a23a15 --- /dev/null +++ b/frontend/src/Profile.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function Profile(){ + return ( + + Profile Page + + ); +} \ No newline at end of file diff --git a/frontend/src/SignIn.tsx b/frontend/src/SignIn.tsx new file mode 100644 index 0000000..2891075 --- /dev/null +++ b/frontend/src/SignIn.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function SignIn(){ + return ( + + Sign In Page + + ); +} \ No newline at end of file diff --git a/frontend/src/SignUp.tsx b/frontend/src/SignUp.tsx new file mode 100644 index 0000000..3139748 --- /dev/null +++ b/frontend/src/SignUp.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function SignUp(){ + return ( + + Sign Up Page + + ); +} \ No newline at end of file diff --git a/frontend/src/routes.tsx b/frontend/src/routes.tsx index eedba86..424fd9b 100644 --- a/frontend/src/routes.tsx +++ b/frontend/src/routes.tsx @@ -1,6 +1,15 @@ import React from 'react'; import { Text } from 'react-native'; import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'; +import BadgesStreaks from './BadgesStreaks'; +import CalendarInput from './CalendarInput'; +import Conversations from './Conversations'; +import Insights from './Insights'; +import MoodInput from './MoodInput'; +import Notifications from './Notifications'; +import Profile from './Profile'; +import SignIn from './SignIn'; +import SignUp from './SignUp'; const Home = () => (
@@ -20,6 +29,16 @@ const AppRoutes = () => { } /> } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + ); diff --git a/package.json b/package.json index f258ab4..4082c47 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "backend", "version": "1.0.0", - "description": "", + "description": "**A safe and supportive space for mental wellness.** \r Built for students, by students, this app combines the power of technology with compassion to help users manage their mental health, track progress, and connect anonymously.", "main": "./frontend/index.ts", "scripts": { "dev:backend": "tsx watch backend/src/index.ts", @@ -18,21 +18,25 @@ "dependencies": { "@expo/webpack-config": "^19.0.1", "@prisma/client": "^5.22.0", + "@react-native-picker/picker": "^2.11.0", + "@react-navigation/native": "^7.0.15", + "@react-navigation/native-stack": "^7.2.1", "axios": "^1.7.7", "expo": "~52.0.11", + "expo-constants": "~17.0.3", + "expo-linking": "~7.0.3", + "expo-router": "~4.0.9", "expo-status-bar": "~2.0.0", "express": "^4.21.1", "react": "18.3.1", "react-dom": "^18.3.1", "react-native": "0.76.3", + "react-native-calendars": "^1.1310.0", + "react-native-safe-area-context": "^4.12.0", + "react-native-screens": "~4.1.0", "react-native-web": "^0.19.13", "react-router-dom": "^7.0.1", - "tsx": "^4.19.2", - "expo-router": "~4.0.9", - "react-native-safe-area-context": "4.12.0", - "react-native-screens": "~4.1.0", - "expo-linking": "~7.0.3", - "expo-constants": "~17.0.3" + "tsx": "^4.19.2" }, "devDependencies": { "@babel/core": "^7.25.2", From bca6166ad5c167efde3c5b812c3dbbdd449ff57c Mon Sep 17 00:00:00 2001 From: Bhagy3sh <141747782+Bhagy3sh@users.noreply.github.com> Date: Mon, 5 May 2025 17:34:00 +0530 Subject: [PATCH 2/2] Fixed common bugs - Fixed import statement outside module error - Added Home and About page - Fixed About page routing --- backend/package.json | 16 ++++++++++++++++ frontend/About.tsx | 10 ++++++++++ frontend/src/Home.tsx | 10 ++++++++++ frontend/src/routes.tsx | 1 + package.json | 30 +++++++++++++++--------------- 5 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 backend/package.json create mode 100644 frontend/About.tsx create mode 100644 frontend/src/Home.tsx diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 0000000..3b34dc7 --- /dev/null +++ b/backend/package.json @@ -0,0 +1,16 @@ +{ + "name": "backend", + "version": "1.0.0", + "type": "module", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "^5.1.0" + } +} diff --git a/frontend/About.tsx b/frontend/About.tsx new file mode 100644 index 0000000..cf7551b --- /dev/null +++ b/frontend/About.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function About(){ + return ( + + This is About Page + + ); +} \ No newline at end of file diff --git a/frontend/src/Home.tsx b/frontend/src/Home.tsx new file mode 100644 index 0000000..64876a5 --- /dev/null +++ b/frontend/src/Home.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { View, Text } from 'react-native'; + +export default function Home(){ + return ( + + Home Page + + ); +} \ No newline at end of file diff --git a/frontend/src/routes.tsx b/frontend/src/routes.tsx index 424fd9b..f3df2ef 100644 --- a/frontend/src/routes.tsx +++ b/frontend/src/routes.tsx @@ -28,6 +28,7 @@ const AppRoutes = () => { } /> + } /> } /> } /> } /> diff --git a/package.json b/package.json index 4082c47..56e6987 100644 --- a/package.json +++ b/package.json @@ -19,22 +19,22 @@ "@expo/webpack-config": "^19.0.1", "@prisma/client": "^5.22.0", "@react-native-picker/picker": "^2.11.0", - "@react-navigation/native": "^7.0.15", - "@react-navigation/native-stack": "^7.2.1", + "@react-navigation/native": "^7.0.14", + "@react-navigation/native-stack": "^7.2.0", "axios": "^1.7.7", - "expo": "~52.0.11", - "expo-constants": "~17.0.3", - "expo-linking": "~7.0.3", - "expo-router": "~4.0.9", - "expo-status-bar": "~2.0.0", + "expo": "^53.0.7", + "expo-constants": "~17.1.5", + "expo-linking": "~7.1.4", + "expo-router": "~5.0.5", + "expo-status-bar": "~2.2.3", "express": "^4.21.1", - "react": "18.3.1", - "react-dom": "^18.3.1", - "react-native": "0.76.3", + "react": "19.0.0", + "react-dom": "19.0.0", + "react-native": "0.79.2", "react-native-calendars": "^1.1310.0", - "react-native-safe-area-context": "^4.12.0", - "react-native-screens": "~4.1.0", - "react-native-web": "^0.19.13", + "react-native-safe-area-context": "5.4.0", + "react-native-screens": "~4.10.0", + "react-native-web": "^0.20.0", "react-router-dom": "^7.0.1", "tsx": "^4.19.2" }, @@ -42,9 +42,9 @@ "@babel/core": "^7.25.2", "@types/express": "^5.0.0", "@types/node": "^22.9.3", - "@types/react": "~18.3.12", + "@types/react": "~19.0.10", "prisma": "^5.22.0", "ts-node": "^10.9.2", - "typescript": "^5.7.2" + "typescript": "~5.8.3" } }