Categorygithub.com/savioruz/smrv2-api
module
0.0.0-20250226043059-f6b76fcf3101
Repository: https://github.com/savioruz/smrv2-api.git
Documentation: pkg.go.dev

# README

Smrv2 API

Smrv2 is a web scraper that scrapes schedules from the official website. 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+
  • PostgreSQL
  • RabbitMQ
  • Redis
  • Docker
  • Docker Compose
  • Make
  • migrate for database migrations
  • air for hot reloading while developing

Installation

  1. Clone the repository:

    git clone https://github.com/savioruz/smrv2-api.git
    cd smrv2-api
    
  2. Environment Variables:

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

    cp .env.example .env
    

Usage

Running Application

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

Docker

  1. Run the application:

    make docker.run
    
  2. Stop the application:

    make docker.stop
    

You need to have PostgreSQL, RabbitMQ, and Redis running on your machine.

Docker Compose (Recommended)

  1. Build the application:

    make dc.build
    
  2. Run the application:

    make dc.up
    
  3. Stop the application:

    make dc.down
    

For production, don't forget to set the environment in docker-compose.yml if you want to expose the application to the public.

API Documentation

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

Preview

Project Structure

.
├── assets/                # Asset files and images
├── cmd/                   # Application entry points
├── db/                    # Database related files
├── docs/                  # Project documentation
├── internal/              # Private application code
│   ├── builder/           # Builder patterns
│   ├── dao/               # Data Access Objects
│   │   ├── entity/        # Entity models
│   │   └── model/         # Model for request and response
│   ├── delivery/          # HTTP handlers and routes
│   ├── gateway/           # External service integrations
│   ├── repository/        # Data storage implementations
│   └── service/           # Business logic layer
├── pkg/                   # Public shared packages
│   ├── config/            # Configuration management
│   └── helper/            # Helper utilities
└── test/                  # Test files

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

# Packages

No description provided by the author
Package docs Code generated by swaggo/swag.
No description provided by the author