Categorygithub.com/kptm-tools/core-service
repository
0.0.0-20250217202916-bc2bee9bdda0
Repository: https://github.com/kptm-tools/core-service.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Core-Service πŸš€

Welcome to Core-Service, the heart of the Kriptome-Tools project! This service manages the core domain logic, including database connections, tenants, users, scans, and more. Below, you'll find everything you need to get started with running, testing, and deploying Core-Service. πŸ’ΌπŸ”


πŸ› οΈ Features

  • Tenant Management: Handle multiple tenants with ease.
  • User Management: Define and manage users within the system.
  • Scan Orchestration: Automate and manage scans with robust workflows.
  • Database Integration: Seamless PostgreSQL integration for reliable data persistence.
  • Authentication Support: Integrated with FusionAuth for secure identity management.

πŸš€ Quick Start

Prerequisites

  1. Install Docker & Docker Compose.
  2. Environment Variables:
    • Configure the required environment variables in a .env file.
    • An example can be found in .env.example in the root directory
    • You may set variables within the Makefile such as DATABASE_URL too.

Steps

  1. Clone this repository:
    git clone https://github.com/your-org/core-service.git
    cd core-service
    
  2. Build and run the service:
    docker-compose up --build
    
  3. Access the service:

πŸ› οΈ Development

Commands

Makefile Helpers

CommandDescription
make helpDisplay all available commands.
make tidyTidy mod files and format Go files.
make buildBuild the application binary.
make runRun the application locally.
make run/liveRun the application with live reload.
make populatePopulate the database with sample data.
make clearClear all database tables (requires confirm).
make migrate/create NAME=<name>Create a new migration file.
make migrate/upApply all up migrations.
make migrate/downApply the latest down migration.

Quality Control

CommandDescription
make auditRun static analysis and vulnerability checks.
make testRun all tests.
make test/coverRun tests with coverage report.

🐳 Docker Usage

Build and Run

docker-compose up --build

Core Service Configuration

  • Exposed on: http://localhost:8000
  • Dependencies:
    • PostgreSQL database
    • FusionAuth for authentication
    • OpenSearch for logging and search

πŸ“‚ Project Structure

DirectoryPurpose
/cmdMain application entry points and utilities.
/pkgCore libraries and reusable components.
/binCompiled binary artifacts.

πŸ§ͺ Testing

Run all tests with:

make test

For a coverage report:

make test/cover

Happy Coding! πŸŽ‰