Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ class MiraServer extends AppServer {
private setupRoutes(): void {
const app = this.getExpressApp();

// Serve static files from the public directory (for both dev and production)
const publicPath = path.join(__dirname, '../public');
app.use(express.static(publicPath));
Comment on lines +99 to +101
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, check the actual code in src/server/index.ts around lines 99-101
head -120 src/server/index.ts | tail -30

Repository: Mentra-Community/Mentra-AI

Length of output: 1058


🏁 Script executed:

# Check repository structure to understand the project layout
ls -la | head -20
fd -t f -a 'package.json|tsconfig|webpack|vite' . --max-depth 2

Repository: Mentra-Community/Mentra-AI

Length of output: 1386


🏁 Script executed:

# Look for build, deploy, and asset-related configurations
find . -maxdepth 2 -type f \( -name "Dockerfile*" -o -name "*.yml" -o -name "*.yaml" -o -name "*.sh" \)
cat package.json 2>/dev/null | head -50

Repository: Mentra-Community/Mentra-AI

Length of output: 2788


🏁 Script executed:

# Check if there's a public directory and any build output configurations
fd -t d 'public|dist|build' . --max-depth 1

Repository: Mentra-Community/Mentra-AI

Length of output: 52


🏁 Script executed:

# Check vite.config.ts for public directory configuration
cat vite.config.ts

Repository: Mentra-Community/Mentra-AI

Length of output: 1282


🏁 Script executed:

# Check if public directory exists in the repository
ls -la public/ 2>/dev/null || echo "public directory not found"

Repository: Mentra-Community/Mentra-AI

Length of output: 96


🏁 Script executed:

# Check the main Dockerfile to see the complete build and deployment process
cat Dockerfile

Repository: Mentra-Community/Mentra-AI

Length of output: 527


🏁 Script executed:

# Also check docker/Dockerfile for production image
cat docker/Dockerfile

Repository: Mentra-Community/Mentra-AI

Length of output: 398


🏁 Script executed:

# Check git history to see if public directory ever existed
git log --oneline --all --full-history -- 'public/' | head -10

Repository: Mentra-Community/Mentra-AI

Length of output: 52


🏁 Script executed:

# Check if there are any references to assets or public in documentation
grep -r "public\|assets\|mp3" . --include="*.md" --include="*.txt" 2>/dev/null | head -20

Repository: Mentra-Community/Mentra-AI

Length of output: 1088


The public/ directory is missing from the repository; audio files referenced in code and documentation do not exist.

The code references const publicPath = path.join(__dirname, '../public') to serve static audio files (start.mp3, popping.mp3 per docs/setup.md), but the public/ directory does not exist in the repository. In production, this will cause attempts to serve these assets to fail with 404 errors. Create the public/ directory and ensure the required audio files are committed or generated during the build process.

Additionally, rename publicPath to PUBLIC_PATH to follow the UPPER_CASE constant naming convention per coding guidelines.

🤖 Prompt for AI Agents
In `@src/server/index.ts` around lines 99 - 101, The repository lacks the public/
static folder referenced by const publicPath = path.join(__dirname, '../public')
used with app.use(express.static(publicPath)), so create and commit a public
directory containing the expected audio assets (e.g., start.mp3, popping.mp3) or
add a build-step that generates/copies them into public/; also rename the
variable publicPath to PUBLIC_PATH and update its usage (path.join(...) and the
express.static(...) call) to follow the UPPER_CASE constant naming convention.


// Serve static files from the built frontend (in production)
if (process.env.NODE_ENV === 'production') {
const staticPath = path.join(__dirname, '../../dist/frontend');
Expand Down