A sophisticated multi-stage captcha web application built with Angular and Node.js, designed to verify human users through various challenge types including image recognition, text input, and mathematical problems.
- Multi-Stage Verification: Three progressive challenge levels
- Diverse Challenge Types: Image selection, text input, and math problems
- State Persistence: Progress saved across browser sessions
- Responsive Design: Optimized for desktop and mobile devices
- Smooth Animations: Fluid transitions between challenges
- Form Validation: Robust validation for all challenge types
- Image Recognition: Select specific objects from image grids
- Text Input: Answer knowledge-based questions
- Mathematical: Solve arithmetic problems
- Progress Tracking: Visual progress bar with level indicators
- Navigation: Move between completed levels
- Session Management: Automatic state saving and restoration
- Results Dashboard: Detailed completion statistics
- Download Results: Export session data as JSON
- Components: Home, Captcha, Result
- Services: CaptchaService, StateService
- Guards: CaptchaGuard for route protection
- State Management: RxJS-based state management with localStorage persistence
- Reactive Forms: Form validation and user input handling
- RESTful API: Challenge retrieval and answer validation
- Challenge Management: JSON-based challenge storage
- CORS Support: Cross-origin resource sharing enabled
- Modular Structure: Organized route handlers and middleware
angul-it/
โโโ frontend/ # Angular application
โ โโโ src/
โ โ โโโ app/
โ โ โ โโโ components/ # UI components
โ โ โ โ โโโ home/
โ โ โ โ โโโ captcha/
โ โ โ โ โโโ result/
โ โ โ โโโ services/ # Business logic services
โ โ โ โโโ guards/ # Route guards
โ โ โ โโโ models/ # TypeScript interfaces
โ โ โโโ styles.css # Global styles
โ โโโ package.json
โโโ backend/ # Node.js API server
โ โโโ routes/
โ โ โโโ captcha.js # Captcha API endpoints
โ โโโ levels/ # Challenge data
โ โ โโโ 1.json
โ โ โโโ 2.json
โ โ โโโ 3.json
โ โโโ server.mjs # Express server setup
โ โโโ package.json
โโโ README.md
- Node.js (v18 or higher)
- npm or yarn
- Angular CLI (
npm install -g @angular/cli)
cd backend
npm install
node server.mjsThe backend server will run on http://localhost:3000
cd frontend
npm install
ng serveThe frontend application will run on http://localhost:4200
- Navigate to the home page
- Click "Start New Challenge" to begin
- Complete all three levels sequentially
- View detailed results upon completion
Example of an image selection challenge where users identify specific objects
- Progress Bar: Visual indicator of completion status
- Level Navigation: Move between completed levels
- Form Validation: Real-time validation feedback
- State Persistence: Progress automatically saved
- Select images matching the given criteria
- Multiple selection support
- Visual feedback for selected items
- Validation ensures at least one selection
- Answer knowledge-based questions
- Case-insensitive validation
- Real-time form validation
- Trim whitespace handling
- Solve arithmetic equations
- Numeric input validation
- Integer answer validation
- Clear error messaging
Detailed results dashboard showing session statistics and performance metrics
Retrieves a set of challenges for all three levels. Each level randomly selects a challenge from its pool.
Response Example:
{
"level1": {
"id": 2,
"type": "text",
"question": "What is the capital of Senegal?"
},
"level2": {
"id": 2,
"type": "image-select",
"question": "Where is Luffy?",
"images": [
{ "url": "https://...", "id": "img1" },
{ "url": "https://...", "id": "img2" },
{ "url": "https://...", "id": "img3" }
]
},
"level3": {
"id": 1,
"type": "image-select",
"question": "Select all images with a bus",
"images": [...]
}
}Note: Challenge types vary by level. Level 1 includes text and math challenges, Level 2 includes math and image-select challenges, and Level 3 includes various image-select challenges.
Submits an answer for validation.
Request Examples:
Text answer:
{
"id": 2,
"level": 1,
"answer": "Dakar"
}Math answer:
{
"id": 1,
"level": 2,
"answer": 42
}Image selection answer:
{
"id": 2,
"level": 2,
"answer": ["img1"]
}Response:
{
"success": true
}Or on error:
{
"success": false,
"message": "Answer must be a non-empty string."
}- Modern UI: Clean, Apple-inspired design aesthetics
- Color System: Comprehensive color palette with gradients
- Typography: Optimized font hierarchy and spacing
- Animations: Smooth transitions and micro-interactions
- Responsive: Mobile-first responsive design
- Accessibility: WCAG compliant design patterns
- Loading States: Clear loading indicators
- Error Handling: Comprehensive error messaging
- Progress Feedback: Visual progress indicators
- Session Management: Seamless state persistence
cd frontend
ng testNote: Backend testing is currently not implemented. Contributions are welcome!
- Input Validation: Server-side validation for all inputs
- CORS Protection: Configured cross-origin policies
- State Isolation: Session-based state management
- Answer Validation: Secure server-side answer checking
- Mobile Optimized: Touch-friendly interface
- Tablet Support: Optimized for medium screens
- Desktop Enhanced: Full-featured desktop experience
- Flexible Layouts: CSS Grid and Flexbox layouts
- Angular team for the excellent framework
- Express.js for the robust backend framework
- Contributors and testers who helped improve the application
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
โญ Star this repository if you found it helpful! โญ
Made with โค๏ธ from ๐ธ๐ณ
