Ares1712/newsproj

0

stars

0

commits

TypeScript

primary language

Feb 26, 2026

updated

README

News Near Me - Coastal Karnataka

A full-stack, cross-platform news application for Coastal Karnataka, featuring lightning-fast performance, beautiful design, and comprehensive monetization strategies.

🌟 Features

  • πŸ“° Local News: Real-time news from Daijiworld RSS feed
  • ⚑ Breaking News: Priority display for urgent updates
  • 🎨 Modern UI: Clean, card-based design inspired by Inshorts
  • πŸŒ™ Dark Mode: Automatic theme switching
  • πŸ“± PWA Support: Install as native app on mobile/desktop
  • πŸ“² Mobile Apps: iOS and Android via Expo
  • πŸ’° Ad Integration: AdSense (web) and AdMob (mobile)
  • πŸš€ Performance: ISR, caching, and optimization
  • πŸ”” Notifications: Push notifications for breaking news
  • πŸ“Š Analytics: Comprehensive tracking and insights

πŸ› οΈ Technology Stack

Web & PWA

  • Framework: Next.js 14 with TypeScript
  • Styling: Tailwind CSS with custom design system
  • PWA: next-pwa with service worker
  • Data Fetching: SWR for real-time updates
  • Caching: Redis-backed with fallback to in-memory

Mobile

  • Framework: Expo + React Native
  • Navigation: Expo Router
  • Fallback: Capacitor for native packaging
  • Ads: react-native-google-mobile-ads

Infrastructure

  • CI/CD: GitHub Actions
  • Deployment: Vercel (web), EAS Build (mobile)
  • Analytics: Firebase Analytics
  • Monitoring: Sentry for error tracking

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Expo CLI (for mobile development)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/news-near-me.git
    cd news-near-me
    
  2. Install dependencies

    npm install
    
  3. Set up environment variables

    cp .env.example .env.local
    

    Edit .env.local with your configuration:

    # App Configuration
    NEXT_PUBLIC_BASE_URL=http://localhost:3000
    
    # AdSense Configuration
    NEXT_PUBLIC_ADSENSE_CLIENT_ID=ca-pub-1234567890123456
    NEXT_PUBLIC_ADSENSE_AD_UNIT_ID=1234567890
    
    # Analytics
    NEXT_PUBLIC_GA_TRACKING_ID=G-XXXXXXXXXX
    
    # Firebase (for mobile)
    FIREBASE_API_KEY=your-api-key
    FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
    FIREBASE_PROJECT_ID=your-project-id
    
    # Sentry
    SENTRY_DSN=https://your-sentry-dsn
    
  4. Run development server

    npm run dev
    
  5. Open your browser Navigate to http://localhost:3000

πŸ“± Mobile Development

Expo Development

# Install Expo CLI globally
npm install -g @expo/cli

# Start Expo development server
npm run web          # Web version
npm run ios          # iOS simulator
npm run android      # Android emulator

Capacitor Development (Alternative)

# Build for production
npm run build
npm run export

# Add platforms
npx cap add ios
npx cap add android

# Sync and open
npx cap sync
npx cap open ios     # Opens Xcode
npx cap open android # Opens Android Studio

πŸ—οΈ Building for Production

Web & PWA

# Build for production
npm run build

# Export static site
npm run export

# Start production server
npm start

Mobile Apps

# Build with Expo EAS
eas build --platform ios
eas build --platform android

# Submit to stores
eas submit --platform ios
eas submit --platform android

πŸš€ Deployment

Web Deployment (Vercel)

  1. Connect your GitHub repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Mobile Deployment

  1. iOS App Store:

    • Build with EAS: eas build --platform ios
    • Submit: eas submit --platform ios
  2. Google Play Store:

    • Build with EAS: eas build --platform android
    • Submit: eas submit --platform android

πŸ“Š Analytics & Monitoring

Google Analytics Setup

  1. Create a Google Analytics 4 property
  2. Add tracking ID to environment variables
  3. Events are automatically tracked:
    • Page views
    • News clicks
    • Ad impressions
    • User engagement

Sentry Error Tracking

  1. Create a Sentry project
  2. Add DSN to environment variables
  3. Errors are automatically captured and reported

πŸ’° Monetization

AdSense (Web)

  • Banner ads every 5 articles
  • Responsive ad units
  • Lazy loading for performance

AdMob (Mobile)

  • Banner ads in footer
  • Interstitial ads on app open
  • Frequency capping implemented

