repository
0.0.0-20250217202916-bc2bee9bdda0
Repository: https://github.com/kptm-tools/core-service.git
Documentation: pkg.go.dev
# 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
- Install Docker & Docker Compose.
- 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 asDATABASE_URL
too.
- Configure the required environment variables in a
Steps
- Clone this repository:
git clone https://github.com/your-org/core-service.git cd core-service
- Build and run the service:
docker-compose up --build
- Access the service:
- API: http://localhost:8000
- Healthcheck: http://localhost:8000/healthcheck
π οΈ Development
Commands
Makefile Helpers
Command | Description |
---|---|
make help | Display all available commands. |
make tidy | Tidy mod files and format Go files. |
make build | Build the application binary. |
make run | Run the application locally. |
make run/live | Run the application with live reload. |
make populate | Populate the database with sample data. |
make clear | Clear all database tables (requires confirm). |
make migrate/create NAME=<name> | Create a new migration file. |
make migrate/up | Apply all up migrations. |
make migrate/down | Apply the latest down migration. |
Quality Control
Command | Description |
---|---|
make audit | Run static analysis and vulnerability checks. |
make test | Run all tests. |
make test/cover | Run 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
Directory | Purpose |
---|---|
/cmd | Main application entry points and utilities. |
/pkg | Core libraries and reusable components. |
/bin | Compiled binary artifacts. |
π§ͺ Testing
Run all tests with:
make test
For a coverage report:
make test/cover
Happy Coding! π