Sprint 1 Progress - Kaleemunnisa/CS691-Spring2025-Team6 GitHub Wiki
The goal of Sprint 1 was to set up the project structure, initialize the frontend and backend, and implement authentication.
Summary:
Set up the project structure for both frontend (React Native) and backend (Node.js).
Code Snippet:
# Initialize React Native project
npx react-native init Travel-Guide
import React, { useState } from "react";
// Importing the login and signup components from their respective folders
import LoginScreen from "./(auth)/login";
export default function Index() {
const [isSignIn, setIsSignIn] = useState(false); // State to manage view
return <LoginScreen />;
}
export const signUp = async (userType, userData) => {
try {
if (userType === "tourist") {
} else if (userType === "guide") {
} else if (userType === "business") {
}
console.log("User signed up successfully");
} catch (error) {
console.error("Error signing up user:", error);
}
};
// Sign in with email and password
export const signIn = async (email, password, setLoading, setError, router) => {
setLoading(true);
setError(null);
try {
if (userDocSnap.exists()) {
} else {
console.log("User document does not exist.");
}
// Step 4: Navigate to the home screen
router.navigate("/(tabs)/(home)");
if (err instanceof Error) {
console.error("Login error:", err.message);
} else {
console.error("Login error:", err);
}
} finally {
setLoading(false);
}
};
Summary:
Connected the project to the Firestore database.
Code Snippet:
const firebaseConfig = {
apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
// Initialize Firebase Auth with AsyncStorage persistence
const auth = initializeAuth(app, {
persistence: getReactNativePersistence(ReactNativeAsyncStorage),
});
const db = getFirestore(app);
export { auth, db };
Summary:
Designed login and sign-up UI screens.
Code Snippet:
import { TextInput, Button } from "react-native";
const LoginScreen = () => {
return (
<>
<View style={{ position: "relative" }}>
<LottieAnimation
source={require("://path-to-animation")}
width={250}
height={250}
/>
</View>
{/* Header */}
<Text style={styles.header}>Welcome Back!</Text>
{/* Login form */}
<LoginForm />
</>
);
};
import { TextInput, Button } from "react-native";
const SignUpScreen = () => {
return (
<>
// remaining fields
<TextInput
style={styles.input}
placeholder="Location"
onChangeText={(value) => handleChange("location", value)}
placeholderTextColor={textColor}
/>
</>
);
};
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |