Skip to content

Commit 6bd382a

Browse files
committed
Set Up Scrapper Example
1 parent db99e99 commit 6bd382a

32 files changed

+5428
-0
lines changed

typescript/scrapper/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/browser-use"
2+
3+
BROWSER_USE_API_KEY=""

typescript/scrapper/.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
!.env.example
36+
37+
# vercel
38+
.vercel
39+
40+
# typescript
41+
*.tsbuildinfo
42+
next-env.d.ts
43+
44+
# data
45+
/data

typescript/scrapper/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.12.0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.eslint": "explicit"
5+
},
6+
"editor.tabSize": 2,
7+
"editor.insertSpaces": true,
8+
"editor.detectIndentation": false,
9+
"editor.formatOnSave": true,
10+
"editor.formatOnPaste": true,
11+
"editor.formatOnSaveMode": "file"
12+
}

typescript/scrapper/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/app/globals.css",
9+
"baseColor": "stone",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
services:
2+
postgres:
3+
restart: always
4+
image: postgres:17
5+
healthcheck:
6+
test: ["CMD-SHELL", "pg_isready -U postgres"]
7+
interval: 5s
8+
timeout: 5s
9+
retries: 5
10+
environment:
11+
- POSTGRES_USER=postgres
12+
- POSTGRES_PASSWORD=postgres
13+
- POSTGRES_DB=browser-use
14+
ports:
15+
- "5432:5432"
16+
volumes:
17+
- ./data/postgres:/var/lib/postgresql/data
18+
command: postgres -c max_connections=1000
19+
networks:
20+
- scrapper-network
21+
22+
networks:
23+
scrapper-network:
24+
driver: bridge
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import "dotenv/config";
2+
3+
import { defineConfig } from "drizzle-kit";
4+
5+
export default defineConfig({
6+
out: "./drizzle",
7+
schema: "./src/db/schema.ts",
8+
dialect: "postgresql",
9+
dbCredentials: {
10+
url: process.env.DATABASE_URL!,
11+
},
12+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE "profiles" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"input" text NOT NULL,
4+
"columns" jsonb NOT NULL
5+
);
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"id": "711a389e-2004-4cc1-86c0-d925dba89551",
3+
"prevId": "00000000-0000-0000-0000-000000000000",
4+
"version": "7",
5+
"dialect": "postgresql",
6+
"tables": {
7+
"public.profiles": {
8+
"name": "profiles",
9+
"schema": "",
10+
"columns": {
11+
"id": {
12+
"name": "id",
13+
"type": "text",
14+
"primaryKey": true,
15+
"notNull": true
16+
},
17+
"input": {
18+
"name": "input",
19+
"type": "text",
20+
"primaryKey": false,
21+
"notNull": true
22+
},
23+
"columns": {
24+
"name": "columns",
25+
"type": "jsonb",
26+
"primaryKey": false,
27+
"notNull": true
28+
}
29+
},
30+
"indexes": {},
31+
"foreignKeys": {},
32+
"compositePrimaryKeys": {},
33+
"uniqueConstraints": {},
34+
"policies": {},
35+
"checkConstraints": {},
36+
"isRLSEnabled": false
37+
}
38+
},
39+
"enums": {},
40+
"schemas": {},
41+
"sequences": {},
42+
"roles": {},
43+
"policies": {},
44+
"views": {},
45+
"_meta": {
46+
"columns": {},
47+
"schemas": {},
48+
"tables": {}
49+
}
50+
}

0 commit comments

Comments
 (0)