Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/** @type {import('next').NextConfig} */
const path = require('path');
const { i18n } = require('./next-i18next.config');
// @ts-check
import path from 'path';
import { fileURLToPath } from 'url';
import { z } from 'zod';
import nextI18nConfig from './next-i18next.config.js';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';

const i18n = nextI18nConfig.i18n;

// `__dirname` is not defined in ESM scope; reconstruct it from the module URL.
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Validate environment variables at build time.
// This ensures missing/invalid vars are caught early with a clear error message.
const { z } = require('zod');

const envSchema = z.object({
NEXT_PUBLIC_STELLAR_RECEIVER_ADDRESS: z
.string()
Expand All @@ -28,17 +35,10 @@ if (!parsed.success) {
throw new Error(`❌ Invalid environment variables:\n${errors}\n\nSee .env.example for reference.`);
}

/** @type {import('next').NextConfig} */
const nextConfig = {
// Enable standalone output for Docker container builds
output: 'standalone',
typescript: {
// Ignore TS build errors — pre-existing type issues across the codebase
ignoreBuildErrors: true,
},
eslint: {
// Ignore ESLint errors during build — pre-existing issues across the codebase
ignoreDuringBuilds: true,
},
transpilePackages: ['three', '@react-three/fiber', '@react-three/drei'],
env: {
NEXT_PUBLIC_STELLAR_RECEIVER_ADDRESS: process.env.NEXT_PUBLIC_STELLAR_RECEIVER_ADDRESS,
Expand All @@ -53,27 +53,27 @@ const nextConfig = {
];
},
// Performance monitoring configuration
webpack: (config, { isServer }) => {
webpack: (config, _env) => {
// Enable bundle analysis in production
if (process.env.ANALYZE === 'true') {
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
})
}),
);
}

// Performance optimizations
// Stub native-only modules and broken packages that can't run in browser/build
config.resolve.alias = {
...config.resolve.alias,
brainflow: false,
'@creit.tech/stellar-wallets-kit': path.resolve(__dirname, 'src/stubs/stellar-wallets-kit.ts'),
'@creit.tech/stellar-wallets-kit': path.resolve(
__dirname,
'src/stubs/stellar-wallets-kit.ts',
),
};


config.optimization.splitChunks = {
chunks: 'all',
cacheGroups: {
Expand Down Expand Up @@ -125,4 +125,4 @@ const nextConfig = {
},
};

module.exports = nextConfig;
export default nextConfig;
2 changes: 1 addition & 1 deletion frontend/src/app/collaboration/[roomId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useEffect, useState } from 'react';
import { useParams, useRouter } from 'next/navigation';
import CollaborationRoom from '@/components/collaboration/CollaborationRoom';
import CollaborationRoom from '@/components/Collaboration/CollaborationRoom';
import toast from 'react-hot-toast';

const CollaborationRoomPage = () => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/ARVR/InteractiveSimulation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import { useState, useEffect, useRef, useCallback } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { Play, Pause, RotateCw, Settings, Flask, Atom, Beaker, Zap, Activity, Clock, Award, BookOpen, Lightbulb, Target } from 'lucide-react';
import { Play, Pause, RotateCw, Settings, Atom, Beaker, Zap, Activity, Clock, Award, BookOpen, Lightbulb, Target } from 'lucide-react';
import { Flask } from '@/utils/missingIcons';

export type SimulationType = 'physics' | 'chemistry' | 'biology' | 'mathematics' | 'engineering' | 'astronomy';
export type ExperimentState = 'idle' | 'running' | 'paused' | 'completed' | 'error';
Expand Down
Loading