A high-performance microservice for source code analysis, generating Abstract Syntax Trees (ASTs) and relationship maps from codebases.
- 🚀 AST generation for multiple programming languages
- 🔍 Code relationship mapping
- ⚡ High-performance processing with Node.js worker threads
- 🐳 Docker and Kubernetes ready
- 📊 Built-in health checks and metrics
- 🔒 Secure by default
- Node.js 22.14.0 or higher
- Yarn (recommended) or npm
- Docker (for containerized deployment)
- Git
-
Clone the repository
git clone https://github.com/kodustech/kodus-service-ast.git cd kodus-service-ast
-
Install dependencies
yarn install # or npm install
# Development with hot-reload
yarn start:dev
# Build for production
yarn build
# Run in production mode locally
yarn start:prod
# Development
make dev-build
# or
docker build -t kodus-ast:dev -f DockerFiles/Dockerfile.dev .
# Production (replace x.y.z with the release version)
docker build \
--build-arg RELEASE_VERSION=x.y.z \
-t kodus-ast:x.y.z \
-f DockerFiles/Dockerfile.prod .
# Development
docker run -d \
--name kodus-ast-dev \
-p 3002:3002 \
-p 5001:5001 \
-v $(pwd):/usr/src/app \
-v /usr/src/app/node_modules \
kodus-ast:dev
# Production (replace x.y.z with the desired version)
docker run -d \
--name kodus-ast \
-p 3002:3002 \
-p 5001:5001 \
-e NODE_ENV=production \
-e LOG_LEVEL=info \
--memory="4g" \
--cpus="2" \
kodus-ast:x.y.z
GET /health
POST /api/analyze # Analyze source code
GET /api/status/:id # Check analysis status
# Other endpoints...
Note: All API routes except
/health
are prefixed with/api/
Variable | Default | Description |
---|---|---|
NODE_ENV |
production | Runtime environment |
LOG_LEVEL |
info | Log level (error, warn, info, debug) |
API_PORT |
3002 | API port |
API_HEALTH_PORT |
5001 | Health check port |
UV_THREADPOOL_SIZE |
Auto | Node.js thread pool size |
# Run all tests
yarn test
# Run tests with coverage
yarn test:cov
# Run e2e tests
yarn test:e2e
Deployment is automated via GitHub Actions to GCP. The service is designed to be deployed in a containerized environment.
# Build and push the production image
make release VERSION=x.y.z
# Deploy to your infrastructure
kubectl apply -f k8s/
We welcome contributions! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For more detailed documentation, please refer to our documentation site.
Project Link: https://github.com/kodustech/kodus-service-ast
- Built with ❤️ by the Kodus Tech Team
- Thanks to all contributors who have helped shape this project
- Inspired by modern AST tooling and code analysis tools