Bruno GalvánLima, Perú
Sección 3 de 7: Stack
Las herramientas
Cada herramienta aparece en mis propios commits de los últimos dos años.
Tipado de punta a punta
TypeScript estricto del esquema a la pantalla.
Probado tal como se publica
Vitest y Playwright sobre el build de producción.
Sección 5 de 7: Código
import { roles, type Month } from './experience';
import { projects } from './projects';
import { stack } from './stack';
// Every figure the site states is computed here from the record, at build
// time, so a number can never contradict the roles and projects under it.
const toMonths = (month: Month) => {
const [year, index] = month.split('-').map(Number);
return (year ?? 0) * 12 + (index ?? 1) - 1;
};
const monthOf = (date: Date): Month =>
`${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, '0')}` as Month;
// How long a role lasted, in whole months, counting its first and last month;
// an open role runs to the current month.
export function roleMonths(
role: { start: Month; end: Month | null },
today: Date,
) {
const end = role.end ? toMonths(role.end) : toMonths(monthOf(today));
return end - toMonths(role.start) + 1;
}
export function figures(today: Date) {
const now = toMonths(monthOf(today));
const first = Math.min(...roles.map((role) => toMonths(role.start)));
return {
yearsSinceFirstRole: Math.floor((now - first) / 12),
firstYear: Math.floor(first / 12),
companies: new Set(roles.map((role) => role.company)).size,
projects: projects.length,
publicProjects: projects.filter((project) => project.repository).length,
technologies: Object.values(stack).flat().length,
};
}
// One entry per month from the first role to today: the role held that month
// and how many months into it, or null for a month between roles.
export function career(today: Date) {
const now = toMonths(monthOf(today));
const first = Math.min(...roles.map((role) => toMonths(role.start)));
return Array.from({ length: now - first + 1 }, (_, offset) => {
const month = first + offset;
const role = roles.find(
(candidate) =>
toMonths(candidate.start) <= month &&
month <= (candidate.end ? toMonths(candidate.end) : now),
);
return {
year: Math.floor(month / 12),
month: month % 12,
role: role?.id ?? null,
tenure: role ? month - toMonths(role.start) + 1 : 0,
};
});
}---
// The section statement: two short sentences between decorative slashes. The
// slashes are generated content with an empty text alternative, so they are
// neither read aloud nor measured as text. The name lives on the heading and
// the visual copy is hidden, so the per-character reveal never reaches
// assistive technology and the phrase reads whole.
interface Props {
lines: readonly string[];
id?: string;
level?: 'h1' | 'h2' | 'h3';
size?: 'headline' | 'display';
}
const { lines, id, level: Tag = 'h2', size = 'headline' } = Astro.props;
---
<Tag
class:list={['headline', `text-${size}`]}
id={id}
aria-label={lines.join(' ')}
>
<span class="headline-lines" aria-hidden="true" data-reveal>
{lines.map((line, index) => (
<>
{index > 0 && ' '}
<span class="headline-line">{line}</span>
</>
))}
</span>
</Tag>
<style>
.headline {
margin: 0;
}
/* Each sentence is its own block and balances alone, so neither ends on a
word by itself; the slashes open the first and close the last. */
.headline-lines,
.headline-line {
display: block;
}
.headline-line {
text-wrap: balance;
}
.headline-line:first-child::before,
.headline-line:last-child::after {
color: var(--decor);
font-family: var(--font-pixel);
}
/* The slash alone, a Geist space's width from the words (0.19em), where
a no-break space set in the pixel face would open a wider gap. */
.headline-line:first-child::before {
content: '/' / '';
margin-inline-end: 0.19em;
}
.headline-line:last-child::after {
content: '/' / '';
margin-inline-start: 0.19em;
}
</style> for (const colorScheme of ['light', 'dark'] as const) {
test(`${locale}: accessible ${colorScheme} page without overflow`, async ({
page,
}) => {
await page.emulateMedia({ colorScheme, reducedMotion: 'reduce' });
await page.goto(`/${locale}/`);
// The bar and the phone menu each hold one, and both tell the scheme.
const toggles = page.locator('[data-theme-toggle]');
await expect(toggles).toHaveCount(2);
for (const toggle of await toggles.all()) {
await expect(toggle).toHaveAttribute(
'aria-pressed',
String(colorScheme === 'dark'),
);
}
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.analyze();
expect(results.violations).toEqual([]);
expect(
await page.evaluate(
() => document.documentElement.scrollWidth <= window.innerWidth,
),
).toBe(true);
});
}TypeScriptCada cifra de esta página, calculada del registro al compilar el sitio.
import { roles, type Month } from './experience';
import { projects } from './projects';
import { stack } from './stack';
// Every figure the site states is computed here from the record, at build
// time, so a number can never contradict the roles and projects under it.
const toMonths = (month: Month) => {
const [year, index] = month.split('-').map(Number);
return (year ?? 0) * 12 + (index ?? 1) - 1;
};
const monthOf = (date: Date): Month =>
`${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(2, '0')}` as Month;
// How long a role lasted, in whole months, counting its first and last month;
// an open role runs to the current month.
export function roleMonths(
role: { start: Month; end: Month | null },
today: Date,
) {
const end = role.end ? toMonths(role.end) : toMonths(monthOf(today));
return end - toMonths(role.start) + 1;
}
export function figures(today: Date) {
const now = toMonths(monthOf(today));
const first = Math.min(...roles.map((role) => toMonths(role.start)));
return {
yearsSinceFirstRole: Math.floor((now - first) / 12),
firstYear: Math.floor(first / 12),
companies: new Set(roles.map((role) => role.company)).size,
projects: projects.length,
publicProjects: projects.filter((project) => project.repository).length,
technologies: Object.values(stack).flat().length,
};
}
// One entry per month from the first role to today: the role held that month
// and how many months into it, or null for a month between roles.
export function career(today: Date) {
const now = toMonths(monthOf(today));
const first = Math.min(...roles.map((role) => toMonths(role.start)));
return Array.from({ length: now - first + 1 }, (_, offset) => {
const month = first + offset;
const role = roles.find(
(candidate) =>
toMonths(candidate.start) <= month &&
month <= (candidate.end ? toMonths(candidate.end) : now),
);
return {
year: Math.floor(month / 12),
month: month % 12,
role: role?.id ?? null,
tenure: role ? month - toMonths(role.start) + 1 : 0,
};
});
}AstroUn titular que se abre letra a letra y aun así se lee entero.
---
// The section statement: two short sentences between decorative slashes. The
// slashes are generated content with an empty text alternative, so they are
// neither read aloud nor measured as text. The name lives on the heading and
// the visual copy is hidden, so the per-character reveal never reaches
// assistive technology and the phrase reads whole.
interface Props {
lines: readonly string[];
id?: string;
level?: 'h1' | 'h2' | 'h3';
size?: 'headline' | 'display';
}
const { lines, id, level: Tag = 'h2', size = 'headline' } = Astro.props;
---
<Tag
class:list={['headline', `text-${size}`]}
id={id}
aria-label={lines.join(' ')}
>
<span class="headline-lines" aria-hidden="true" data-reveal>
{lines.map((line, index) => (
<>
{index > 0 && ' '}
<span class="headline-line">{line}</span>
</>
))}
</span>
</Tag>
<style>
.headline {
margin: 0;
}
/* Each sentence is its own block and balances alone, so neither ends on a
word by itself; the slashes open the first and close the last. */
.headline-lines,
.headline-line {
display: block;
}
.headline-line {
text-wrap: balance;
}
.headline-line:first-child::before,
.headline-line:last-child::after {
color: var(--decor);
font-family: var(--font-pixel);
}
/* The slash alone, a Geist space's width from the words (0.19em), where
a no-break space set in the pixel face would open a wider gap. */
.headline-line:first-child::before {
content: '/' / '';
margin-inline-end: 0.19em;
}
.headline-line:last-child::after {
content: '/' / '';
margin-inline-start: 0.19em;
}
</style>PlaywrightCada página revisada con axe en ambos temas, en un navegador real.
for (const colorScheme of ['light', 'dark'] as const) {
test(`${locale}: accessible ${colorScheme} page without overflow`, async ({
page,
}) => {
await page.emulateMedia({ colorScheme, reducedMotion: 'reduce' });
await page.goto(`/${locale}/`);
// The bar and the phone menu each hold one, and both tell the scheme.
const toggles = page.locator('[data-theme-toggle]');
await expect(toggles).toHaveCount(2);
for (const toggle of await toggles.all()) {
await expect(toggle).toHaveAttribute(
'aria-pressed',
String(colorScheme === 'dark'),
);
}
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.analyze();
expect(results.violations).toEqual([]);
expect(
await page.evaluate(
() => document.documentElement.scrollWidth <= window.innerWidth,
),
).toBe(true);
});
}Sección 6 de 7: Proyectos
ClinicSay
SaaS de gestión clínica. Soy responsable de facturación, agenda y migración de datos en la app React y la API en Fastify.
Código privadoAsistira
Mi SaaS multi-tenant para negocios de servicios: monorepo Nx con Next.js y Fastify.
Código privadobrunogalvan.dev
Este sitio: Astro estático en dos idiomas, una CSP hecha de hashes y axe en ambos temas.
Leer caso
Sección 7 de 7: Experiencia
— Hoy
ClinicSay
— Hoy
Senior Full-Stack Engineer
SaaS de gestión clínica: facturación, agenda, documentos y migración de datos en React 19 y una API hexagonal en Fastify.
—
Métrica Andina
—
Analista Programador Senior
Microservicios, una integración REST con Salesforce y automatización de WhatsApp para clientes de educación.
—
Surtidores S.A.C.
—
Desarrollador de Software (PHP / Laravel)
Lideré el nuevo ERP web en Laravel y mantuve en marcha el anterior, en PHP 5.
—
Platanitos
—
Desarrollador Web · Analista SAP
Aplicaciones web para retail, facturación electrónica y reportes que cruzan SAP con SQL.