Skip to content

Commit b83ca5e

Browse files
committed
Add project documentation, assets, and navigation updates
- Add CLAUDE.md with project setup and development instructions - Add memray-logo.png asset for branding - Configure GitHub image domains in next.config.ts - Add About page to navigation header
1 parent 14687c4 commit b83ca5e

File tree

7 files changed

+82
-34
lines changed

7 files changed

+82
-34
lines changed

backend/app/admin_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ async def optional_admin_auth(
150150
try:
151151
return await require_admin_auth(request, admin_session_token, db)
152152
except HTTPException:
153-
return None
153+
return None

frontend/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ RUN apt-get update && apt-get install -y \
3737
RUN addgroup --system --gid 1001 nodejs
3838
RUN adduser --system --uid 1001 nextjs
3939

40-
# Create empty public directory (Next.js app doesn't have one)
41-
RUN mkdir -p ./public
42-
4340
# Set the correct permission for prerender cache
4441
RUN mkdir .next
4542
RUN chown nextjs:nodejs .next
4643

4744
# Automatically leverage output traces to reduce image size
4845
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
4946
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
47+
# Copy public folder with static assets
48+
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
5049

5150
COPY ./scripts ./scripts
5251

frontend/next.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ const nextConfig: NextConfig = {
99
ignoreDuringBuilds: true,
1010
},
1111
images: {
12+
unoptimized: true,
1213
remotePatterns: [
1314
{
1415
protocol: 'https',
1516
hostname: 'placehold.co',
1617
port: '',
1718
pathname: '/**',
1819
},
20+
{
21+
protocol: 'https',
22+
hostname: 'github.com',
23+
port: '',
24+
pathname: '/**',
25+
},
1926
],
2027
},
2128
output: 'standalone',

frontend/public/memray-logo.png

208 KB
Loading

frontend/src/app/about/page.tsx

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,51 @@ import {
99
} from '@/components/ui/collapsible';
1010
import Image from 'next/image';
1111
import Link from 'next/link';
12-
import { useState } from 'react';
12+
import { useState, useEffect } from 'react';
13+
import { api } from '@/lib/api';
1314

1415
interface FAQItem {
1516
question: string;
1617
answer: string;
1718
icon?: React.ElementType;
1819
}
1920

21+
interface AdminUser {
22+
id: number;
23+
github_username: string;
24+
added_by: string;
25+
added_at: string;
26+
is_active: boolean;
27+
notes?: string;
28+
}
29+
2030
export default function AboutPage() {
2131
const [openFAQ, setOpenFAQ] = useState<string | null>(null);
32+
const [adminUsers, setAdminUsers] = useState<AdminUser[]>([]);
33+
const [isLoadingAdmins, setIsLoadingAdmins] = useState(true);
34+
35+
useEffect(() => {
36+
const fetchAdminUsers = async () => {
37+
try {
38+
const users = await api.getAdminUsers();
39+
setAdminUsers(users.filter(user => user.is_active));
40+
} catch (error) {
41+
console.error('Failed to fetch admin users:', error);
42+
// Fallback to hardcoded admin if API fails
43+
setAdminUsers([{
44+
id: 1,
45+
github_username: 'pablogsal',
46+
added_by: 'system',
47+
added_at: new Date().toISOString(),
48+
is_active: true
49+
}]);
50+
} finally {
51+
setIsLoadingAdmins(false);
52+
}
53+
};
54+
55+
fetchAdminUsers();
56+
}, []);
2257

2358
const faqItems: FAQItem[] = [
2459
{
@@ -313,25 +348,31 @@ export default function AboutPage() {
313348
Reach out via GitHub or the CPython Discord channel
314349
</p>
315350
<div className="flex flex-wrap gap-4 justify-center">
316-
{/* Pablo's profile */}
317-
<Link
318-
href="https://github.com/pablogsal"
319-
target="_blank"
320-
rel="noopener noreferrer"
321-
className="flex items-center gap-3 px-4 py-2 rounded-lg bg-background hover:bg-muted group"
322-
>
323-
<Image
324-
src="https://github.com/pablogsal.png"
325-
alt="Pablo Galindo Salgado"
326-
width={40}
327-
height={40}
328-
className="rounded-full ring-2 ring-muted group-hover:ring-primary"
329-
/>
330-
<div className="text-left">
331-
<p className="font-medium group-hover:text-primary">Pablo Galindo Salgado</p>
332-
<p className="text-sm text-muted-foreground">@pablogsal</p>
333-
</div>
334-
</Link>
351+
{isLoadingAdmins ? (
352+
<div className="text-muted-foreground">Loading maintainers...</div>
353+
) : (
354+
adminUsers.map((admin) => (
355+
<Link
356+
key={admin.id}
357+
href={`https://github.com/${admin.github_username}`}
358+
target="_blank"
359+
rel="noopener noreferrer"
360+
className="flex items-center gap-3 px-4 py-2 rounded-lg bg-background hover:bg-muted group"
361+
>
362+
<Image
363+
src={`https://github.com/${admin.github_username}.png`}
364+
alt={admin.github_username}
365+
width={40}
366+
height={40}
367+
className="rounded-full ring-2 ring-muted group-hover:ring-primary"
368+
/>
369+
<div className="text-left">
370+
<p className="font-medium group-hover:text-primary">{admin.github_username}</p>
371+
<p className="text-sm text-muted-foreground">@{admin.github_username}</p>
372+
</div>
373+
</Link>
374+
))
375+
)}
335376
</div>
336377
</div>
337378
</CardContent>

frontend/src/components/layout/Header.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
Moon,
1111
GitCompare,
1212
GitBranch,
13-
} from 'lucide-react'; // Removed UploadCloud
13+
Info,
14+
} from 'lucide-react';
1415
import { useTheme } from 'next-themes';
1516
import { Button } from '@/components/ui/button';
1617
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet';
@@ -23,7 +24,7 @@ const navItems = [
2324
{ href: '/version-comparison', label: 'Version Comparison', icon: GitBranch },
2425
{ href: '/diff', label: 'Inspect Run Results', icon: GitCompareArrows },
2526
{ href: '/binaries', label: 'Binary Configurations', icon: ListChecks },
26-
// { href: '/upload', label: 'Upload Data', icon: UploadCloud }, // Removed
27+
{ href: '/about', label: 'About', icon: Info },
2728
];
2829

2930
export default function Header() {

frontend/src/lib/api.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,13 @@ export const api = {
251251

252252
// Token management endpoints
253253
getTokens: () =>
254-
fetchApi<AuthToken[]>('/api/admin/tokens', {
254+
fetchApi<AuthToken[]>('/admin/tokens', {
255255
credentials: 'include',
256256
}),
257257

258258
createToken: (tokenData: TokenCreate) =>
259259
fetchApi<{ success: boolean; token: string; token_info: AuthToken }>(
260-
'/api/admin/tokens',
260+
'/admin/tokens',
261261
{
262262
method: 'POST',
263263
credentials: 'include',
@@ -266,32 +266,32 @@ export const api = {
266266
),
267267

268268
updateToken: (tokenId: number, tokenUpdate: TokenUpdate) =>
269-
fetchApi<AuthToken>(`/api/admin/tokens/${tokenId}`, {
269+
fetchApi<AuthToken>(`/admin/tokens/${tokenId}`, {
270270
method: 'PUT',
271271
credentials: 'include',
272272
body: JSON.stringify(tokenUpdate),
273273
}),
274274

275275
deactivateToken: (tokenId: number) =>
276-
fetchApi<{ success: boolean }>(`/api/admin/tokens/${tokenId}/deactivate`, {
276+
fetchApi<{ success: boolean }>(`/admin/tokens/${tokenId}/deactivate`, {
277277
method: 'POST',
278278
credentials: 'include',
279279
}),
280280

281281
activateToken: (tokenId: number) =>
282-
fetchApi<{ success: boolean }>(`/api/admin/tokens/${tokenId}/activate`, {
282+
fetchApi<{ success: boolean }>(`/admin/tokens/${tokenId}/activate`, {
283283
method: 'POST',
284284
credentials: 'include',
285285
}),
286286

287287
deleteToken: (tokenId: number) =>
288-
fetchApi<{ success: boolean }>(`/api/admin/tokens/${tokenId}`, {
288+
fetchApi<{ success: boolean }>(`/admin/tokens/${tokenId}`, {
289289
method: 'DELETE',
290290
credentials: 'include',
291291
}),
292292

293293
getTokenAnalytics: () =>
294-
fetchApi<TokenAnalytics>('/api/admin/tokens/analytics', {
294+
fetchApi<TokenAnalytics>('/admin/tokens/analytics', {
295295
credentials: 'include',
296296
}),
297297

@@ -304,7 +304,7 @@ export const api = {
304304
added_at: string;
305305
is_active: boolean;
306306
notes?: string;
307-
}>>('/api/admin/users', {
307+
}>>('/admin/users', {
308308
credentials: 'include',
309309
}),
310310
};

0 commit comments

Comments
 (0)