A comprehensive cybersecurity application that helps users check if their email addresses have been compromised in data breaches. Built with React, Node.js, PostgreSQL, and Elasticsearch.
- Public Search: Shows only the count of breaches for unverified emails
- Verified Search: Provides detailed breach information and security recommendations for verified emails
- OTP-based email verification
- Secure email management for monitoring multiple addresses
- Automatic inclusion of registered email in monitoring list
- JWT-based authentication
- Password hashing with bcrypt
- Email-based OTP verification
- Secure API endpoints with authentication middleware
- Armenian language support
- Responsive React components
- Dropdown for quick email selection
- Modal-based email addition workflow
cyber-tech-sprint/
โโโ frontend/ # React TypeScript application
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โ โโโ atoms/ # Basic components (Button, Input)
โ โ โ โโโ molecules/ # Form components
โ โ โ โโโ organisms/ # Complex components (Header, EmailManager)
โ โ โ โโโ pages/ # Page components
โ โ โโโ context/ # React Context for state management
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ assets/ # Static assets
โ โโโ package.json
โโโ backend/ # Node.js Express server
โ โโโ app.js # Main server file
โ โโโ db.js # PostgreSQL connection
โ โโโ init-users-email-table.sql
โโโ README.md
- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
- Elasticsearch (v7 or higher)
- Gmail account with App Password
-
Install and setup ElasticSearch curl -fsSL https://elastic.co/start-local | sh
-
Clone the repository
git clone <repository-url> cd cyber-tech-sprint
-
Setup Backend
cd backend npm install -
Setup Frontend
cd frontend npm install -
Database Setup
# Connect to PostgreSQL and create database psql -U postgres CREATE DATABASE cyber_security; # Run the user_emails table creation script psql -U postgres -d cyber_security -f backend/init-users-email-table.sql
-
Environment Configuration Create a
.envfile in the backend directory:JWT_SECRET=your-super-secret-key-that-is-long-and-secure DB_USER=postgres DB_HOST=localhost DB_NAME=postgres DB_PASSWORD=your-db-password DB_PORT=5432 GMAIL_USER=your-email@gmail.com GMAIL_PASS=your-app-password ELASTICSEARCH_NODE=http://localhost:9200 ELASTICSEARCH_API_KEY=your-elasticsearch-api-key #you can find that in your ElasticSearch directory .env file
-
Start Services
# Start Elasticsearch (if not running) # Start PostgreSQL (if not running) # Start Backend(in different terminals each node command) cd backend node --env-file=.env app.js node --env-file=.env email-monitor.js node --env-file=.env indexer.js #Run if you want to index new data leaks to elastic search # Start Frontend (in another terminal) cd frontend npm run dev
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
two_factor_enabled BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE user_emails (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL,
email VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
UNIQUE(user_id, email)
);CREATE TABLE security_alerts (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL,
monitored_email VARCHAR(255) NOT NULL,
breach_database VARCHAR(255) NOT NULL,
alert_sent_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
severity_level INTEGER DEFAULT 3,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);CREATE TABLE leak_databases_guidance (
id SERIAL PRIMARY KEY,
database_name VARCHAR(255) UNIQUE NOT NULL,
display_name VARCHAR(255) NOT NULL,
service_type VARCHAR(255),
description TEXT,
security_guidance JSONB,
severity_level INTEGER DEFAULT 3,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);POST /register- User registration with JWT tokenPOST /login- User login with JWT tokenPOST /send-otp- Send OTP for registrationPOST /verify-otp- Verify OTP for registration
POST /search-email- Public search (count only)POST /search-email-details- Private search (detailed results)
POST /user/send-otp- Send OTP to new email for verificationPOST /user/verify-otp- Verify OTP and add email to monitoringGET /user/emails- Get user's verified emails
POST /check-email- Check if email is registeredPOST /test-email- Test email sending functionality
- Atoms:
Button,Input- Basic reusable components - Molecules:
EmailForm,OtpForm,PasswordForm- Form components - Organisms:
Header,EmailManager,LoginForm- Complex components - Templates:
AuthTemplate- Page layouts - Pages:
AuthPage,DashboardPage- Complete pages
- JWT token authentication
- Password hashing with bcrypt
- Input validation and sanitization
- SQL injection prevention with parameterized queries
- CORS configuration
- Rate limiting (recommended to add)
- Token-based authentication
- Secure API communication
- Input validation
- XSS prevention
The application supports Armenian language with fallbacks:
- Armenian UI text and messages
- Armenian email templates
- Error messages in Armenian
cd frontend
npm run dev # Start development server
npm run build # Build for production
npm run lint # Run ESLint
npm run type-check # TypeScript type checkingcd backend
node --env-file=.env app.js # Start server
npm run test # Run tests (if configured)- Elasticsearch for fast breach data search
- Database indexing on frequently queried fields
- React component optimization with hooks
- Lazy loading for large components
- Connection pooling for database connections
- Dark mode support
- Email notifications for new breaches
- Multi-language support (English, Russian)
- Advanced search filters
- Breach severity ratings
- Export functionality for breach reports
- Mobile UI
- API rate limiting
- Redis caching for frequently accessed data
- Monitoring and logging system
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and security awareness purposes only. Always use responsibly and in compliance with applicable laws and regulations.
Built with โค๏ธ for cybersecurity awareness