# DomainWatch - Technical Context ## Tech Stack ### Backend - **Framework:** FastAPI (Python 3.11+) - **Database:** SQLite (development) / PostgreSQL (production) - **ORM:** SQLAlchemy 2.0 with async support - **Authentication:** JWT with python-jose, bcrypt for password hashing - **Scheduling:** APScheduler for background jobs ### Frontend - **Framework:** Next.js 14 (App Router) - **Styling:** Tailwind CSS - **State Management:** Zustand - **Icons:** Lucide React (outlined icons) ### Domain Checking - **WHOIS:** python-whois library - **DNS:** dnspython library - No external APIs required ## Project Structure ``` hushen_test/ ├── backend/ │ ├── app/ │ │ ├── api/ # API endpoints │ │ ├── models/ # Database models │ │ ├── schemas/ # Pydantic schemas │ │ ├── services/ # Business logic │ │ ├── config.py # Settings │ │ ├── database.py # DB configuration │ │ ├── main.py # FastAPI app │ │ └── scheduler.py # Background jobs │ ├── requirements.txt │ └── run.py ├── frontend/ │ ├── src/ │ │ ├── app/ # Next.js pages │ │ ├── components/ # React components │ │ └── lib/ # Utilities │ └── package.json └── memory-bank/ # Project documentation ``` ## API Endpoints ### Public - `POST /api/v1/check/` - Check domain availability - `GET /api/v1/check/{domain}` - Quick domain check ### Authenticated - `POST /api/v1/auth/register` - Register user - `POST /api/v1/auth/login` - Get JWT token - `GET /api/v1/auth/me` - Current user info - `GET /api/v1/domains/` - List monitored domains - `POST /api/v1/domains/` - Add domain to watchlist - `DELETE /api/v1/domains/{id}` - Remove domain - `POST /api/v1/domains/{id}/refresh` - Manual refresh - `GET /api/v1/subscription/` - User subscription info - `GET /api/v1/subscription/tiers` - Available plans ## Development ### Backend ```bash cd backend python -m venv venv source venv/bin/activate pip install -r requirements.txt python run.py ``` ### Frontend ```bash cd frontend npm install npm run dev ``` ## Production Deployment - Backend: uvicorn with gunicorn - Frontend: next build && next start - Database: PostgreSQL recommended - Reverse proxy: nginx recommended