This document provides security guidelines for deploying Automata-Verse to production environments. Following these best practices will help prevent exposure of source code, problem solutions, and other sensitive information.
When deployed in development mode, modern web applications typically include source maps that allow browsers to map minified code back to the original source. This is helpful for debugging but can expose your source code to users.
Always use the secure production build when deploying to a publicly accessible server:
# Run the secure production build
npm run build:secure
# Or with yarn
yarn build:secureThis will:
- Disable browser source maps
- Enable code minification and obfuscation
- Remove console logs and debug information
- Add security headers to prevent various attacks
After deploying, verify that source code is not accessible:
- Visit your deployed site
- Open browser developer tools (F12 or Right-click → Inspect)
- Go to the Sources tab
- Confirm that original source files are not visible and only minified files appear
-
Regular Updates: Keep Next.js and all dependencies updated to patch security vulnerabilities.
-
Environment Variables: Never expose API keys or sensitive values in client-side code. Use server-side environment variables.
-
Content Security Policy: Consider implementing a strict Content Security Policy.
-
Rate Limiting: Implement rate limiting on API routes to prevent abuse.
-
Input Validation: Always validate user inputs server-side before processing them.
For educational applications like Automata-Verse, protecting problem solutions is important:
- Don't expose complete test cases in the client code
- Consider implementing an API that only returns test results, not the test cases themselves
- Use server-side validation for checking solutions when possible
If you discover any security vulnerabilities in Automata-Verse, please report them responsibly.