Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/r4255/news_portal


https://github.com/r4255/news_portal

api bootstrap deployment flask heroku pagination python

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

# 📰 News Portal 📰

Welcome to the **News Portal** project, a dynamic web application built using Flask, SQLAlchemy, and the NewsAPI! This project allows users to explore the latest news articles across various categories, register and log in, and access an easy-to-navigate interface with pagination.

> **Author:** [Rohit Gupta](https://github.com/R4255)

---

## 🚀 Features

- **User Authentication:** Secure login and signup system.
- **News Categorization:** Browse news across categories like general, business, entertainment, and more.
- **Search Functionality:** Search for specific news articles using keywords.
- **Pagination:** Efficiently navigate through multiple pages of news.
- **Caching:** Speed up load times with server-side caching.
- **Responsive Design:** Aesthetic and functional across all devices.

---

## 🛠️ Tech Stack

- **Backend:** Flask, Flask-Login, SQLAlchemy, Flask-Migrate
- **Frontend:** Bootstrap, Jinja2 Templates
- **API Integration:** NewsAPI
- **Database:** PostgreSQL, SQLite (for development)
- **Deployment:** Heroku

---

## 📦 Installation

Follow these steps to get a local copy of the project:

1. **Clone the repository:**

```bash
git clone https://github.com/R4255/news-portal.git
```

2. **Navigate to the project directory:**

```bash
cd news-portal
```

3. **Create a virtual environment and activate it:**

```bash
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```

4. **Install the required dependencies:**

```bash
pip install -r requirements.txt
```

5. **Set up environment variables:**

Create a `.env` file and add your environment variables:

```plaintext
SECRET_KEY=your_secret_key
NEWS_API_KEY=your_newsapi_key
DATABASE_URL=your_database_url
```

6. **Run the application:**

```bash
flask run
```

7. **Access the app:**

Open your web browser and navigate to `http://127.0.0.1:5000`.

---

## 🧰 Usage

- **Homepage:** Displays the latest news in the selected category.
- **Search Bar:** Enter keywords to find specific articles.
- **Category Navigation:** Click on a category to view related news.
- **Pagination Controls:** Navigate through pages to see more news articles.
- **User Login/Signup:** Register or log in to access personalized features.

---

## 🛡️ Security

This application uses Flask-Login and Werkzeug for secure user authentication. Passwords are hashed using industry-standard hashing algorithms, ensuring user data is protected.

---

## 📝 Contributing

Contributions are welcome! If you'd like to make improvements or add features, please fork the repository and create a pull request. For significant changes, open an issue first to discuss what you'd like to change.

1. **Fork the Project**
2. **Create your Feature Branch:** `git checkout -b feature/AmazingFeature`
3. **Commit your Changes:** `git commit -m 'Add some AmazingFeature'`
4. **Push to the Branch:** `git push origin feature/AmazingFeature`
5. **Open a Pull Request**

---

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## 🎉 Acknowledgments

- **NewsAPI:** For providing the data that powers this application.
- **Flask:** For the lightweight and flexible web framework.
- **Bootstrap:** For the responsive and elegant design framework.
- **Heroku:** For providing a reliable deployment platform.

---

**Feel free to reach out if you have any questions or need further assistance!**

---

**[Rohit Gupta](https://github.com/R4255)**