A comprehensive, production-ready AI-powered notes application built with Laravel, React, and Python AI services. This project demonstrates full-stack development capabilities across multiple technologies with a focus on clean architecture, security, and user experience.
Dashboard showcasing the modern, responsive interface with note management and AI summarization features
graph TB
subgraph "Frontend Layer"
A[React + TypeScript]
B[Tailwind CSS + shadcn/ui]
C[React Query]
end
subgraph "Backend Layer"
D[Laravel 12 API]
E[Laravel Sanctum]
F[PostgreSQL Database]
end
subgraph "AI Service Layer"
G[Python FastAPI]
H[Google Gemini AI]
I[HuggingFace BART]
end
subgraph "Infrastructure"
J[Docker Containers]
K[Docker Compose]
L[Environment Variables]
end
A --> D
D --> F
D --> G
G --> H
G --> I
J --> K
L --> J
- Framework: Laravel 12
- Database: PostgreSQL 15
- Authentication: Laravel Sanctum
- API: RESTful with JSON responses
- Validation: Laravel form request validation
- Middleware: Role-based access control
- Framework: React 18 with TypeScript
- Styling: Tailwind CSS v4 with custom components
- State Management: React Query for server state, local state for UI
- Data Fetching: TanStack Query v5
- UI Components: shadcn/ui with custom enhancements
- Routing: React Router v6
- Framework: FastAPI (Python)
- AI Models:
- Primary: Google Gemini AI
- Backup: HuggingFace Transformers (BART)
- Fallback: Smart text truncation
- Features: Lazy loading, intelligent fallbacks, configurable output length
- β Authentication: Full register/login system via Laravel backend
- β CRUD Operations: Complete Create, Read, Update, Delete for notes
- β AI Summarization: Python service with multiple AI models and intelligent fallbacks
- β React Frontend: Complete frontend with all required functionality
- β Security: Secure endpoints with user isolation
- β Database: PostgreSQL relational database with proper migrations
- β Docker Setup: Complete containerization for easy deployment
- β User Authentication: Complete register/login system with Laravel Sanctum
- β Notes Management: Full CRUD operations with user ownership validation
- β AI Summarization: Intelligent text summarization using multiple AI models
- β Security: Role-based access control - users can only access their own notes
- β Modern UI: Professional dashboard with modern design
- π Smart Search: Real-time note filtering and search functionality
- π± Responsive Design: Optimized for all screen sizes (320px to 4K)
- π¨ Professional UI: Card-based design with proper spacing and accessibility
- β‘ Performance: Optimized queries, efficient state management
- π Real-time Updates: Seamless data synchronization across components
- π― Custom Favicon: Branded application identity
- π Security Modal: Professional confirmation dialogs for destructive actions
- π AI Model Selection: Intelligent fallback between Gemini and BART
- π Configurable Summaries: Adjustable summary lengths (100-300 characters)
ai-notes-app/
βββ backend-laravel/ # Laravel 12 backend
βββ frontend-react/ # React 18 frontend
βββ ai-service-python/ # Python FastAPI AI service
βββ docker-compose.yml # Docker orchestration
βββ README.md # This file
- Docker: Version 20.10+ with Docker Compose
- Git: For version control
- Text Editor: VS Code, Sublime, or your preferred editor
git clone <repository-url>
cd ai-notes-appThe .env.example file contains placeholder values for all required environment variables.
# Copy environment template
cp .env.example .env
# Edit .env with your secure values:
# - Database passwords
# - AI service API keys
# - Application ports
# - CORS origins# Database Configuration
DB_CONNECTION=pgsql
DB_HOST=database
DB_PORT=5432
DB_DATABASE=ai_notes
DB_USERNAME=ai_notes_user
DB_PASSWORD=your_secure_password_here
# AI Service Configuration
GEMINI_API_KEY=your_gemini_api_key_here
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173
# Application Ports
BACKEND_PORT=8000
AI_SERVICE_PORT=8001
FRONTEND_PORT=3000
DATABASE_PORT=5433
PGADMIN_PORT=8081# Start all services in background
docker compose up -d
# Or start individually (recommended for first run)
docker compose up -d database
docker compose up -d backend
docker compose up -d ai-service
docker compose up -d frontend
# Check service status
docker compose ps
# View logs
docker compose logs -f# Run migrations
docker compose exec backend php artisan migrate
# Seed database (optional)
docker compose exec backend php artisan db:seed
# Check database connection
docker compose exec backend php artisan tinker# Frontend Application
http://localhost:3000
# Backend API
http://localhost:8000
# AI Service
http://localhost:8001
# Database Admin (pgAdmin)
http://localhost:8081# Stop all services
docker compose down
# Start services for development
docker compose up -d
# View real-time logs
docker compose logs -f [service-name]
# Rebuild specific service
docker compose build [service-name]
docker compose up -d [service-name]- AI Service Availability: AI services (Gemini, HuggingFace) are accessible with reasonable rate limits
- Data Volume: Notes are text-based with reasonable length for optimal AI processing
- Concurrent Usage: Application designed for moderate concurrent user load
- Network Environment: Stable internet connection required for AI service integration
- Environment Variables:
.envfiles are properly secured and not committed to version control - Network Security: Application designed for controlled development/production environments
- API Key Management: AI service API keys are securely managed and regularly rotated
- Device Compatibility: Optimized for modern browsers across various screen sizes
- Performance: Designed for responsive interactions with real-time updates
- Accessibility: Built with A11Y compliance for inclusive user experience
- No Hardcoded Secrets: All sensitive information is stored in environment variables
- Secure Passwords: Database passwords and API keys are configurable
- CORS Configuration: Configurable allowed origins for security
- JWT Secrets: Configurable JWT signing keys
- Laravel Sanctum: Secure token-based authentication
- User Isolation: Users can only access their own notes
- Input Validation: Comprehensive validation on all endpoints
- CSRF Protection: Built-in CSRF protection for web routes
- User Ownership: Notes are tied to authenticated users
- SQL Injection Protection: Laravel's Eloquent ORM prevents SQL injection
- Secure Connections: Database connections use environment variables
- Testing Suite: Comprehensive unit and integration tests for all layers
- Error Handling: More granular error messages and user feedback
- Loading States: Skeleton loaders and better loading indicators
- Offline Support: Service worker for basic offline functionality
- Data Export: PDF/Word export for notes and summaries
- Real-time Collaboration: Live editing and sharing of notes
- Advanced AI: Custom training, multiple summary styles, sentiment analysis
- File Attachments: Support for images, documents, and media
- User Management: Admin panel, user roles, and permissions
- Analytics Dashboard: Usage statistics and insights
- Mobile App: React Native or Flutter mobile application
- Microservices: Break down into smaller, scalable services
- Event Sourcing: CQRS pattern for complex data operations
- Machine Learning: Custom AI models trained on user data
- Multi-tenancy: Support for organizations and teams
- API Gateway: Rate limiting, caching, and monitoring
- CI/CD Pipeline: Automated testing and deployment
- Monitoring: Prometheus, Grafana, and health checks
- Logging: Structured logging with ELK stack
- Caching: Redis for session and data caching
- Load Balancing: Multiple instances with load balancer
- Backup Strategy: Automated database backups and disaster recovery
# Health check
curl http://localhost:8001/health
# Text summarization
curl -X POST http://localhost:8001/summarize \
-H "Content-Type: application/json" \
-d '{"text": "Your text here", "max_length": 100}'# Health check
curl http://localhost:8000/api/health
# User registration
curl -X POST http://localhost:8000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"name": "Test User", "email": "test@example.com", "password": "password123", "password_confirmation": "password123"}'# Development server
cd frontend-react
npm run dev
# Build for production
npm run build-
Docker daemon not running
sudo systemctl start docker
-
Port conflicts
- Backend: 8000
- Frontend: 3000
- AI Service: 8001
- Database: 5433
-
Service connectivity issues
- Check service logs:
docker compose logs [service-name] - Restart services:
docker compose restart [service-name]
- Check service logs:
For production use, please:
- Add comprehensive error handling
- Implement proper logging and monitoring
- Add security headers and rate limiting
- Set up automated testing
- Configure production database and caching
This project is licensed under the MIT License.
