Skip to content

Commit 4f8374d

Browse files
create observability dashboard with mock data
1 parent 1bf92e1 commit 4f8374d

41 files changed

Lines changed: 6617 additions & 51 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
echo "Running pre-commit checks..."
3+
4+
if ! command -v mix &> /dev/null; then
5+
echo "mix command not found. Please ensure Elixir is installed."
6+
exit 1
7+
fi
8+
9+
echo "Checking code formatting..."
10+
if ! mix format --check-formatted; then
11+
echo "Code formatting issues detected!"
12+
echo "Run 'mix format' to fix formatting issues"
13+
exit 1
14+
fi
15+
16+
echo "Running Credo analysis..."
17+
if ! mix credo --strict; then
18+
echo "Credo found issues!"
19+
echo "Run 'mix credo --strict' to see the issues"
20+
exit 1
21+
fi
22+
23+
echo "Compiling with warnings as errors..."
24+
if ! mix compile --warnings-as-errors; then
25+
echo "Compilation warnings detected!"
26+
echo "Fix the warnings before committing"
27+
exit 1
28+
fi
29+
30+
echo "All pre-commit checks passed!"
31+
exit 0

.gitignore

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,88 @@ Thumbs.db
6161
# Release artifacts
6262
/rel/artifacts/
6363

64+
# Temporary files
65+
*.tmp
66+
/tmp/# The directory Mix will write compiled artifacts to.
67+
/_build/
68+
69+
# If you run "mix test --cover", coverage assets end up here.
70+
/cover/
71+
72+
# The directory Mix downloads your dependencies sources to.
73+
/deps/
74+
75+
# Where 3rd-party dependencies like ExDoc output generated docs.
76+
/doc/
77+
78+
# Ignore .fetch files in case you like to edit your project deps locally.
79+
/.fetch
80+
81+
# If the VM crashes, it generates a dump, let's ignore it too.
82+
erl_crash.dump
83+
84+
# Also ignore archive artifacts (built via "mix archive.build").
85+
*.ez
86+
87+
# Ignore package tarball (built via "mix hex.build").
88+
kafkaesque-*.tar
89+
90+
# Ignore assets that are produced by build tools.
91+
/priv/static/
92+
93+
# Ignore digested assets cache.
94+
/priv/static/cache_manifest.json
95+
96+
# Node.js/npm
97+
npm-debug.log
98+
node_modules/
99+
/apps/*/assets/node_modules/
100+
/apps/*/assets/vendor/
101+
102+
# Phoenix assets
103+
/apps/*/priv/static/assets/
104+
/apps/*/priv/static/cache_manifest.json
105+
106+
# Esbuild
107+
/apps/*/assets/js/_build/
108+
esbuild.meta.json
109+
110+
# Generated assets
111+
/apps/*/priv/static/assets/
112+
/apps/*/priv/static/*.html
113+
/apps/*/priv/static/*.html.gz
114+
/apps/*/priv/static/cache_manifest.json
115+
/apps/*/priv/server/
116+
117+
# Database files
118+
*.db
119+
*.db-*
120+
121+
# OS files
122+
.DS_Store
123+
Thumbs.db
124+
125+
# Editor directories and files
126+
.idea/
127+
.vscode/
128+
*.swp
129+
*.swo
130+
*~
131+
132+
# Elixir Language Server
133+
/.elixir_ls/
134+
135+
# Data directories (for local development)
136+
/data/
137+
/offsets/
138+
139+
# Environment files
140+
.env
141+
.env.*
142+
143+
# Release artifacts
144+
/rel/artifacts/
145+
64146
# Temporary files
65147
*.tmp
66148
/tmp/

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# ---- Asset build stage ----
2+
FROM node:20-slim AS assets
3+
4+
WORKDIR /app
5+
6+
# Copy package files
7+
COPY apps/kafkaesque_dashboard/assets/package*.json ./
8+
9+
# Install npm dependencies
10+
RUN npm ci --production=false
11+
12+
# Copy asset sources
13+
COPY apps/kafkaesque_dashboard/assets ./
14+
15+
# Build assets for production
16+
RUN npm run build
17+
118
# ---- Build image ----
219
FROM elixir:1.18-slim AS build
320

@@ -33,9 +50,15 @@ COPY apps/kafkaesque_server apps/kafkaesque_server
3350
COPY apps/kafkaesque_dashboard apps/kafkaesque_dashboard
3451
COPY proto proto
3552

53+
# Copy built assets from assets stage
54+
COPY --from=assets /app/../priv/static/assets apps/kafkaesque_dashboard/priv/static/assets
55+
3656
# Compile the application
3757
RUN mix compile
3858

59+
# Digest static files
60+
RUN mix phx.digest
61+
3962
# Build the release
4063
RUN mix release kafkaesque
4164

apps/kafkaesque_core/lib/kafkaesque/core/application.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ defmodule Kafkaesque.Core.Application do
88
children = [
99
{Registry, keys: :unique, name: Kafkaesque.TopicRegistry},
1010
{DynamicSupervisor, name: Kafkaesque.TopicSupervisor, strategy: :one_for_one},
11+
{Phoenix.PubSub, name: Kafkaesque.PubSub},
1112
Kafkaesque.Telemetry.Supervisor
1213
]
1314

0 commit comments

Comments
 (0)