Configuration

Update ad configuration in src/types/index.ts:

ads: {
  enabled: true,
  provider: 'adsense', // or 'admob'
  adUnitId: 'your-ad-unit-id',
  frequency: 5 // Show ad every 5 articles
}

πŸ”§ Configuration

RSS Feed Configuration

The app fetches news from Daijiworld RSS feed. To change the source:

  1. Update DEFAULT_RSS_URL in src/services/fetchRss.ts
  2. Modify filtering logic in src/utils/parseRss.ts
  3. Update category mapping in src/utils/categoryMap.ts

Performance Optimization

  • ISR: Pages revalidate every 10 minutes
  • Caching: Redis with 10-minute TTL
  • Image Optimization: Next.js Image component
  • Code Splitting: Automatic with Next.js
  • PWA: Service worker for offline support

πŸ§ͺ Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run linting
npm run lint

# Type checking
npm run type-check

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ NewsCard.tsx    # News article card
β”‚   β”œβ”€β”€ SkeletonCard.tsx # Loading skeleton
β”‚   β”œβ”€β”€ AdBanner.tsx    # Ad display component
β”‚   └── Header.tsx      # Navigation header
β”œβ”€β”€ pages/              # Next.js pages
β”‚   β”œβ”€β”€ api/           # API routes
β”‚   β”œβ”€β”€ _app.tsx       # App wrapper
β”‚   └── index.tsx      # Homepage
β”œβ”€β”€ services/          # Data services
β”‚   └── fetchRss.ts    # RSS fetching logic
β”œβ”€β”€ utils/             # Utility functions
β”‚   β”œβ”€β”€ parseRss.ts    # RSS parsing utilities
β”‚   └── categoryMap.ts # Category configuration
β”œβ”€β”€ types/             # TypeScript types
β”‚   └── index.ts       # Type definitions
└── styles/            # Global styles
    └── globals.css    # Tailwind + custom CSS

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments

  • Daijiworld: RSS feed source
  • Inshorts: UI/UX inspiration
  • Next.js: Web framework
  • Expo: Mobile development platform
  • Tailwind CSS: Styling framework

Made with ❀️ for Coastal Karnataka

Ares1712/newsproj

0

stars

0

commits

TypeScript

primary language

Feb 26, 2026

updated

README

News Near Me - Coastal Karnataka

A full-stack, cross-platform news application for Coastal Karnataka, featuring lightning-fast performance, beautiful design, and comprehensive monetization strategies.

🌟 Features

  • πŸ“° Local News: Real-time news from Daijiworld RSS feed
  • ⚑ Breaking News: Priority display for urgent updates
  • 🎨 Modern UI: Clean, card-based design inspired by Inshorts
  • πŸŒ™ Dark Mode: Automatic theme switching
  • πŸ“± PWA Support: Install as native app on mobile/desktop
  • πŸ“² Mobile Apps: iOS and Android via Expo
  • πŸ’° Ad Integration: AdSense (web) and AdMob (mobile)
  • πŸš€ Performance: ISR, caching, and optimization
  • πŸ”” Notifications: Push notifications for breaking news
  • πŸ“Š Analytics: Comprehensive tracking and insights

πŸ› οΈ Technology Stack

Web & PWA

  • Framework: Next.js 14 with TypeScript
  • Styling: Tailwind CSS with custom design system
  • PWA: next-pwa with service worker
  • Data Fetching: SWR for real-time updates
  • Caching: Redis-backed with fallback to in-memory

Mobile

  • Framework: Expo + React Native
  • Navigation: Expo Router
  • Fallback: Capacitor for native packaging
  • Ads: react-native-google-mobile-ads

Infrastructure

  • CI/CD: GitHub Actions
  • Deployment: Vercel (web), EAS Build (mobile)
  • Analytics: Firebase Analytics
  • Monitoring: Sentry for error tracking

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Expo CLI (for mobile development)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/news-near-me.git
    cd news-near-me
    
  2. Install dependencies

    npm install
    
  3. Set up environment variables

    cp .env.example .env.local
    

    Edit .env.local with your configuration:

    # App Configuration
    NEXT_PUBLIC_BASE_URL=http://localhost:3000
    
    # AdSense Configuration
    NEXT_PUBLIC_ADSENSE_CLIENT_ID=ca-pub-1234567890123456
    NEXT_PUBLIC_ADSENSE_AD_UNIT_ID=1234567890
    
    # Analytics
    NEXT_PUBLIC_GA_TRACKING_ID=G-XXXXXXXXXX
    
    # Firebase (for mobile)
    FIREBASE_API_KEY=your-api-key
    FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
    FIREBASE_PROJECT_ID=your-project-id
    
    # Sentry
    SENTRY_DSN=https://your-sentry-dsn
    
  4. Run development server

    npm run dev
    
  5. Open your browser Navigate to http://localhost:3000

