A modern, responsive web application that uses AI to analyze privacy policies and terms of service documents, making complex legal language accessible to everyday users.
- React 19 - Modern React with hooks and functional components
- Vite - Fast build tool and development server
- Tailwind CSS 4 - Utility-first CSS framework
- DaisyUI - Beautiful component library
- React Router - Client-side routing
- Axios - HTTP client for API calls
- Node.js - JavaScript runtime
- Express.js - Web application framework
- Google Gemini AI - AI model for policy analysis
- Playwright (optional) - Web scraping for automatic policy extraction
- CORS - Cross-origin resource sharing
Privacy-Policy-Analyser/
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── Alert.jsx
│ │ │ ├── Button.jsx
│ │ │ ├── Disclaimer.jsx
│ │ │ ├── Footer.jsx
│ │ │ ├── Header.jsx
│ │ │ ├── Input.jsx
│ │ │ ├── LoadingSpinner.jsx
│ │ │ ├── PolicyAnalysisDisplay.jsx
│ │ │ └── TextareaInput.jsx
│ │ ├── pages/ # Page components
│ │ │ ├── Homepage.jsx
│ │ │ └── Aboutpage.jsx
│ │ ├── services/ # API services
│ │ │ └── analysisService.js
│ │ ├── lib/ # Utility libraries
│ │ │ └── axios.js
│ │ ├── App.jsx # Main app component with analyzer
│ │ ├── main.jsx # App entry point
│ │ ├── types.js # Type definitions
│ │ └── index.css # Global styles
│ ├── package.json
│ ├── tailwind.config.js
│ └── vite.config.js
├── backend/
│ ├── server.js # Express server with API routes
│ ├── .env.example # Environment variables template
│ └── package.json
└── README.md
- Node.js (v18 or higher)
- npm or yarn package manager
- Google Gemini API key
git clone <repository-url>
cd Privacy-Policy-Analysercd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Add your Gemini API key to .env
GEMINI_API_KEY=your_gemini_api_key_here
PORT=5000cd ../frontend
# Install dependencies
npm install- Visit Google AI Studio
- Create a new API key
- Copy the key to your
.envfile in the backend directory
cd backend
node server.jsThe backend will run on http://localhost:5000
cd frontend
npm run devThe frontend will run on http://localhost:5173
Open your browser and go to http://localhost:5173
- Click "Start Analyzing Policies" or navigate to
/analyzer - Enter the service/website name
- Paste the privacy policy text
- Click "Analyze Policy"
- Wait for the AI analysis results
The analysis will show:
- Overall Ranking: How privacy-friendly the policy is
- Summary: Key points in simple language
- Potential Concerns: Worrying clauses to be aware of
- Positive Aspects: User-friendly features
Analyzes a privacy policy using AI.
Request Body:
{
"serviceName": "Google",
"policyText": "Privacy policy text here..."
}Response:
{
"ranking": "Good - User-Focused",
"summary": "This policy has clear data handling practices...",
"worryingClauses": [
"Data may be shared with third parties for advertising"
],
"positiveAspects": [
"Users can request data deletion",
"Clear explanation of data collection purposes"
]
}Health check endpoint.
Response:
{
"status": "OK",
"message": "Server is running"
}- Google Gemini AI - For providing the AI analysis capabilities
- Tailwind CSS - For the beautiful styling framework
- DaisyUI - For the component library
- React Team - For the amazing frontend framework
- Vite Team - For the fast build tool