gober

command module
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 9 Imported by: 0

README ยถ

Gober build status

Gober (Go Berita)

Gober, stands for Go Berita, is a monorepo project for aggregating news/article from various websites.

  • Backend: Written in Go, provides REST APIs for scraping and fetching news articles.
  • Frontend: Built with Vue.js, displays the news in an elegant, user-friendly web interface.

Features

  • Scrape popular articles from multiple websites (e.g., detik.com, kompas.com).
  • Search articles by keyword. (WIP)
  • Fetch article details with enriched content links.
  • Responsive frontend design for desktop and mobile.

Available Sites

Sites Status Query Param Origin
detik.com โœ… ?source=detik ๐Ÿ‡ฎ๐Ÿ‡ฉ
kompas.com โœ… ?source=kompas ๐Ÿ‡ฎ๐Ÿ‡ฉ
tribunnews.com ๐Ÿ”œ ?source=tribun ๐Ÿ‡ฎ๐Ÿ‡ฉ
cnnindonesia.com ๐Ÿ”œ ?source=ccnid ๐Ÿ‡ฎ๐Ÿ‡ฉ
Legend:
  • โœ…: Up
  • โŒ: Need Fix
  • ๐Ÿ”œ: Coming Soon

Tech Stack

Backend
  • Go (Golang)
  • Gin Web Framework
  • goquery (for web scraping)
  • Mockable HTTP client for testing
Frontend
  • Vue.js
  • Axios (for API calls)
  • CSS Grid and Flexbox for responsive layouts

Getting Started

Prerequisites

Setup Instructions using make

1. Clone the Repository
git clone https://github.com/your-username/gober.git
cd gober
2. Run make file
make serve

Setup Instructions (Separate BE and FE)

1. Clone the Repository
git clone https://github.com/your-username/gober.git
cd gober
2. Backend (Go)
Step-by-step:
  1. Navigate to the root directory (if not already there):

    cd gober
    
  2. Install dependencies:

    go mod tidy
    
  3. Run the backend server:

    go run main.go
    
  4. API Endpoints:
    The server will run at http://localhost:8080. You can access the following endpoints:

    • Get popular articles: /articles/popular?source=detik
    • Search articles: /articles?source=detik&q=keyword
    • Get article details: /article?detailUrl=encoded_url

    See Available Sites for source.


3. Frontend (Vue.js)
Step-by-step:
  1. Navigate to the web directory:
    cd web
    
  2. Install dependencies:
    npm install
    
  3. Run the development server:
    npm run dev
    
  4. Open your browser and visit http://localhost:8001 to view the web application.

Project Structure

gober/
โ”œโ”€โ”€ parsers/                # Parsers for different news websites
โ”œโ”€โ”€ models/                 # Data models
โ”œโ”€โ”€ utils/                  # Utilities (e.g., HTTP client, helper functions)
โ”œโ”€โ”€ main.go                 # Entry point for the backend server
โ”œโ”€โ”€ web/                    # Frontend codebase (Vue.js)
โ”‚   โ”œโ”€โ”€ src/                # Source code
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # Vue components
โ”‚   โ”‚   โ”œโ”€โ”€ views/          # Application views
โ”‚   โ”‚   โ””โ”€โ”€ assets/         # Static assets (CSS, images, etc.)
โ”œโ”€โ”€ go.mod                  # Backend dependencies file
โ”œโ”€โ”€ go.sum                  # Backend dependency checksums
โ”œโ”€โ”€ README.md               # Project documentation
โ””โ”€โ”€ .gitignore              # Ignored files for Git

Testing

Backend Testing
  1. Navigate to the root directory:
    cd gober
    
  2. Run tests:
    go test ./...
    

Contributing

We welcome contributions!

  • Fork the repository
  • Create a new branch (feature/my-feature)
  • Submit a pull request

License

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


Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL