Unraid deployment fixes and generator improvements

- Add Next.js rewrites to proxy API calls through same origin (fixes login/media on werkout.treytartt.com)
- Fix mediaUrl() in DayCard and ExerciseRow to use relative paths in production
- Add proxyTimeout for long-running workout generation endpoints
- Add CSRF trusted origin for treytartt.com
- Split docker-compose into production (Unraid) and dev configs
- Show display_name and descriptions on workout type cards
- Generator: rules engine improvements, movement enforcement, exercise selector updates
- Add new test files for rules drift, workout research generation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-23 10:25:45 -06:00
parent 1c61b80731
commit 03681c532d
21 changed files with 2366 additions and 138 deletions

View File

@@ -1,6 +1,10 @@
/** @type {import('next').NextConfig} */
// v2
const nextConfig = {
skipTrailingSlashRedirect: true,
experimental: {
proxyTimeout: 120000, // 2 minutes for long-running workout generation
},
images: {
remotePatterns: [
{
@@ -16,12 +20,24 @@ const nextConfig = {
],
},
async rewrites() {
return [
{
source: "/media/:path*",
destination: "http://localhost:8000/media/:path*",
},
const djangoUrl = process.env.DJANGO_INTERNAL_URL || "http://localhost:8000";
// Helper: for each Django prefix, create two rewrites:
// 1. with trailing slash preserved
// 2. without trailing slash → add it (Django requires trailing slashes)
const djangoPrefixes = [
"media", "registered_user", "exercise", "muscle",
"equipment", "workout", "generator", "videos", "admin",
];
return djangoPrefixes.flatMap((prefix) => [
{
source: `/${prefix}/:path*/`,
destination: `${djangoUrl}/${prefix}/:path*/`,
},
{
source: `/${prefix}/:path*`,
destination: `${djangoUrl}/${prefix}/:path*/`,
},
]);
},
};