Developer Onboarding Guide
This guide helps you set up a local development environment for AxCom, run tests, and check your work before committing code.
๐ ๏ธ Prerequisitesโ
To build and run the AxCom backend, make sure you have the following installed:
- Go 1.25.0+
- MongoDB 6.0+ (Local installation or running via Docker)
- Redis 7.0+ (Local installation or running via Docker)
- Node.js 18+ (Required only for editing/running the documentation site)
- Docker (Optional, but highly recommended for containerized testing)
๐ Local Environment Setupโ
1. Clone the Repositoryโ
Clone the codebase and navigate to the project root:
[git clone https://github.com/axiolon-labs/ecom-engine.git](https://github.com/axiolon/axcom.git)
cd ecom-engine (cd axcom)
2. Configure Environment Variablesโ
Copy the example environment configuration file to create your development configuration:
cd axcom-backend
cp .env.example .env
Open .env in your text editor and verify the following settings are pointing to your local MongoDB and Redis instances:
MONGO_URI=mongodb://localhost:27017/ecom_engine
REDIS_URI=redis://localhost:6379/0
SERVER_PORT=8080
JWT_SECRET=your-local-development-secret-key-change-in-prod
3. Start Dependencies (Optional)โ
If you prefer running MongoDB and Redis via Docker Compose:
docker compose -f deployments/docker-compose.yml up -d
4. Run the Backend Serverโ
Launch the server from the root directory:
go run cmd/server/main.go
The server will boot up and start listening on port 8080 (or whatever port is defined in .env).
๐งช Testing & Code Qualityโ
Before opening a pull request, you must ensure that all code meets quality standards and tests pass.
1. Code Style and Lintingโ
We use golangci-lint to maintain strict code guidelines. Check the rules defined in .golangci.yml and run the linter:
golangci-lint run
2. Running Unit & Integration Testsโ
Ensure all core tests run and pass without race conditions:
go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
3. Running E2E Testsโ
To run full end-to-end tests (requires active test instances of Redis and MongoDB):
cd axcom-backend
go test -tags e2e -v -timeout 300s ./tests/e2e/...
๐ Running the Documentation Site Locallyโ
The documentation website is built with Docusaurus. If you are updating documentation under docs/, you should preview the site locally to check for layout or link issues.
1. Install Documentation Dependenciesโ
Navigate to the docs directory and install package requirements:
cd axcom-engine-docs-site
npm install --legacy-peer-deps
2. Generate API Reference Pagesโ
If the OpenAPI schema has updated, generate the new API documentation:
npm run clean-api-docs
npm run gen-api-docs
3. Run the Documentation Serverโ
Start the local development server:
npm run start
Open http://localhost:3000 in your browser to view your local copy of the documentation.
4. Build Validationโ
Ensure the documentation builds successfully without any broken links or MDX errors before pushing your branch:
npm run build