An AI-powered news aggregation app inspired by InShorts, built with FastAPI and modern AI technologies.
Saransh is an open-source alternative to InShorts that uses AI to:
- Scrape and process Indian news articles
- Categorize and summarize news content
- Provide intelligent news recommendations
- Create 60-word summaries using AI
- Python 3.8+
- PostgreSQL (for production)
- Redis (optional, for caching)
-
Clone the repository
git clone <your-repo-url> cd Saransh
-
Create the Virtual Environment
python3 -m venv venv source venv/bin/activate -
Install dependencies
CREATE requirements.in pip-compile requirements.in pip install -r requirements.txt pip freeze > requirements.txt -
Setup environment variables
# Copy the example environment file cp env.example .env # Edit .env with your configuration nano .env
-
Run the application
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
-
Access the application
- API: http://localhost:8000
- Health Check: http://localhost:8000/health
- API Documentation: http://localhost:8000/docs
Create a .env file in the root directory with the following variables:
# Database Configuration
DATABASE_URL=postgresql://username:password@localhost:5432/saransh_db
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
# Application Configuration
APP_ENV=development
DEBUG=True
LOG_LEVEL=INFO
# Server Configuration
HOST=0.0.0.0
PORT=8000
# Redis Configuration (for caching later)
REDIS_URL=redis://localhost:6379- OpenAI API Key: Get from OpenAI Platform
Saransh/
โโโ app/
โ โโโ agents/ # AI agents and LangChain integration
โ โโโ api/ # API routes and endpoints
โ โโโ db/ # Database models and connections
โ โโโ processors/ # News processing and cleaning
โ โโโ scrapers/ # News scraping modules
โ โโโ utils/ # Utility functions
โ โโโ config.py # Configuration management
โโโ main.py # Application entry point
โโโ requirements.txt # Python dependencies
โโโ env.example # Environment variables template
โโโ readme.md # This file
python main.pyThe app will run with:
- Auto-reload enabled
- Debug mode on
- Detailed logging
# Set environment to production
export APP_ENV=production
export DEBUG=False
# Run with uvicorn directly
uvicorn main:app --host 0.0.0.0 --port 8000curl http://localhost:8000/healthExpected response:
{
"status": "healthy",
"timestamp": "2024-01-01T12:00:00",
"service": "saransh-news-app",
"environment": "development"
}- Project setup and structure
- Basic FastAPI application
- Environment configuration
- Database setup and models
- News scraping functionality
- AI-powered content processing
- RAG (Retrieval-Augmented Generation) system
- API endpoints for news retrieval
- Docker containerization
- Production deployment
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Join our community discussions
Built with โค๏ธ for the AI and news community