+ );
+}
+
+export default Page;
diff --git a/src/context/AuthContext.tsx b/src/context/AuthContext.tsx
new file mode 100644
index 0000000..4939764
--- /dev/null
+++ b/src/context/AuthContext.tsx
@@ -0,0 +1,48 @@
+'use client'
+import { createContext, useContext, useEffect, useState, ReactNode } from 'react';
+import { getAuth, onAuthStateChanged, User } from 'firebase/auth';
+import firebase_app from '@/firebase/config';
+
+// Initialize Firebase auth instance
+const auth = getAuth( firebase_app );
+
+// Create the authentication context
+export const AuthContext = createContext( {} );
+
+// Custom hook to access the authentication context
+export const useAuthContext = () => useContext( AuthContext );
+
+interface AuthContextProviderProps {
+ children: ReactNode;
+}
+
+export function AuthContextProvider( { children }: AuthContextProviderProps ): JSX.Element {
+ // Set up state to track the authenticated user and loading status
+ const [ user, setUser ] = useState( null );
+ const [ loading, setLoading ] = useState( true );
+
+ useEffect( () => {
+ // Subscribe to the authentication state changes
+ const unsubscribe = onAuthStateChanged( auth, ( user ) => {
+ if ( user ) {
+ // User is signed in
+ setUser( user );
+ } else {
+ // User is signed out
+ setUser( null );
+ }
+ // Set loading to false once authentication state is determined
+ setLoading( false );
+ } );
+
+ // Unsubscribe from the authentication state changes when the component is unmounted
+ return () => unsubscribe();
+ }, [] );
+
+ // Provide the authentication context to child components
+ return (
+
+ {loading ?
Loading...
: children}
+
+ );
+}
diff --git a/src/firebase/auth/signIn.ts b/src/firebase/auth/signIn.ts
new file mode 100644
index 0000000..2a094c8
--- /dev/null
+++ b/src/firebase/auth/signIn.ts
@@ -0,0 +1,19 @@
+import firebase_app from "../config";
+import { signInWithEmailAndPassword, getAuth } from "firebase/auth";
+
+// Get the authentication instance using the Firebase app
+const auth = getAuth(firebase_app);
+
+// Function to sign in with email and password
+export default async function signIn(email: string, password: string) {
+ let result = null, // Variable to store the sign-in result
+ error = null; // Variable to store any error that occurs
+
+ try {
+ result = await signInWithEmailAndPassword(auth, email, password); // Sign in with email and password
+ } catch (e) {
+ error = e; // Catch and store any error that occurs during sign-in
+ }
+
+ return { result, error }; // Return the sign-in result and error (if any)
+}
diff --git a/src/firebase/auth/signup.ts b/src/firebase/auth/signup.ts
new file mode 100644
index 0000000..8f3f3a9
--- /dev/null
+++ b/src/firebase/auth/signup.ts
@@ -0,0 +1,19 @@
+import firebase_app from "../config";
+import { createUserWithEmailAndPassword, getAuth } from "firebase/auth";
+
+// Get the authentication instance using the Firebase app
+const auth = getAuth(firebase_app);
+
+// Function to sign up a user with email and password
+export default async function signUp(email: string, password: string) {
+ let result = null, // Variable to store the sign-up result
+ error = null; // Variable to store any error that occurs
+
+ try {
+ result = await createUserWithEmailAndPassword(auth, email, password); // Create a new user with email and password
+ } catch (e) {
+ error = e; // Catch and store any error that occurs during sign-up
+ }
+
+ return { result, error }; // Return the sign-up result and error (if any)
+}
diff --git a/src/firebase/config.ts b/src/firebase/config.ts
new file mode 100644
index 0000000..05fa9af
--- /dev/null
+++ b/src/firebase/config.ts
@@ -0,0 +1,19 @@
+// Import the functions you need from the SDKs you need
+import { initializeApp, getApps } from "firebase/app";
+// TODO: Add SDKs for Firebase products that you want to use
+// https://firebase.google.com/docs/web/setup#available-libraries
+
+// Your web app's Firebase configuration
+const firebaseConfig = {
+ apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
+ authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
+ projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
+ storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
+ messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
+ appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
+};
+
+// Initialize Firebase
+let firebase_app = getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0];
+
+export default firebase_app;
\ No newline at end of file
diff --git a/src/firebase/firestore/addData.ts b/src/firebase/firestore/addData.ts
new file mode 100644
index 0000000..ba7d33d
--- /dev/null
+++ b/src/firebase/firestore/addData.ts
@@ -0,0 +1,30 @@
+import firebase_app from "../config";
+import { getFirestore, doc, setDoc } from "firebase/firestore";
+
+// Get the Firestore instance
+const db = getFirestore(firebase_app);
+
+// Function to add data to a Firestore collection
+export default async function addData(
+ collection: string,
+ id: string,
+ data: any
+) {
+ // Variable to store the result of the operation
+ let result = null;
+ // Variable to store any error that occurs during the operation
+ let error = null;
+
+ try {
+ // Set the document with the provided data in the specified collection and ID
+ result = await setDoc(doc(db, collection, id), data, {
+ merge: true, // Merge the new data with existing document data
+ });
+ } catch (e) {
+ // Catch and store any error that occurs during the operation
+ error = e;
+ }
+
+ // Return the result and error as an object
+ return { result, error };
+}
diff --git a/src/firebase/firestore/getData.js b/src/firebase/firestore/getData.js
new file mode 100644
index 0000000..18e819b
--- /dev/null
+++ b/src/firebase/firestore/getData.js
@@ -0,0 +1,26 @@
+import firebase_app from "../config";
+import { getFirestore, doc, getDoc } from "firebase/firestore";
+
+// Get the Firestore instance
+const db = getFirestore(firebase_app);
+
+// Function to retrieve a document from a Firestore collection
+export default async function getDocument(collection, id) {
+ // Create a document reference using the provided collection and ID
+ const docRef = doc(db, collection, id);
+ // Variable to store the result of the operation
+ let result = null;
+ // Variable to store any error that occurs during the operation
+ let error = null;
+
+ try {
+ // Retrieve the document using the document reference
+ result = await getDoc(docRef);
+ } catch (e) {
+ // Catch and store any error that occurs during the operation
+ error = e;
+ }
+
+ // Return the result and error as an object
+ return { result, error };
+}
diff --git a/tailwind.config.js b/tailwind.config.js
new file mode 100644
index 0000000..d53b2ea
--- /dev/null
+++ b/tailwind.config.js
@@ -0,0 +1,18 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: [
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
+ './src/app/**/*.{js,ts,jsx,tsx,mdx}',
+ ],
+ theme: {
+ extend: {
+ backgroundImage: {
+ 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
+ 'gradient-conic':
+ 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
+ },
+ },
+ },
+ plugins: [],
+}
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 0000000..7611ef4
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,28 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ],
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/firebase/firebase.js", "src/firebase/signup.js", "src/firebase/app/signup/page.tsx", "src/firebase/config.ts"],
+ "exclude": ["node_modules"]
+}