Add local development environment with switchable backend
All checks were successful
ci/woodpecker/push/deploy Pipeline was successful

Set up local dev workflow: SSH tunnel to dev DB, Next.js API proxy
via rewrites, Docker or native backend on port 5000. Update and
restructure project documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 01:02:56 +02:00
parent 2dadc5362d
commit a30fe60414
13 changed files with 216 additions and 352 deletions

View File

@@ -1,2 +1,5 @@
# URL бэкенда для server-side запросов (внутри Docker network)
INTERNAL_API_URL=http://gb-prod-backend:5000
# URL бэкенда для проксирования /api/* в локальной разработке (не задавать на сервере!)
# LOCAL_API_URL=http://localhost:5000

View File

@@ -2,6 +2,16 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
async rewrites() {
const apiUrl = process.env.LOCAL_API_URL;
if (!apiUrl) return [];
return [
{
source: "/api/:path*",
destination: `${apiUrl}/api/:path*`,
},
];
},
};
export default nextConfig;