πŸ“± Mobile Development

Expo Development

# Install Expo CLI globally
npm install -g @expo/cli

# Start Expo development server
npm run web          # Web version
npm run ios          # iOS simulator
npm run android      # Android emulator

Capacitor Development (Alternative)

# Build for production
npm run build
npm run export

# Add platforms
npx cap add ios
npx cap add android

# Sync and open
npx cap sync
npx cap open ios     # Opens Xcode
npx cap open android # Opens Android Studio

πŸ—οΈ Building for Production

Web & PWA

# Build for production
npm run build

# Export static site
npm run export

# Start production server
npm start

Mobile Apps

# Build with Expo EAS
eas build --platform ios
eas build --platform android

# Submit to stores
eas submit --platform ios
eas submit --platform android

πŸš€ Deployment

Web Deployment (Vercel)

  1. Connect your GitHub repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Mobile Deployment

  1. iOS App Store:

    • Build with EAS: eas build --platform ios
    • Submit: eas submit --platform ios
  2. Google Play Store:

    • Build with EAS: eas build --platform android
    • Submit: eas submit --platform android

πŸ“Š Analytics & Monitoring

Google Analytics Setup

  1. Create a Google Analytics 4 property
  2. Add tracking ID to environment variables
  3. Events are automatically tracked:
    • Page views
    • News clicks
    • Ad impressions
    • User engagement

Sentry Error Tracking

  1. Create a Sentry project
  2. Add DSN to environment variables
  3. Errors are automatically captured and reported

πŸ’° Monetization

AdSense (Web)

  • Banner ads every 5 articles
  • Responsive ad units
  • Lazy loading for performance

AdMob (Mobile)

  • Banner ads in footer
  • Interstitial ads on app open
  • Frequency capping implemented

Configuration

Update ad configuration in src/types/index.ts:

ads: {
  enabled: true,
  provider: 'adsense', // or 'admob'
  adUnitId: 'your-ad-unit-id',
  frequency: 5 // Show ad every 5 articles
}

πŸ”§ Configuration

RSS Feed Configuration

The app fetches news from Daijiworld RSS feed. To change the source:

  1. Update DEFAULT_RSS_URL in src/services/fetchRss.ts
  2. Modify filtering logic in src/utils/parseRss.ts
  3. Update category mapping in src/utils/categoryMap.ts

Performance Optimization

  • ISR: Pages revalidate every 10 minutes
  • Caching: Redis with 10-minute TTL
  • Image Optimization: Next.js Image component
  • Code Splitting: Automatic with Next.js
  • PWA: Service worker for offline support

πŸ§ͺ Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run linting
npm run lint

# Type checking
npm run type-check

πŸ“ Project Structure

src/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ NewsCard.tsx    # News article card
β”‚   β”œβ”€β”€ SkeletonCard.tsx # Loading skeleton
β”‚   β”œβ”€β”€ AdBanner.tsx    # Ad display component
β”‚   └── Header.tsx      # Navigation header
β”œβ”€β”€ pages/              # Next.js pages
β”‚   β”œβ”€β”€ api/           # API routes
β”‚   β”œβ”€β”€ _app.tsx       # App wrapper
β”‚   └── index.tsx      # Homepage
β”œβ”€β”€ services/          # Data services
β”‚   └── fetchRss.ts    # RSS fetching logic
β”œβ”€β”€ utils/             # Utility functions
β”‚   β”œβ”€β”€ parseRss.ts    # RSS parsing utilities
β”‚   └── categoryMap.ts # Category configuration
β”œβ”€β”€ types/             # TypeScript types
β”‚   └── index.ts       # Type definitions
└── styles/            # Global styles
    └── globals.css    # Tailwind + custom CSS

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments

  • Daijiworld: RSS feed source
  • Inshorts: UI/UX inspiration
  • Next.js: Web framework
  • Expo: Mobile development platform
  • Tailwind CSS: Styling framework

Made with ❀️ for Coastal Karnataka

Languages

TypeScript

87.8%

JavaScript

10.2%

CSS

2.0%