https://github.com/shellicar/reference-enterprise
https://github.com/shellicar/reference-enterprise
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shellicar/reference-enterprise
- Owner: shellicar
- License: mit
- Created: 2025-06-21T01:03:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-24T09:38:58.000Z (8 months ago)
- Last Synced: 2025-10-24T11:23:41.783Z (8 months ago)
- Language: TypeScript
- Size: 1.25 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @shellicar/reference-enterprise
[][node]
[][npm]
[][pnpm]
[][typescript]
[][nvm]
[][docker]
[][biome]
[][copilot]
[][vscode]
## Built Using
These are some of the key tools and technologies used to build and develop this project:
[][vite]
[][esbuild]
[][tsx]
## Runs On
These are some of the key dependencies required to run the applications:
[][azure-functions]
[][graphql]
[][nuxt]
[][tailwind]
[][zod]
[][js-joda]
[][winston]
[][opentelemetry]
---
`@shellicar/reference-enterprise` is a software architecture starter repository that provides a structured foundation for building Azure application workloads. This repository demonstrates enterprise-grade project organization with clear separation between customer-facing APIs, internal integrations, worker processes, and multiple web applications.
Unlike the foundational [`@shellicar/reference-foundation`](https://github.com/shellicar/reference-foundation) which illustrates individual concepts, this enterprise reference provides a complete project structure that can be used as the basis for creating new Azure application workloads.
## Table of Contents
- [Overview](#overview)
- [@shellicar Ecosystem](#shellicar-typescript-ecosystem)
- [Repository Structure](#repository-structure)
- [Applications](#applications)
- [Packages](#packages)
- [Infrastructure & Deployment](#infrastructure--deployment)
- [Development Tools](#development-tools)
- [Getting Started](#getting-started)
## @shellicar TypeScript Ecosystem
### Core Libraries
- [`@shellicar/core-config`](https://github.com/shellicar/core-config) - A library for securely handling sensitive configuration values like connection strings, URLs, and secrets.
- [`@shellicar/core-di`](https://github.com/shellicar/core-di) - A basic dependency injection library.
### Reference Architectures
- [`@shellicar/reference-foundation`](https://github.com/shellicar/reference-foundation) - A comprehensive starter repository. Illustrates individual concepts.
- [`@shellicar/reference-enterprise`](https://github.com/shellicar/reference-enterprise) - A comprehensive starter repository. Can be used as the basis for creating a new Azure application workload.
### Build Tools
- [`@shellicar/build-clean`](https://github.com/shellicar/build-clean) - Build plugin that automatically cleans unused files from output directories.
- [`@shellicar/build-version`](https://github.com/shellicar/build-version) - Build plugin that calculates and exposes version information through a virtual module import.
- [`@shellicar/build-graphql`](https://github.com/shellicar/build-graphql) - Build plugin that loads GraphQL files and makes them available through a virtual module import.
### Framework Adapters
- [`@shellicar/svelte-adapter-azure-functions`](https://github.com/shellicar/svelte-adapter-azure-functions) - A [SvelteKit adapter](https://kit.svelte.dev/docs/adapters) that builds your app into an Azure Function.
- [`@shellicar/cosmos-query-builder`](https://github.com/shellicar/cosmos-query-builder) - Helper class for type safe advanced queries for Cosmos DB (Sql Core).
### Logging & Monitoring
- [`@shellicar/winston-azure-application-insights`](https://github.com/shellicar/winston-azure-application-insights) - An [Azure Application Insights](https://azure.microsoft.com/en-us/services/application-insights/) transport for [Winston](https://github.com/winstonjs/winston) logging library.
- [`@shellicar/pino-applicationinsights-transport`](https://github.com/shellicar/pino-applicationinsights-transport) - [Azure Application Insights](https://azure.microsoft.com/en-us/services/application-insights) transport for [pino](https://github.com/pinojs/pino)
## Overview
**@shellicar/reference-enterprise** provides a structured foundation for building Azure application workloads with clear architectural boundaries and separation of concerns.
## Repository Structure
This repository follows a structured approach to organising enterprise applications:
```text
├── apps/
│ ├── api/ # Function App - User-facing APIs
│ ├── integration/ # Function App - Internal/non-user APIs
│ ├── worker/ # App Service - TemporalIO & long-running processes
│ ├── webapp/ # Main web application for users
│ ├── dashboard/ # Internal staff/line of business dashboard
│ └── admin/ # Administration interface for mature apps
├── packages/
│ ├── common/ # Code shared across frontend and backend
│ ├── server-common/ # Common functionality for Function Apps/worker
│ ├── ui/ # Framework-dependent components (Nuxt) and configuration
│ ├── ui-common/ # Framework-agnostic UI code, validation, schemas
│ ├── ui-schema/ # Schema for frontend applications
│ ├── ui-schema-admin/ # Schema for admin interface (optional)
│ ├── server-schema/ # Schema for APIs
│ ├── server-schema-api/ # Schema specifically for API (optional)
│ ├── server-schema-integration/ # Schema for integration services (optional)
│ └── typescript-config/ # Shared TypeScript configuration
├── infra/ # Infrastructure as Code (Bicep)
└── deploy/
└── templates/ # Reusable Azure Pipeline templates
```
## Applications
| Application | Type | Purpose | Technology |
|-------------|------|---------|------------|
| `apps/api` | Azure Function App | User-facing APIs | Azure Functions with HTTP triggers |
| `apps/integration` | Azure Function App | Internal/non-user APIs | Azure Functions for third-party integrations |
| `apps/worker` | Azure App Service | Long-running processes | TemporalIO for workflow orchestration |
| `apps/webapp` | Web Application | Main user interface | Vue+Nuxt |
| `apps/dashboard` | Web Application | Internal staff dashboard | Vue+Nuxt |
| `apps/admin` | Web Application | Administration interface | Vue+Nuxt |
## Packages
| Package | Purpose | What Goes Here | Used By |
|---------|---------|----------------|---------|
| `common` | Shared code across frontend and backend | Utilities, types, constants that work everywhere | All apps |
| `server-common` | Server-side shared functionality | Middleware, auth helpers, server utilities | `api`, `integration`, `worker` |
| `ui` | Framework-dependent UI components | Nuxt components, framework-specific code | `webapp`, `dashboard`, `admin` |
| `ui-common` | Framework-agnostic UI code | Validation logic, Zod schemas, reusable functions | `webapp`, `dashboard`, `admin` |
| `schema-server` | Generated types for server APIs | GraphQL codegen types for server-side API consumption | Server applications |
| `schema-ui` | Generated types for frontend APIs | GraphQL codegen types for client-side API consumption | Frontend applications |
| `schema-api` | Generated types for API service (optional) | GraphQL codegen types specific to API service | `api` |
| `schema-integration` | Generated types for integration APIs (optional) | GraphQL codegen types for third-party/integration APIs | `integration` |
| `schema-admin` | Generated types for admin APIs (optional) | GraphQL codegen types specific to admin interface | `admin` |
| `typescript-config` | Shared TypeScript configuration | TSConfig files, build settings | All applications and packages |
## Infrastructure & Deployment
> **Work in Progress** - This section is under development
### Infrastructure as Code
#### `infra/`
- **Technology**: Bicep templates
- **Purpose**: Azure resource definitions
- **Contents**: Resource groups, Function Apps, App Services, databases, networking
### Deployment Templates
#### `deploy/templates/`
- **Purpose**: Reusable Azure Pipeline templates
- **Contents**: Build, test, and deployment pipeline definitions
- **Benefits**: Consistent deployment patterns across applications
## Development Tools
> **Work in Progress** - This section is under development
This repository includes several development tools to maintain code quality and consistency:
### Code Quality
- **Biome**: Linting and formatting
- **Lefthook**: Git hooks for pre-commit checks
- **GitVersion**: Semantic versioning based on Git history
### Build System
- **Turbo**: Monorepo task orchestration
- **pnpm Workspaces**: Package management and dependency resolution
## Getting Started
### Prerequisites
- Git
- Basic understanding of Azure services
- Azure subscription (for deployment)
### Setup
#### Automated Setup (Recommended)
Run the setup script to automatically install all required tools and dependencies:
**Linux/macOS:**
```sh
./setup.sh
```
**Windows:**
```powershell
.\setup.ps1
```
The setup script will:
- Install prerequisites (Homebrew on macOS)
- Install Node Version Manager (NVM)
- Install Node.js version from `.nvmrc`
- Enable Corepack for package manager management
- Install pnpm via Corepack
- Install Azure Functions Core Tools
- Install Docker (optional)
#### Manual Setup
If you prefer manual installation:
1. **Install Node.js** (version specified in `.nvmrc`)
2. **Enable Corepack and install pnpm**
```sh
corepack enable
corepack prepare pnpm@latest --activate
```
3. **Install Azure Functions Core Tools**
See [Azure Functions Core Tools documentation](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local)
4. **Clone and setup the repository**
```sh
git clone https://github.com/shellicar/reference-enterprise.git
cd reference-enterprise
pnpm install
pnpm build
```
### Development
Once setup is complete, you can start developing:
```sh
# Start the API
pnpm --filter api dev
# Start the web application
pnpm --filter webapp dev
# Build all packages
pnpm build
# Run tests
pnpm test
```
### Architecture Decisions
This structure provides:
- **Clear separation** between user-facing and internal services
- **Shared code** through common packages
- **Scalable architecture** that can grow with application complexity
- **Consistent development** patterns across all applications
- **Flexible deployment** options for different application types
## Architecture Approach
This repository follows **Vertical Slice Architecture** - organising code by feature rather than technical layers. Each feature contains everything it needs (API endpoints, business logic, data access, validation) in one cohesive slice.
### Why Vertical Slices?
**Benefits:**
- **High cohesion** - Feature logic stays together
- **Team independence** - Developers can work on different features without conflicts
- **Easy to understand** - Business logic is contained and traceable
- **Better pull requests** - Code changes are colocated, making reviews easier to follow
- **Deployment flexibility** - Features can be developed and tested independently
**Trade-offs:**
- **Some code duplication** - Accept duplication when it keeps features independent
- **Consistency overhead** - Requires discipline to maintain standards across slices
- **Cross-cutting changes** - Security or infrastructure updates touch multiple slices
### Database Considerations
Using document databases (Cosmos DB NoSQL, MongoDB) aligns well with vertical slices:
- Features can model data as standalone documents or nested within parent entities
- Less coupling through shared database schemas
- Natural fit for feature-based data modelling
### Team Approach
This architecture works best with teams that:
- Communicate effectively and coordinate when needed
- Recognize when duplication becomes problematic and refactor accordingly
- Balance feature independence with shared concerns
- Understand that **no architecture is perfect** - there are always trade-offs
---
This enterprise reference provides a solid foundation for Azure application workloads with clear architectural boundaries and room for growth as applications mature.
*This README was created with the assistance of [GitHub Copilot][copilot].*
[nvm]: https://github.com/nvm-sh/nvm
[pnpm]: https://pnpm.io
[docker]: https://www.docker.com
[copilot]: https://github.com/features/copilot
[biome]: https://biomejs.dev
[typescript]: https://www.typescriptlang.org
[node]: https://nodejs.org/en
[npm]: https://www.npmjs.com
[tailwind]: https://tailwindcss.com
[vite]: https://vitejs.dev
[azure-functions]: https://www.npmjs.com/package/@azure/functions
[graphql]: https://www.npmjs.com/package/graphql
[nuxt]: https://nuxtjs.org
[opentelemetry]: https://opentelemetry.io
[zod]: https://github.com/colinhacks/zod
[js-joda]: https://js-joda.github.io/js-joda
[vscode]: https://code.visualstudio.com
[vitest]: https://github.com/vitest-dev/vitest
[tsx]: https://github.com/privatenumber/tsx
[winston]: https://github.com/winstonjs/winston
[esbuild]: https://esbuild.github.io