# Project export: FLEX

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: Cal Hacks 11.0
- Tagline: AI. Blockchain. Freelancing. Find your BEST candidates!
- Devpost: https://devpost.com/software/flex-se8mtf
- GitHub: https://github.com/DPulavarthy/CalHacks
- Video: https://www.youtube.com/embed/0uHPTtYydYI?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Result: winner (Sui: Reimagine the internet with Sui)
- Team: 3 GitHub contributor(s) — Dhanush (17 commits), Jonathan Kopuri (14 commits), avneetahuja (2 commits)

## Devpost submission (written by the team)

### Overview

FLEX [Freelancing Linking Expertise Xchange]

### Inspiration

Freelancers deserve a platform where they can fully showcase their skills, without worrying about high fees or delayed payments. Companies need fast, reliable access to talent with specific expertise to complete jobs efficiently. "FLEX" bridges the gap, enabling recruiters to instantly find top candidates through AI-powered conversations, ensuring the right fit, right away.

### What it does

Clients talk to our AI, explaining the type of candidate they need and any specific skills they're looking for. As they speak, the AI highlights important keywords and asks any more factors that they would need with the candidate. This data is then analyzed and parsed through our vast database of Freelancers or the best matching candidates. The AI then talks back to the recruiter, showing the top candidates based on the recruiter’s requirements. Once the recruiter picks the right candidate, they can create a smart contract that’s securely stored and managed on the blockchain for transparent payments and agreements.

### How we built it

We built starting with the Frontend using Next.JS, and deployed the entire application on Terraform for seamless scalability. For voice interaction, we integrated Deepgram to generate human-like voice and process recruiter inputs, which are then handled by Fetch.ai's agents. These agents work in tandem: one agent interacts with Flask to analyze keywords from the recruiter's speech, another queries the SingleStore database, and the third handles communication with Deepgram. Using SingleStore's real-time data analysis and Full-Text Search, we find the best candidates based on factors provided by the client. For secure transactions, we utilized SUI blockchain, creating an agreement object once the recruiter posts a job. When a freelancer is selected and both parties reach an agreement, the object gets updated, and escrowed funds are released upon task completion—all through Smart Contracts developed in Move. We also used Flask and Express.js to manage backend and routing efficiently.

### Challenges we ran into

We faced challenges integrating Fetch.ai agents for the first time, particularly with getting smooth communication between them. Learning Move for SUI and connecting smart contracts with the frontend also proved tricky. Setting up reliable Speech to Text was tough, as we struggled to control when voice input should stop. Despite these hurdles, we persevered and successfully developed this full stack application.

### Accomplishments we're proud of

We’re proud to have built a fully finished application while learning and implementing new technologies here at CalHacks. Successfully integrating blockchain and AI into a cohesive solution was a major achievement, especially given how cutting-edge both are. It’s exciting to create something that leverages the potential of these rapidly emerging technologies.

### What we learned

We learned how to work with a range of new technologies, including SUI for blockchain transactions, Fetch.ai for agent communication, and SingleStore for real-time data analysis. We also gained experience with Deepgram for voice AI integration.

### What's next

Next, we plan to implement DAOs for conflict resolution, allowing decentralized governance to handle disputes between freelancers and clients. We also aim to launch on the SUI mainnet and conduct thorough testing to ensure scalability and performance.

## README (from the GitHub repository)

# FLEX [Freelancing Linking Expertise Xchange]

https://devpost.com/software/flex-se8mtf?ref_content=user-portfolio&ref_feature=in_progress

