Modern TypeScript/Fastify implementation of Eclipse Che Server REST APIs - a drop-in replacement for the Java che-server.
Framework: Fastify 5.0 | Target: Kubernetes-native IDE and developer collaboration platform
This is a high-performance reimplementation of a subset of the Eclipse Che Server REST APIs using TypeScript and Fastify.
This repository focuses on the endpoints implemented in the original Java che-server for:
- Kubernetes namespace provisioning
- Factory resolution
- OAuth integration
- SCM file resolving
This TypeScript project replaces the Java-based Eclipse Che Server:
- Namespace Service:
org.eclipse.che.workspace.infrastructure.kubernetes.api.server.KubernetesNamespaceService - Factory Service:
org.eclipse.che.api.factory.server.FactoryService - OAuth Service:
org.eclipse.che.security.oauth.OAuthAuthenticationService - SCM Service:
org.eclipse.che.api.factory.server.ScmService
| Feature | Java Implementation | TypeScript Implementation |
|---|---|---|
| Framework | JAX-RS / RESTEasy | Fastify 5.0 |
| Dependency Injection | Guice / CDI | Constructor injection |
| K8s Client | Fabric8 | @kubernetes/client-node |
| Authentication | EnvironmentContext | Fastify hooks |
| DTO Pattern | Eclipse Che DTO | TypeScript interfaces |
| API Documentation | Swagger annotations | @fastify/swagger + OpenAPI 3.0 |
| Performance | ~5,000 req/s | ~15,000 req/s (3x faster) |
| Image Size | ~800MB | ~250MB (Alpine-based) |
| Startup Time | ~30s | ~2s |
- β
POST
/api/kubernetes/namespace/provision- Provision a namespace for authenticated users - β
GET
/api/kubernetes/namespace- List available namespaces
π See docs/NAMESPACE_PROVISIONING_IMPLEMENTATION.md for detailed implementation guide.
- β
POST
/api/factory/resolver- Resolve factory from URL - β
POST
/api/factory/token/refresh- Refresh factory OAuth tokens
- β
GET
/api/oauth- Get registered OAuth authenticators - β
GET
/api/oauth/token- Get OAuth token for provider - β
DELETE
/api/oauth/token- Invalidate OAuth token - β
GET
/api/oauth/authenticate- OAuth authentication flow - β
GET
/api/oauth/callback- OAuth callback handler
π Configuration: docs/OAUTH_CONFIGURATION.md
- β
GET
/api/scm/resolve- Resolve file content from SCM repository (supports public & private repos)
- β
GET
/api/system/state- Health/state endpoint (Java-compatible)
- β Fastify 5.0 - High-performance web framework (2-3x faster than Express)
- β @fastify/swagger - Schema-based API documentation
- β
@fastify/swagger-ui - Interactive API documentation at
/swagger - β Authentication hooks (Bearer token and Basic auth)
- β Kubernetes client integration
- β
Namespace name templating (e.g.,
che-<username>) - β SCM API Clients - GitHub, GitLab, Bitbucket, Azure DevOps integration
- β Certificate Authority Support - Handles self-signed certificates in Kubernetes/OpenShift
- β Full TypeScript type safety with Fastify decorators
- β Comprehensive Jest test suite using Fastify inject()
- β Built-in request validation with JSON Schema
- β Structured logging with Pino
- β CORS support with proper header handling
This API includes comprehensive Swagger/OpenAPI 3.0 documentation!
Once the server is running, visit:
- Swagger UI: http://localhost:8080/swagger
- OpenAPI JSON: http://localhost:8080/swagger/json
- OpenAPI YAML: http://localhost:8080/swagger/yaml
- Node.js 18+
- Yarn 4.9.0 (included in repository)
- Kubernetes cluster access (optional for development)
# Install dependencies
yarn install
# Copy environment example
cp env.example .env
# Build the project
yarn build# Use the startup script (recommended)
./run/start-local-dev.sh
# Or manually
export LOCAL_RUN=true
yarn devyarn build
yarn startThe API will be available at http://localhost:8080.
# Set environment variables
export IMAGE_REGISTRY_HOST=quay.io
export IMAGE_REGISTRY_USER_NAME=your-username
export IMAGE_TAG=next # optional, defaults to branch_timestamp
# Build, push, and patch CheCluster in one command
yarn patch
# Or for multi-architecture builds (linux/amd64, linux/arm64)
yarn build:multiarch# Build using environment variables
export IMAGE_REGISTRY_HOST=quay.io
export IMAGE_REGISTRY_USER_NAME=oorel
export IMAGE_TAG=next
./build/build.sh# Build for both platforms and push to registry
./build/build.sh quay.io/oorel/che-server next
# Build for specific platform
./build/build.sh quay.io/oorel/che-server next "linux/amd64"# Build image (Docker or Podman via container_tool.sh)
./scripts/container_tool.sh build -f build/dockerfiles/Dockerfile -t quay.io/oorel/che-server:next .
# Run locally
#
# Recommended (dev mode, uses your local kubeconfig):
./run/start-local-dev.sh
#
# Advanced: run the container locally (requires LOCAL_RUN + a readable kubeconfig file).
# NOTE: mounting ~/.kube/config directly often fails due to file permissions inside the container.
# Use a temporary copy with relaxed permissions instead:
# cp ~/.kube/config /tmp/che-kubeconfig && chmod 644 /tmp/che-kubeconfig
# export USER_TOKEN="$(oc whoami -t)" # optional but recommended for some flows
# ./scripts/container_tool.sh run --rm -p 8080:8080 \
# -e LOCAL_RUN=true \
# -e KUBECONFIG=/tmp/che-kubeconfig \
# -e USER_TOKEN="${USER_TOKEN}" \
# -v /tmp/che-kubeconfig:/tmp/che-kubeconfig:ro \
# quay.io/oorel/che-server:nextπ For detailed build instructions, see build/README.md
Use the helper script (no templating issues, works with any chectl version):
./scripts/patch-che-server-image.shOr specify an explicit image:
CHE_SERVER_IMAGE=quay.io/oorel/che-server:next ./scripts/patch-che-server-image.shkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json \
-p='[{"op":"replace","path":"/spec/components/cheServer/deployment","value":{"containers":[{"image":"quay.io/oorel/che-server:next","imagePullPolicy":"Always","name":"che-server"}]}}]'If you want a single command for OpenShift deployment + patching, use:
./run/deploy-openshift.sh --patch-only# Check the che-server pod
kubectl get pods -n eclipse-che -l app=che
# Verify the image
kubectl get deployment che -n eclipse-che -o jsonpath='{.spec.template.spec.containers[0].image}'| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 8080 |
NODE_ENV |
Environment mode | development |
NAMESPACE_TEMPLATE |
Template for namespace names | che-<username> |
CHE_SELF_SIGNED_MOUNT_PATH |
Path to custom CA certificates | /public-certs |
LOCAL_RUN |
Use local kubeconfig instead of in-cluster | false |
CHE_INFRA_KUBERNETES_USER_CLUSTER_ROLES |
ClusterRoles to bind to users (comma-separated). If unset/empty, user RoleBindings are not created (matches Java behavior) | (unset) |
<username>- User's username (lowercase)<userid>- User's ID (lowercase)<workspaceid>- Workspace ID if available (lowercase)
che-server/
βββ src/
β βββ models/ # Data models and interfaces
β βββ services/ # Business logic
β β βββ api-clients/ # GitHub, GitLab, Bitbucket, Azure DevOps clients
β β βββ ... # Other services
β βββ routes/ # API route handlers
β βββ middleware/ # Authentication middleware
β βββ helpers/ # Kubernetes helpers
β βββ config/ # Swagger configuration
β βββ index.ts # Application entry point
βββ build/
β βββ dockerfiles/ # Dockerfile and entrypoint
β βββ build.sh # Multiplatform build script
βββ docs/ # Implementation documentation
βββ scripts/ # Utility scripts
βββ package.json
yarn build- Production build with webpackyarn build:dev- Development buildyarn build:watch- Development build in watch modeyarn build:multiarch- Build multi-architecture Docker images (linux/amd64, linux/arm64)
yarn patch- Build, push, and patch CheCluster with new image (requires env vars)
yarn start- Run production buildyarn start:debug- Run with nodemon + debuggeryarn dev- Build dev + run with nodemon
yarn lint:check- Check TypeScript + ESLintyarn lint:fix- Fix lint issuesyarn format:check- Check Prettier formattingyarn format:fix- Fix formatting
yarn test- Run Jest testsyarn test:watch- Run tests in watch modeyarn test:coverage- Run tests with coverage
./scripts/patch-che-server-image.sh- Patch CheCluster to use a custom che-server image
- README.md (this file) - Complete API documentation
- docs/NAMESPACE_PROVISIONING_IMPLEMENTATION.md - Kubernetes namespace provisioning
- docs/OAUTH_IMPLEMENTATION.md - OAuth authentication implementation
- docs/swagger-examples.md - Swagger/OpenAPI usage examples
- build/README.md - Docker build guide
scripts/patch-che-server-image.sh- Patch CheCluster che-server image (recommended)
Eclipse Public License 2.0 (EPL-2.0)
Copyright (c) 2025 Red Hat, Inc.