This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A full-stack news aggregation platform with personalized feeds and 3D globe visualization. The project uses Docker to orchestrate four services: a React frontend, Laravel API backend, Flask NLP microservice, and MySQL database.
docker-compose up --build- React App: http://localhost:3000
- Laravel API: http://localhost:8080
- Flask NLP Service: http://localhost:5000
- phpMyAdmin: http://localhost:8081
docker-compose exec laravel-app php artisan migrate # Run migrations
docker-compose exec laravel-app php artisan test # Run PHPUnit tests
docker-compose exec laravel-app php artisan articles:fetch # Manually fetch articles
docker-compose exec laravel-app php artisan pint # Run Laravel Pint lintercd my-app && npm start # Development server
cd my-app && npm test # Run Jest tests
cd my-app && npm run build # Production buildlaravel-app: PHP 8.2 + Apache serving the REST APIreact-app: React 18 frontend (my-app directory)flask-app: Python NLP service for location extractiondb: MySQL 5.7 database
- Services Layer (
app/Services/): API integrations for news sourcesNewsAPIService- NewsAPI.org integrationGuardianService- The Guardian APITimesService- NY Times API (BBC)ArticleLocationService- Communicates with Flask service
- Scheduled Command:
articles:fetchfetches news from all sources and updates location data - Models: User, Article, Category, Source, Preference
- Authentication: Laravel Sanctum with custom
api.authmiddleware - Vendor directory stored at
/srv/vendorfor Docker performance optimization
- Pages: HomePage (with 3D globe), NewsFeed, UserProfile, Login/Signup
- Components: Header, Footer, ArticleCard, FilterComponent, Globe
- 3D Visualization: Three.js + @react-three/fiber for interactive Earth map
- Styling: Tailwind CSS
- Single endpoint:
POST /extract-locations-batch - Uses spaCy for named entity recognition (GPE - geopolitical entities)
- Uses geopy/Nominatim for geocoding locations to coordinates
- Cron job triggers
articles:fetchcommand - Laravel fetches from NewsAPI, Guardian, and Times APIs
- Articles saved to MySQL, then sent to Flask for location extraction
- Flask uses NLP to identify locations and geocode them
- Coordinates stored with articles for 3D globe visualization
- Public:
/articles,/search-articles,/filter-articles,/location-articles - Auth-protected:
/user,/preferences,/personalized-articles - Admin:
/fetch-articles,/get-locations