jobs-monorepo/services/api/internal/app/app.go
Elshimy Ziad Magdy Taha 8ac872bdc6 feat: restructure project into monorepo with CI/CD
- Reorganized project structure into services/ and apps/ directories for better separation of concerns
- Added comprehensive CI/CD pipeline with GitHub Actions for testing and Docker builds
- Created .dockerignore file to optimize container builds
- Updated Makefile with new targets for each service and application
- Added detailed README with architecture overview, setup instructions and development guidelines
- Moved cron-analyzer to dedicate
2025-11-01 16:20:44 +05:00

34 lines
779 B
Go

package app
import (
"database/sql"
"github.com/gorilla/mux"
"github.com/jobs-scraper/services/api/internal/commands/job"
"github.com/jobs-scraper/internal/pkg/infrastructure/rabbitmq"
"github.com/jobs-scraper/libs/ports"
"github.com/jobs-scraper/libs/repo"
"github.com/jobs-scraper/libs/server"
)
type Application struct {
Router *mux.Router
DB *sql.DB
Server *server.AppServer
JobCommands *ports.JobCommands
}
func NewApplication(router *mux.Router, db *sql.DB, rmq *rabbitmq.RabbitMQClient) *Application {
s := server.NewServer(router)
jobRepo := repo.NewJobRepository(db)
return &Application{
Server: s,
Router: router,
DB: db,
JobCommands: &ports.JobCommands{
CreateJob: job.NewCreateJobHandler(jobRepo, rmq),
},
}
}