simeru-scraper

command module
v0.0.0-...-e900c16 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

Simeru Scraper

Simeru Scraper is a web scraper that scrapes schedules from the official website and caches the data in Redis. The API is built with Go and Fiber.

Go GitHub code size in bytes Go Report Card GitHub issues GitHub pull requests

Table of Contents

Features

  • Scrapes schedules from the official website
  • Caches data in Redis
  • Cron job to update data
  • API Documentation with Swagger
  • Docker support

Deployment

  • Koyeb

Deploy to Koyeb

Requirements

  • Go 1.23+
  • Docker
  • Redis
  • Make

Installation

  1. Clone the repository:

    git clone https://github.com/savioruz/simeru-scraper.git
    cd simeru-scraper
    
  2. Environment Variables:

    Create a .env file in the root directory and add the following:

    cp .env.example .env
    

Usage

Running the API

You can run the API using Docker or directly with Make.

  1. Run redis:

    make docker.redis
    
  2. Run the application:

    make docker.run
    

For production, you need to secure redis on Makefile with a password.

Make
  1. Run the application:

    make run
    

You need to have Redis running on your machine.

API Documentation

Swagger documentation is available at: http://localhost:3000/swagger.

Preview

Project Structure

.
├── config/                 # Configuration files
│── docs/                   # Project documentation
├── internal/
│   ├── adapters/           # Adapters for external services
│   │   ├── cache/          # Cache layer
│   │   ├── handlers/       # Handlers layer
│   │   └── repositories/   # Storage layer integration
│   └── cores/              # Core business layer
│       ├── entities/       # Business entities
│       ├── ports/          # Adapter implementations
│       │   └── ports.go
│       └── services/       # Use cases layer
├── pkg/
│   ├── constant/
│   ├── middleware/
│   ├── routes/
│   ├── server/            # Server configuration
│   └── utils/             # Utility functions
├── main.go
├── .env
└── Dockerfile

Contributing

Feel free to open issues or submit pull requests with improvements.

License

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

Acknowledgements

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
pkg

Jump to

Keyboard shortcuts

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