Skip to content

Commit 29e6e5f

Browse files
Initial release: SureNav v1.0.0
1 parent 741117a commit 29e6e5f

19 files changed

Lines changed: 420 additions & 0 deletions

.dockerignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
__pycache__
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.Python
6+
env/
7+
venv/
8+
.venv
9+
pip-log.txt
10+
pip-delete-this-directory.txt
11+
.tox/
12+
.coverage
13+
.coverage.*
14+
.cache
15+
nosetests.xml
16+
coverage.xml
17+
*.cover
18+
*.log
19+
.git
20+
.gitignore
21+
.mypy_cache
22+
.pytest_cache
23+
.hypothesis
24+
*.egg-info/
25+
dist/
26+
build/
27+
*.egg
28+
.DS_Store
29+
tests/
30+
docs/
31+
*.md

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.9", "3.10", "3.11", "3.12"]
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
pip install pytest flake8 black
25+
playwright install chromium
26+
27+
- name: Run tests
28+
run: pytest tests/ -v
29+
30+
- name: Lint
31+
run: |
32+
flake8 src/ --max-line-length=120
33+
black --check src/
34+
35+
docker:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Build Docker image
41+
run: docker build -t surenav:test .
42+
43+
- name: Test Docker image
44+
run: |
45+
docker run -d -p 8000:8000 surenav:test
46+
sleep 10
47+
curl -f http://localhost:8000/health || exit 1

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y \
7+
wget \
8+
gnupg \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Copy requirements first for better caching
12+
COPY requirements.txt .
13+
RUN pip install --no-cache-dir -r requirements.txt
14+
15+
# Install Playwright browsers
16+
RUN playwright install chromium
17+
RUN playwright install-deps chromium
18+
19+
# Copy application code
20+
COPY src/ ./src/
21+
22+
# Expose port
23+
EXPOSE 8000
24+
25+
# Run the server
26+
CMD ["python", "-m", "uvicorn", "src.server:app", "--host", "0.0.0.0", "--port", "8000"]

docs/ARCHITECTURE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SureNav Architecture
2+
3+
## Overview
4+
SureNav is built with a modular architecture for web scraping and browser automation.
5+
6+
## Components
7+
8+
### 1. StealthBrowser
9+
- Playwright-based browser automation
10+
- Anti-detection fingerprinting
11+
- JavaScript rendering
12+
13+
### 2. FreeProxyManager
14+
- Aggregates free proxies from multiple sources
15+
- Validates and rotates proxies
16+
- Handles proxy failures
17+
18+
### 3. GoogleSearcher
19+
- Scrapes Google search results
20+
- Bypasses rate limiting
21+
- Returns structured data
22+
23+
### 4. FastAPI Server
24+
- RESTful API endpoints
25+
- Async request handling
26+
- Health monitoring
27+
28+
## Data Flow
29+
```
30+
Client → FastAPI → ProxyManager → StealthBrowser → Target Site → Response
31+
```

docs/DEPLOYMENT.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SureNav Deployment Guide
2+
3+
## Docker Deployment
4+
5+
### Build Image
6+
```bash
7+
docker build -t surenav:latest .
8+
```
9+
10+
### Run Container
11+
```bash
12+
docker run -d -p 8000:8000 surenav:latest
13+
```
14+
15+
## Local Deployment
16+
17+
### Install Dependencies
18+
```bash
19+
pip install -r requirements.txt
20+
playwright install chromium
21+
```
22+
23+
### Run Server
24+
```bash
25+
python -m uvicorn src.server:app --host 0.0.0.0 --port 8000
26+
```
27+
28+
## Environment Variables
29+
- `SURENAV_PORT`: Server port (default: 8000)
30+
- `SURENAV_PROXY_REFRESH`: Proxy refresh interval in seconds (default: 300)
31+
- `SURENAV_HEADLESS`: Run browser headless (default: true)
32+
- `SURENAV_MAX_RETRIES`: Max retry attempts (default: 3)

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "surenav"
7+
version = "1.0.0"
8+
description = "Open-source web unblocker for AI agents"
9+
readme = "README.md"
10+
license = {text = "MIT"}
11+
requires-python = ">=3.9"
12+
authors = [
13+
{name = "Your Name", email = "your.email@example.com"}
14+
]
15+
keywords = ["web scraping", "browser automation", "ai agents", "anti-detection", "proxies"]
16+
17+
[project.urls]
18+
Homepage = "https://github.com/YOUR_USERNAME/surenav"
19+
Documentation = "https://github.com/YOUR_USERNAME/surenav#readme"
20+
Repository = "https://github.com/YOUR_USERNAME/surenav.git"
21+
Issues = "https://github.com/YOUR_USERNAME/surenav/issues"
22+
23+
[tool.setuptools.packages.find]
24+
where = ["src"]

requirements.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
fastapi>=0.109.0
2+
uvicorn[standard]>=0.27.0
3+
playwright>=1.41.0
4+
playwright-stealth>=1.0.6
5+
beautifulsoup4>=4.12.3
6+
markdownify>=0.11.6
7+
aiohttp>=3.9.3
8+
aiofiles>=23.2.1
9+
fake-useragent>=1.4.0
10+
pydantic>=2.6.0
11+
pyyaml>=6.0.1
12+
httpx>=0.26.0

scripts/install-playwright.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Install Playwright and browsers
3+
4+
echo "Installing Playwright..."
5+
pip install playwright
6+
7+
echo "Installing Chromium browser..."
8+
playwright install chromium
9+
10+
echo "Installing system dependencies..."
11+
playwright install-deps chromium
12+
13+
echo "✅ Playwright installation complete!"

setup.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from setuptools import setup, find_packages
2+
3+
with open("README.md", "r", encoding="utf-8") as fh:
4+
long_description = fh.read()
5+
6+
setup(
7+
name="surenav",
8+
version="1.0.0",
9+
author="Your Name",
10+
author_email="your.email@example.com",
11+
description="Open-source web unblocker for AI agents",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/YOUR_USERNAME/surenav",
15+
packages=find_packages(where="src"),
16+
package_dir={"": "src"},
17+
classifiers=[
18+
"Development Status :: 4 - Beta",
19+
"Intended Audience :: Developers",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Topic :: Internet :: WWW/HTTP",
28+
"Topic :: Software Development :: Libraries :: Python Modules",
29+
],
30+
python_requires=">=3.9",
31+
install_requires=[
32+
"fastapi>=0.109.0",
33+
"uvicorn[standard]>=0.27.0",
34+
"playwright>=1.41.0",
35+
"playwright-stealth>=1.0.6",
36+
"beautifulsoup4>=4.12.3",
37+
"markdownify>=0.11.6",
38+
"aiohttp>=3.9.3",
39+
"aiofiles>=23.2.1",
40+
"fake-useragent>=1.4.0",
41+
"pydantic>=2.6.0",
42+
"pyyaml>=6.0.1",
43+
"httpx>=0.26.0",
44+
],
45+
entry_points={
46+
"console_scripts": [
47+
"surenav-server=surenav.server:main",
48+
],
49+
},
50+
)

src/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""
2+
SureNav - Open-source web unblocker for AI agents
3+
"""
4+
5+
__version__ = "1.0.0"
6+
__author__ = "Your Name"
7+
8+
from .browser import StealthBrowser
9+
from .proxy_manager import FreeProxyManager
10+
from .search import GoogleSearcher
11+
12+
__all__ = ["StealthBrowser", "FreeProxyManager", "GoogleSearcher"]

0 commit comments

Comments
 (0)