From 2ddb77b34ad96f11f77539070b2a123dc60dbc38 Mon Sep 17 00:00:00 2001 From: DivyamAgg24 <142659327+DivyamAgg24@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:22:18 +0530 Subject: [PATCH] added backend and frontend --- LeadGen/.gitignore | 39 + LeadGen/.npmrc | 0 LeadGen/README.md | 84 + LeadGen/apps/frontend/.gitignore | 24 + LeadGen/apps/frontend/README.md | 54 + LeadGen/apps/frontend/eslint.config.js | 28 + LeadGen/apps/frontend/index.html | 13 + LeadGen/apps/frontend/package.json | 37 + LeadGen/apps/frontend/public/vite.svg | 1 + LeadGen/apps/frontend/src/App.css | 42 + LeadGen/apps/frontend/src/App.tsx | 19 + LeadGen/apps/frontend/src/Layout/Topbar.tsx | 49 + LeadGen/apps/frontend/src/Layout/layout.tsx | 17 + LeadGen/apps/frontend/src/assets/react.svg | 1 + .../frontend/src/components/EmptyState.tsx | 70 + .../apps/frontend/src/components/Header.tsx | 51 + .../frontend/src/components/PlaceCard.tsx | 131 + .../frontend/src/components/PlaceDetail.tsx | 210 + .../frontend/src/components/PlaceFilters.tsx | 118 + .../apps/frontend/src/components/PlaceMap.tsx | 103 + .../src/components/PlacesExplorer.tsx | 189 + .../apps/frontend/src/components/UI/Badge.tsx | 35 + .../frontend/src/components/UI/Button.tsx | 51 + .../apps/frontend/src/components/UI/Card.tsx | 111 + .../frontend/src/components/UI/Spinner.tsx | 37 + .../src/components/UI/ToggleButton.tsx | 66 + .../apps/frontend/src/hooks/useLocation.ts | 60 + LeadGen/apps/frontend/src/hooks/usePlaces.ts | 58 + LeadGen/apps/frontend/src/hooks/useTheme.ts | 40 + LeadGen/apps/frontend/src/index.css | 76 + LeadGen/apps/frontend/src/lib/utils.ts | 126 + LeadGen/apps/frontend/src/main.tsx | 10 + LeadGen/apps/frontend/src/pages/Home.tsx | 77 + LeadGen/apps/frontend/src/pages/Lead.tsx | 165 + .../frontend/src/services/mockAiService.ts | 192 + LeadGen/apps/frontend/src/types/index.ts | 50 + LeadGen/apps/frontend/src/vite-env.d.ts | 1 + LeadGen/apps/frontend/tsconfig.app.json | 27 + LeadGen/apps/frontend/tsconfig.json | 7 + LeadGen/apps/frontend/tsconfig.node.json | 25 + LeadGen/apps/frontend/vite.config.ts | 10 + LeadGen/package-lock.json | 8718 +++++++++++++++++ LeadGen/package.json | 24 + LeadGen/packages/eslint-config/README.md | 3 + LeadGen/packages/eslint-config/base.js | 32 + LeadGen/packages/eslint-config/next.js | 49 + LeadGen/packages/eslint-config/package.json | 24 + .../packages/eslint-config/react-internal.js | 39 + LeadGen/packages/typescript-config/base.json | 19 + .../packages/typescript-config/nextjs.json | 12 + .../packages/typescript-config/package.json | 9 + .../typescript-config/react-library.json | 7 + LeadGen/packages/ui/eslint.config.mjs | 4 + LeadGen/packages/ui/package.json | 27 + LeadGen/packages/ui/src/button.tsx | 20 + LeadGen/packages/ui/src/card.tsx | 27 + LeadGen/packages/ui/src/code.tsx | 11 + LeadGen/packages/ui/tsconfig.json | 8 + .../packages/ui/turbo/generators/config.ts | 30 + .../turbo/generators/templates/component.hbs | 8 + LeadGen/turbo.json | 21 + backend/.env | 2 + backend/.env.example | 2 + backend/.gitignore | 6 + backend/agents/__init__.py | 18 + .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 296 bytes .../agents/__pycache__/agent.cpython-310.pyc | Bin 0 -> 2005 bytes backend/agents/agent.py | 102 + backend/app.py | 184 + backend/main.py | 27 + backend/surrounding_places.xlsx | Bin 0 -> 5085 bytes backend/tasks/__init__.py | 5 + .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 233 bytes .../tasks/__pycache__/task.cpython-310.pyc | Bin 0 -> 3212 bytes backend/tasks/task.py | 115 + backend/temp.py | 421 + backend/tools/__init__.py | 16 + .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 340 bytes .../tools/__pycache__/tools.cpython-310.pyc | Bin 0 -> 5896 bytes backend/tools/tools.py | 127 + 80 files changed, 12621 insertions(+) create mode 100644 LeadGen/.gitignore create mode 100644 LeadGen/.npmrc create mode 100644 LeadGen/README.md create mode 100644 LeadGen/apps/frontend/.gitignore create mode 100644 LeadGen/apps/frontend/README.md create mode 100644 LeadGen/apps/frontend/eslint.config.js create mode 100644 LeadGen/apps/frontend/index.html create mode 100644 LeadGen/apps/frontend/package.json create mode 100644 LeadGen/apps/frontend/public/vite.svg create mode 100644 LeadGen/apps/frontend/src/App.css create mode 100644 LeadGen/apps/frontend/src/App.tsx create mode 100644 LeadGen/apps/frontend/src/Layout/Topbar.tsx create mode 100644 LeadGen/apps/frontend/src/Layout/layout.tsx create mode 100644 LeadGen/apps/frontend/src/assets/react.svg create mode 100644 LeadGen/apps/frontend/src/components/EmptyState.tsx create mode 100644 LeadGen/apps/frontend/src/components/Header.tsx create mode 100644 LeadGen/apps/frontend/src/components/PlaceCard.tsx create mode 100644 LeadGen/apps/frontend/src/components/PlaceDetail.tsx create mode 100644 LeadGen/apps/frontend/src/components/PlaceFilters.tsx create mode 100644 LeadGen/apps/frontend/src/components/PlaceMap.tsx create mode 100644 LeadGen/apps/frontend/src/components/PlacesExplorer.tsx create mode 100644 LeadGen/apps/frontend/src/components/UI/Badge.tsx create mode 100644 LeadGen/apps/frontend/src/components/UI/Button.tsx create mode 100644 LeadGen/apps/frontend/src/components/UI/Card.tsx create mode 100644 LeadGen/apps/frontend/src/components/UI/Spinner.tsx create mode 100644 LeadGen/apps/frontend/src/components/UI/ToggleButton.tsx create mode 100644 LeadGen/apps/frontend/src/hooks/useLocation.ts create mode 100644 LeadGen/apps/frontend/src/hooks/usePlaces.ts create mode 100644 LeadGen/apps/frontend/src/hooks/useTheme.ts create mode 100644 LeadGen/apps/frontend/src/index.css create mode 100644 LeadGen/apps/frontend/src/lib/utils.ts create mode 100644 LeadGen/apps/frontend/src/main.tsx create mode 100644 LeadGen/apps/frontend/src/pages/Home.tsx create mode 100644 LeadGen/apps/frontend/src/pages/Lead.tsx create mode 100644 LeadGen/apps/frontend/src/services/mockAiService.ts create mode 100644 LeadGen/apps/frontend/src/types/index.ts create mode 100644 LeadGen/apps/frontend/src/vite-env.d.ts create mode 100644 LeadGen/apps/frontend/tsconfig.app.json create mode 100644 LeadGen/apps/frontend/tsconfig.json create mode 100644 LeadGen/apps/frontend/tsconfig.node.json create mode 100644 LeadGen/apps/frontend/vite.config.ts create mode 100644 LeadGen/package-lock.json create mode 100644 LeadGen/package.json create mode 100644 LeadGen/packages/eslint-config/README.md create mode 100644 LeadGen/packages/eslint-config/base.js create mode 100644 LeadGen/packages/eslint-config/next.js create mode 100644 LeadGen/packages/eslint-config/package.json create mode 100644 LeadGen/packages/eslint-config/react-internal.js create mode 100644 LeadGen/packages/typescript-config/base.json create mode 100644 LeadGen/packages/typescript-config/nextjs.json create mode 100644 LeadGen/packages/typescript-config/package.json create mode 100644 LeadGen/packages/typescript-config/react-library.json create mode 100644 LeadGen/packages/ui/eslint.config.mjs create mode 100644 LeadGen/packages/ui/package.json create mode 100644 LeadGen/packages/ui/src/button.tsx create mode 100644 LeadGen/packages/ui/src/card.tsx create mode 100644 LeadGen/packages/ui/src/code.tsx create mode 100644 LeadGen/packages/ui/tsconfig.json create mode 100644 LeadGen/packages/ui/turbo/generators/config.ts create mode 100644 LeadGen/packages/ui/turbo/generators/templates/component.hbs create mode 100644 LeadGen/turbo.json create mode 100644 backend/.env create mode 100644 backend/.env.example create mode 100644 backend/.gitignore create mode 100644 backend/agents/__init__.py create mode 100644 backend/agents/__pycache__/__init__.cpython-310.pyc create mode 100644 backend/agents/__pycache__/agent.cpython-310.pyc create mode 100644 backend/agents/agent.py create mode 100644 backend/app.py create mode 100644 backend/main.py create mode 100644 backend/surrounding_places.xlsx create mode 100644 backend/tasks/__init__.py create mode 100644 backend/tasks/__pycache__/__init__.cpython-310.pyc create mode 100644 backend/tasks/__pycache__/task.cpython-310.pyc create mode 100644 backend/tasks/task.py create mode 100644 backend/temp.py create mode 100644 backend/tools/__init__.py create mode 100644 backend/tools/__pycache__/__init__.cpython-310.pyc create mode 100644 backend/tools/__pycache__/tools.cpython-310.pyc create mode 100644 backend/tools/tools.py diff --git a/LeadGen/.gitignore b/LeadGen/.gitignore new file mode 100644 index 0000000..2d01d2a --- /dev/null +++ b/LeadGen/.gitignore @@ -0,0 +1,39 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# Dependencies +node_modules +.pnp +.pnp.js + +# Local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Testing +coverage + +# Turbo +.turbo + +# Vercel +.vercel + +# Build Outputs +.next/ +out/ +build +dist + + +# Debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Misc +.DS_Store +*.pem +crew_agent \ No newline at end of file diff --git a/LeadGen/.npmrc b/LeadGen/.npmrc new file mode 100644 index 0000000..e69de29 diff --git a/LeadGen/README.md b/LeadGen/README.md new file mode 100644 index 0000000..3c4889f --- /dev/null +++ b/LeadGen/README.md @@ -0,0 +1,84 @@ +# Turborepo starter + +This Turborepo starter is maintained by the Turborepo core team. + +## Using this example + +Run the following command: + +```sh +npx create-turbo@latest +``` + +## What's inside? + +This Turborepo includes the following packages/apps: + +### Apps and Packages + +- `docs`: a [Next.js](https://nextjs.org/) app +- `web`: another [Next.js](https://nextjs.org/) app +- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications +- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) +- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo + +Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). + +### Utilities + +This Turborepo has some additional tools already setup for you: + +- [TypeScript](https://www.typescriptlang.org/) for static type checking +- [ESLint](https://eslint.org/) for code linting +- [Prettier](https://prettier.io) for code formatting + +### Build + +To build all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm build +``` + +### Develop + +To develop all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm dev +``` + +### Remote Caching + +> [!TIP] +> Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk&utm_campaign=free_remote_cache). + +Turborepo can use a technique known as [Remote Caching](https://turborepo.com/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. + +By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup?utm_source=turborepo-examples), then enter the following commands: + +``` +cd my-turborepo +npx turbo login +``` + +This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). + +Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo: + +``` +npx turbo link +``` + +## Useful Links + +Learn more about the power of Turborepo: + +- [Tasks](https://turborepo.com/docs/crafting-your-repository/running-tasks) +- [Caching](https://turborepo.com/docs/crafting-your-repository/caching) +- [Remote Caching](https://turborepo.com/docs/core-concepts/remote-caching) +- [Filtering](https://turborepo.com/docs/crafting-your-repository/running-tasks#using-filters) +- [Configuration Options](https://turborepo.com/docs/reference/configuration) +- [CLI Usage](https://turborepo.com/docs/reference/command-line-reference) diff --git a/LeadGen/apps/frontend/.gitignore b/LeadGen/apps/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/LeadGen/apps/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/LeadGen/apps/frontend/README.md b/LeadGen/apps/frontend/README.md new file mode 100644 index 0000000..da98444 --- /dev/null +++ b/LeadGen/apps/frontend/README.md @@ -0,0 +1,54 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default tseslint.config({ + extends: [ + // Remove ...tseslint.configs.recommended and replace with this + ...tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + ...tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + ...tseslint.configs.stylisticTypeChecked, + ], + languageOptions: { + // other options... + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + }, +}) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default tseslint.config({ + plugins: { + // Add the react-x and react-dom plugins + 'react-x': reactX, + 'react-dom': reactDom, + }, + rules: { + // other rules... + // Enable its recommended typescript rules + ...reactX.configs['recommended-typescript'].rules, + ...reactDom.configs.recommended.rules, + }, +}) +``` diff --git a/LeadGen/apps/frontend/eslint.config.js b/LeadGen/apps/frontend/eslint.config.js new file mode 100644 index 0000000..092408a --- /dev/null +++ b/LeadGen/apps/frontend/eslint.config.js @@ -0,0 +1,28 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' + +export default tseslint.config( + { ignores: ['dist'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, + }, +) diff --git a/LeadGen/apps/frontend/index.html b/LeadGen/apps/frontend/index.html new file mode 100644 index 0000000..e4b78ea --- /dev/null +++ b/LeadGen/apps/frontend/index.html @@ -0,0 +1,13 @@ + + +
+ + + ++ {message || defaultMessages[type]} +
+ + {onAction && ( + + )} ++ {place.description} +
+ ++ {place.description} +
+Getting your location...
+Finding places near you...
++ {children} +
+ ); +} + +interface CardContentProps extends React.HTMLAttributes+ Discover and analyze nearby places using AI-powered location intelligence +
+ ++ AI agent intelligently identifies and categorizes places around your location. +
++ Get comprehensive information about each location, including ratings, hours, and more. +
++ Download your discoveries in Excel format for further analysis and sharing. +
++ {aiResponse.message} +
+ + {aiResponse.success && aiResponse.filename && ( +File: {aiResponse.filename}
+Places found: {aiResponse.places_count}
+{children}
+ + ); +} diff --git a/LeadGen/packages/ui/src/code.tsx b/LeadGen/packages/ui/src/code.tsx new file mode 100644 index 0000000..f7cbd22 --- /dev/null +++ b/LeadGen/packages/ui/src/code.tsx @@ -0,0 +1,11 @@ +import { type JSX } from "react"; + +export function Code({ + children, + className, +}: { + children: React.ReactNode; + className?: string; +}): JSX.Element { + return{children}
;
+}
diff --git a/LeadGen/packages/ui/tsconfig.json b/LeadGen/packages/ui/tsconfig.json
new file mode 100644
index 0000000..ca86687
--- /dev/null
+++ b/LeadGen/packages/ui/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "@repo/typescript-config/react-library.json",
+ "compilerOptions": {
+ "outDir": "dist"
+ },
+ "include": ["src"],
+ "exclude": ["node_modules", "dist"]
+}
diff --git a/LeadGen/packages/ui/turbo/generators/config.ts b/LeadGen/packages/ui/turbo/generators/config.ts
new file mode 100644
index 0000000..af9647b
--- /dev/null
+++ b/LeadGen/packages/ui/turbo/generators/config.ts
@@ -0,0 +1,30 @@
+import type { PlopTypes } from "@turbo/gen";
+
+// Learn more about Turborepo Generators at https://turborepo.com/docs/guides/generating-code
+
+export default function generator(plop: PlopTypes.NodePlopAPI): void {
+ // A simple generator to add a new React component to the internal UI library
+ plop.setGenerator("react-component", {
+ description: "Adds a new react component",
+ prompts: [
+ {
+ type: "input",
+ name: "name",
+ message: "What is the name of the component?",
+ },
+ ],
+ actions: [
+ {
+ type: "add",
+ path: "src/{{kebabCase name}}.tsx",
+ templateFile: "templates/component.hbs",
+ },
+ {
+ type: "append",
+ path: "package.json",
+ pattern: /"exports": {(?4-XGE47KtX*MIj%bU%t)NFQR)(h#r+-$;p!oi3sQ;|(Kn|>6<&@-vD
z*%Y)3@nfn?RGA4?D$R^l=V