![FLEX](https://github.com/user-attachments/assets/de239f14-f204-43f8-96b0-a5af86a2057b)

![2](https://github.com/user-attachments/assets/2d29c164-164f-45c3-991b-89a741a1c40f)

![3](https://github.com/user-attachments/assets/96ddd503-6e43-41a2-9964-d34f76acb242)

![4](https://github.com/user-attachments/assets/8de610eb-6cd0-4cdb-8b4f-817887c5c7d0)

![5](https://github.com/user-attachments/assets/978a5ab0-8f81-44fd-883a-4abed69fb445)

![6](https://github.com/user-attachments/assets/e02a6c42-0f09-4b47-a1e3-c975f26267ab)








## Detected evidence (automated analysis)

Indexed codebase: 2598 recognized source files, 22922 KB.
- C (language) — detected in the code
- CSS (language) — detected in the code
- Express (technology) — detected in the code
- JavaScript (language) — detected in the code
- Next.js (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Flask (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 3279)

```
backend/.gitignore
backend/evi-env/agents/frontBackSync.py
backend/evi-env/agents/general.py
backend/evi-env/agents/hume.py
backend/evi-env/agents/singlestore.py
backend/evi-env/agents/singlestoreHumeSync.py
backend/evi-env/agents/sui.py
backend/evi-env/hume.py
backend/evi-env/Lib/site-packages/_cffi_backend.cp311-win_amd64.pyd
backend/evi-env/Lib/site-packages/_distutils_hack/__init__.py
backend/evi-env/Lib/site-packages/_distutils_hack/override.py
backend/evi-env/Lib/site-packages/_sounddevice_data/__init__.py
backend/evi-env/Lib/site-packages/_sounddevice_data/portaudio-binaries/README.md
backend/evi-env/Lib/site-packages/_sounddevice.py
backend/evi-env/Lib/site-packages/aiofiles-24.1.0.dist-info/INSTALLER
backend/evi-env/Lib/site-packages/aiofiles-24.1.0.dist-info/licenses/LICENSE
backend/evi-env/Lib/site-packages/aiofiles-24.1.0.dist-info/licenses/NOTICE
backend/evi-env/Lib/site-packages/aiofiles-24.1.0.dist-info/METADATA
backend/evi-env/Lib/site-packages/aiofiles-24.1.0.dist-info/RECORD
backend/evi-env/Lib/site-packages/aiofiles-24.1.0.dist-info/WHEEL
backend/evi-env/Lib/site-packages/aiofiles/__init__.py
backend/evi-env/Lib/site-packages/aiofiles/base.py
backend/evi-env/Lib/site-packages/aiofiles/os.py
backend/evi-env/Lib/site-packages/aiofiles/ospath.py
backend/evi-env/Lib/site-packages/aiofiles/tempfile/__init__.py
backend/evi-env/Lib/site-packages/aiofiles/tempfile/temptypes.py
backend/evi-env/Lib/site-packages/aiofiles/threadpool/__init__.py
backend/evi-env/Lib/site-packages/aiofiles/threadpool/binary.py
backend/evi-env/Lib/site-packages/aiofiles/threadpool/text.py
backend/evi-env/Lib/site-packages/aiofiles/threadpool/utils.py
backend/evi-env/Lib/site-packages/aiohappyeyeballs-2.4.3.dist-info/INSTALLER
backend/evi-env/Lib/site-packages/aiohappyeyeballs-2.4.3.dist-info/LICENSE
backend/evi-env/Lib/site-packages/aiohappyeyeballs-2.4.3.dist-info/METADATA
backend/evi-env/Lib/site-packages/aiohappyeyeballs-2.4.3.dist-info/RECORD
backend/evi-env/Lib/site-packages/aiohappyeyeballs-2.4.3.dist-info/WHEEL
backend/evi-env/Lib/site-packages/aiohappyeyeballs/__init__.py
backend/evi-env/Lib/site-packages/aiohappyeyeballs/_staggered.py
backend/evi-env/Lib/site-packages/aiohappyeyeballs/impl.py
backend/evi-env/Lib/site-packages/aiohappyeyeballs/py.typed
backend/evi-env/Lib/site-packages/aiohappyeyeballs/types.py
backend/evi-env/Lib/site-packages/aiohappyeyeballs/utils.py
backend/evi-env/Lib/site-packages/aiohttp-3.10.10.dist-info/INSTALLER
backend/evi-env/Lib/site-packages/aiohttp-3.10.10.dist-info/LICENSE.txt
backend/evi-env/Lib/site-packages/aiohttp-3.10.10.dist-info/METADATA
backend/evi-env/Lib/site-packages/aiohttp-3.10.10.dist-info/RECORD
backend/evi-env/Lib/site-packages/aiohttp-3.10.10.dist-info/top_level.txt
backend/evi-env/Lib/site-packages/aiohttp-3.10.10.dist-info/WHEEL
backend/evi-env/Lib/site-packages/aiohttp/__init__.py
backend/evi-env/Lib/site-packages/aiohttp/_cparser.pxd
backend/evi-env/Lib/site-packages/aiohttp/_find_header.pxd
backend/evi-env/Lib/site-packages/aiohttp/_headers.pxi
backend/evi-env/Lib/site-packages/aiohttp/_helpers.cp311-win_amd64.pyd
backend/evi-env/Lib/site-packages/aiohttp/_helpers.pyi
backend/evi-env/Lib/site-packages/aiohttp/_helpers.pyx
backend/evi-env/Lib/site-packages/aiohttp/_http_parser.cp311-win_amd64.pyd
backend/evi-env/Lib/site-packages/aiohttp/_http_parser.pyx
backend/evi-env/Lib/site-packages/aiohttp/_http_writer.cp311-win_amd64.pyd
backend/evi-env/Lib/site-packages/aiohttp/_http_writer.pyx
backend/evi-env/Lib/site-packages/aiohttp/_websocket.cp311-win_amd64.pyd
backend/evi-env/Lib/site-packages/aiohttp/_websocket.pyx
backend/evi-env/Lib/site-packages/aiohttp/.hash/_cparser.pxd.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/_find_header.pxd.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/_helpers.pyi.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/_helpers.pyx.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/_http_parser.pyx.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/_http_writer.pyx.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/_websocket.pyx.hash
backend/evi-env/Lib/site-packages/aiohttp/.hash/hdrs.py.hash
backend/evi-env/Lib/site-packages/aiohttp/abc.py
backend/evi-env/Lib/site-packages/aiohttp/base_protocol.py
backend/evi-env/Lib/site-packages/aiohttp/client_exceptions.py
backend/evi-env/Lib/site-packages/aiohttp/client_proto.py
backend/evi-env/Lib/site-packages/aiohttp/client_reqrep.py
backend/evi-env/Lib/site-packages/aiohttp/client_ws.py
backend/evi-env/Lib/site-packages/aiohttp/client.py
backend/evi-env/Lib/site-packages/aiohttp/compression_utils.py
backend/evi-env/Lib/site-packages/aiohttp/connector.py
backend/evi-env/Lib/site-packages/aiohttp/cookiejar.py
backend/evi-env/Lib/site-packages/aiohttp/formdata.py
backend/evi-env/Lib/site-packages/aiohttp/hdrs.py
backend/evi-env/Lib/site-packages/aiohttp/helpers.py
backend/evi-env/Lib/site-packages/aiohttp/http_exceptions.py
backend/evi-env/Lib/site-packages/aiohttp/http_parser.py
backend/evi-env/Lib/site-packages/aiohttp/http_websocket.py
backend/evi-env/Lib/site-packages/aiohttp/http_writer.py
backend/evi-env/Lib/site-packages/aiohttp/http.py
backend/evi-env/Lib/site-packages/aiohttp/log.py
backend/evi-env/Lib/site-packages/aiohttp/multipart.py
backend/evi-env/Lib/site-packages/aiohttp/payload_streamer.py
backend/evi-env/Lib/site-packages/aiohttp/payload.py
backend/evi-env/Lib/site-packages/aiohttp/py.typed
backend/evi-env/Lib/site-packages/aiohttp/pytest_plugin.py
backend/evi-env/Lib/site-packages/aiohttp/resolver.py
backend/evi-env/Lib/site-packages/aiohttp/streams.py
backend/evi-env/Lib/site-packages/aiohttp/tcp_helpers.py
backend/evi-env/Lib/site-packages/aiohttp/test_utils.py
backend/evi-env/Lib/site-packages/aiohttp/tracing.py
backend/evi-env/Lib/site-packages/aiohttp/typedefs.py
backend/evi-env/Lib/site-packages/aiohttp/web_app.py
backend/evi-env/Lib/site-packages/aiohttp/web_exceptions.py
backend/evi-env/Lib/site-packages/aiohttp/web_fileresponse.py
backend/evi-env/Lib/site-packages/aiohttp/web_log.py
backend/evi-env/Lib/site-packages/aiohttp/web_middlewares.py
backend/evi-env/Lib/site-packages/aiohttp/web_protocol.py
backend/evi-env/Lib/site-packages/aiohttp/web_request.py
backend/evi-env/Lib/site-packages/aiohttp/web_response.py
backend/evi-env/Lib/site-packages/aiohttp/web_routedef.py
backend/evi-env/Lib/site-packages/aiohttp/web_runner.py
backend/evi-env/Lib/site-packages/aiohttp/web_server.py
backend/evi-env/Lib/site-packages/aiohttp/web_urldispatcher.py
backend/evi-env/Lib/site-packages/aiohttp/web_ws.py
backend/evi-env/Lib/site-packages/aiohttp/web.py
backend/evi-env/Lib/site-packages/aiohttp/worker.py
backend/evi-env/Lib/site-packages/aiosignal-1.3.1.dist-info/INSTALLER
backend/evi-env/Lib/site-packages/aiosignal-1.3.1.dist-info/LICENSE
backend/evi-env/Lib/site-packages/aiosignal-1.3.1.dist-info/METADATA
backend/evi-env/Lib/site-packages/aiosignal-1.3.1.dist-info/RECORD
backend/evi-env/Lib/site-packages/aiosignal-1.3.1.dist-info/top_level.txt
backend/evi-env/Lib/site-packages/aiosignal-1.3.1.dist-info/WHEEL
backend/evi-env/Lib/site-packages/aiosignal/__init__.py
[3159 more files omitted for size]
```

### Dependencies

- backend/evi-env/requirements.txt: asyncio, hume, python-dotenv
- frontend/package.json: @mysten/dapp-kit@^0.14.5, @mysten/enoki@^0.3.5, @mysten/sui@^1.0.5, @radix-ui/react-avatar@^1.0.4, @radix-ui/react-label@^2.0.2, @radix-ui/react-popover@^1.0.7, @radix-ui/react-slot@^1.0.2, @tanstack/react-query@^5.37.1, @types/node@^20, @types/react@^18, @types/react-dom@^18, @vercel/analytics@^1.3.1, axios@^1.7.7, class-variance-authority@^0.7.0, clsx@^2.1.1, eslint@^8, eslint-config-next@14.2.3, eslint-config-prettier@^9.1.0, jwt-decode@^4.0.0, lucide-react@^0.379.0, next@14.2.3, next-themes@^0.3.0, postcss@^8, react@^18, react-dom@^18, react-spinners@^0.13.8, sonner@^1.4.41, tailwind-merge@^2.3.0, tailwindcss@^3.4.1, tailwindcss-animate@^1.0.7, typescript@^5, zod@^3.23.8
- package.json: @deepgram/sdk@^3.8.1, cors@^2.8.5, dotenv@^16.4.5, express@^4.21.1, zod@^3.23.8

### Recent commits (newest first)

- Delete node_modules directory
- Removed Database Password+Connection
- Update README.md
- terraform code
- ignore the fs
- latest with voice and everything
- integrating eveyrhting
- added smart contracts
- Merge branch 'main' of https://github.com/DPulavarthy/CalHacks
- loading
- updated agent_1 to listen on port 5000
- Merge branch 'main' of https://github.com/DPulavarthy/CalHacks
- uncoment
- 5000 api
- updated uagents in package.json
- updated agent_1 with get request
- updated directory
- Merge branch 'main' of github.com:DPulavarthy/CalHacks
- added agents
- Merge branch 'main' of https://github.com/DPulavarthy/CalHacks

## Key source files (fetched from GitHub, selected and truncated for size)

### backend/evi-env/Lib/site-packages/idna-3.10.dist-info/LICENSE.md

```markdown
BSD 3-Clause License

Copyright (c) 2013-2024, Kim Davies and contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

```

### backend/evi-env/Lib/site-packages/httpx-0.27.2.dist-info/licenses/LICENSE.md

```markdown
Copyright © 2019, [Encode OSS Ltd](https://www.encode.io/).
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

```

### package.json

```
{
  "dependencies": {
    "@deepgram/sdk": "^3.8.1",
    "cors": "^2.8.5",
    "dotenv": "^16.4.5",
    "express": "^4.21.1",
    "zod": "^3.23.8"
  }
}

```

### frontend/package.json

```
{
  "name": "enoki-example-app",
  "version": "0.1.0",
  "private": true,
  "license": "MIT",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@mysten/dapp-kit": "^0.14.5",
    "@mysten/enoki": "^0.3.5",
    "@mysten/sui": "^1.0.5",
    "@radix-ui/react-avatar": "^1.0.4",
    "@radix-ui/react-label": "^2.0.2",
    "@radix-ui/react-popover": "^1.0.7",
    "@radix-ui/react-slot": "^1.0.2",
    "@tanstack/react-query": "^5.37.1",
    "@vercel/analytics": "^1.3.1",
    "axios": "^1.7.7",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "jwt-decode": "^4.0.0",
    "lucide-react": "^0.379.0",
    "next": "14.2.3",
    "next-themes": "^0.3.0",
    "react": "^18",
    "react-dom": "^18",
    "react-spinners": "^0.13.8",
    "sonner": "^1.4.41",
    "tailwind-merge": "^2.3.0",
    "tailwindcss-animate": "^1.0.7",
    "zod": "^3.23.8"
  },
  "devDependencies": {
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "eslint": "^8",
    "eslint-config-next": "14.2.3",
    "eslint-config-prettier": "^9.1.0",
    "postcss": "^8",
    "tailwindcss": "^3.4.1",
    "typescript": "^5"
  }
}

```

### backend/evi-env/requirements.txt

```
asyncio
python-dotenv
hume
```

### backend/index.py

```python
import json
import singlestoredb as s2
conn = s2.connect(host='', port='', user='',
                  password='', database='')

def read_skills_from_file():
    try:
        with open('keywords.txt', 'r') as file:
            # Read the file and split the string into a list of skills
            skills = file.read().strip().split(', ')
        return skills
    except FileNotFoundError:
        return None


skills = read_skills_from_file()

skillString = ' '.join([f'+Skills:"{skill}"' for skill in skills])
query = f"SELECT Firstname, Lastname, Skills FROM db_rishikeshan_3eeba.`Freelancer` WHERE MATCH (TABLE db_rishikeshan_3eeba.`Freelancer`) AGAINST ('{skillString}') LIMIT 5;"

# query = "UPDATE db_rishikeshan_3eeba.`Freelancer` SET WalletAddress = '';"
# query = "SELECT * FROM db_rishikeshan_3eeba.`Freelancer`WHERE MATCH (TABLE db_rishikeshan_3eeba.`Freelancer`) AGAINST ('+Skills:\"Docker\" +Skills:\"Python\" +Skills:\"AWS\" +Skills:\"React\"') Limit 5;"

with conn.cursor() as cur:
    cur.execute(query)
    result = cur.fetchall()

    # Convert the result into a list of dictionaries
    freelancers = [
        {"first_name": row[0], "last_name": row[1], "skills": row[2]}
        for row in result
    ]

    # Write the list of dictionaries to a JSON file
    with open('freelancers.json', 'w') as f:
        json.dump(freelancers, f, indent=4)

print("Data has been written to freelancers.json")

```

### frontend/app/layout.tsx

```typescript
import { Metadata } from "next";
import { ProvidersAndLayout } from "./ProvidersAndLayout";
import "./globals.css";
import "@mysten/dapp-kit/dist/index.css";

export const metadata: Metadata = {
  title: "Enoki Example App",
  description: "Learn how to build a dApp with Enoki",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <head>
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" />
        <link href="https://fonts.googleapis.com/css2?family=Beiruti:wght@200..900&display=swap" rel="stylesheet" />
        <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400..900&display=swap" rel="stylesheet" />
      </head>
      <body>
        <ProvidersAndLayout>{children}</ProvidersAndLayout>
      </body>
    </html>
  );
}

```

### frontend/app/page.tsx

```typescript
"use client";

import styles from "./header.module.css"
import { useEffect, useState } from "react";
import { useCustomWallet } from "@/contexts/CustomWallet";
// import ProfilePopover from "@/components/ProfilePopover";
import { CreateAgreement } from "@/components/CreateAgreement";
import { isValidSuiObjectId } from "@mysten/sui/utils";
import { Counter } from "@/components/Counter";
import clientConfig from "@/config/clientConfig";
import dynamic from 'next/dynamic';
import { ClaimButton } from "@/components/ClaimButton";
import { CompleteButton } from "@/components/CompleteButton";
import { IncompleteButton } from "@/components/IncompleteButton";

const ProfilePopover = dynamic(() => import('@/components/ProfilePopover'), { ssr: false });

export default function Page() {
  const { isConnected } = useCustomWallet();
  const [counterId, setCounter] = useState<string | null>(null);
  const [objectID, setObjectID] = useState<string>("null");

  useEffect(() => {
    const hash = window.location.hash.slice(1);
    if (isValidSuiObjectId(hash)) {
      setCounter(hash);
    }
  }, []);


  return (
    <div className="w-full h-full min-h-screen">
      <div>
        <h1 className={styles.logo}>
          <div>
            <span data-after="reelancer">F</span>
            <span data-after="inking">L</span>
            <span data-after="xpertise">E</span>
            <span data-after="change">X</span>
          </div>
        </h1>
      </div>
      <ProfilePopover />
      <div className="w-full flex flex-col items-center gap-4 p-4">
        
          
        {/* <Counter id={clientConfig.GLOBAL_COUNTER_ID} /> */}
        {
          counterId ? <>
            <Counter id={counterId} setObjectID = {setObjectID}/>
            </>
           : 
            <>
            {/* <CreateAgreement
              onCreated={(id) => {
                window.location.hash = id;
                setCounter(id);
                
              }}
            />
             */}
            </>
           
            
          }
          
            {objectID!=="null" &&
          <>
          <ClaimButton onCreated={(id) => {
                window.location.hash = id;
                setCounter(id);
                
              }} objectID={objectID}/>
              <CompleteButton onCreated={(id) => {
                window.location.hash = id;
                setCounter(id);
                
              } } objectID={objectID}/>
              <IncompleteButton onCreated={(id) => {
                window.location.hash = id;
                setCounter(id);
                
              } } objectID={objectID}/>
          </>}
          
      </div>
    </div >
  );
}

```

### frontend/pages/api/index.ts

```typescript
import type { NextApiRequest, NextApiResponse } from 'next'
 
type ResponseData = {
  message: string
}
 
export default function handler(
  req: NextApiRequest,
  res: NextApiResponse<ResponseData>
) {
  res.status(200).json({ message: 'Hello from Next.js!' })
}
```

### frontend/app/auth/page.tsx

```typescript
"use client";

import Loading from "@/components/Loading";
import { useAuthCallback } from "@mysten/enoki/react";
import { useEffect } from "react";

export default function Page() {
  const { handled } = useAuthCallback(); // This hook will handle the callback from the authentication provider

  useEffect(() => {}, [handled]);

  return <Loading />;
}

```

[2373 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]