-
.env.local- IGNORED β (Never committed to Git) -
.env- IGNORED β -
.env*.local- IGNORED β - All environment files in
.gitignoreβ
Public (Safe to expose to browser):
- β
NEXT_PUBLIC_SUPABASE_URL- Safe (public URL) - β
NEXT_PUBLIC_SUPABASE_ANON_KEY- Safe (anon key with RLS) - β
NEXT_PUBLIC_SITE_URL- Safe (public URL)
Private (Server-side only):
- β
DATABASE_URL- PROTECTED (not prefixed with NEXTPUBLIC) - β
OPENROUTER_API_KEY- PROTECTED (server-side only) - β
MIDTRANS_SERVER_KEY- PROTECTED (server-side only)
- RLS enabled on all tables β
- Users can only access their own data β
- Public content properly filtered β
- Policies tested and verified β
-
prompts- User-specific access only -
templates- Published templates public, drafts private -
purchases- User-specific access only -
favorites- User-specific access only -
reviews- Public read, user-specific write -
profiles- Public read, user-specific write
- No hardcoded API keys β
- No hardcoded passwords β
- No console.log with sensitive data β
- No commented-out credentials β
-
.env.localnot in repository β -
node_modules/ignored β -
.next/build files ignored β - Database files ignored β
- IDE files ignored β
- Email verification enabled
- Password requirements enforced
- Session management secure
- OAuth properly configured
- CSRF protection (built-in Supabase)
- No passwords stored in code
- Secure session storage (localStorage)
- Auto-refresh tokens
- Proper sign-out flow
- Server-side API keys not exposed
- Input validation on all endpoints
- Error messages don't leak sensitive info
- Rate limiting considerations documented
- No sensitive operations in client code
- All database operations through Supabase RLS
- No direct database queries from client
- No debug console.logs β
- Error handling implemented β
- Loading states for all async operations β
- Proper error messages (user-friendly) β
- All dependencies up to date
- No known vulnerabilities
- Only necessary packages installed
- Environment variables set in Vercel
- OAuth redirect URLs updated for production
- Supabase RLS policies verified
- HTTPS enforced in production
- CORS properly configured
- Rate limiting enabled (if applicable)
- Test authentication flow
- Test database operations
- Monitor error logs
- Check for exposed secrets
- Verify RLS policies working
- β
README.md- Documentation only - β
package.json- No secrets - β
next.config.js- No secrets - β
tailwind.config.js- No secrets - β
.env.example- Template only (no real values) - β
All
.mdfiles - Documentation only - β All source code files - No hardcoded secrets
- π«
.env.local- CONTAINS SECRETS - π«
.env- CONTAINS SECRETS - π«
node_modules/- Dependencies - π«
.next/- Build artifacts - π« Any file with real API keys
# No hardcoded secrets found β
# No console.log with sensitive data β
# All environment variables properly prefixed β
# .gitignore comprehensive β- All API calls reviewed
- All database queries reviewed
- All authentication flows reviewed
- All environment variables reviewed
- β Use environment variables for all secrets
- β Enable RLS on all Supabase tables
- β Implement proper authentication
- β Validate all user inputs
- β Use HTTPS in production
- β Comprehensive .gitignore
- Add rate limiting on API routes
- Implement CAPTCHA on sign-up
- Add 2FA (Two-Factor Authentication)
- Set up security monitoring
- Regular security audits
- Implement CSP (Content Security Policy)
- Add API request logging
- Set up automated vulnerability scanning
// β WRONG - Hardcoded API key
const apiKey = "sk-1234567890abcdef";
// β WRONG - Exposing server key to client
const NEXT_PUBLIC_SERVER_KEY = "secret-key";
// β WRONG - Console logging sensitive data
console.log("User password:", password);// β
CORRECT - Use environment variables
const apiKey = process.env.OPENROUTER_API_KEY;
// β
CORRECT - Server-side only (no NEXT_PUBLIC_)
const serverKey = process.env.SERVER_KEY;
// β
CORRECT - Don't log sensitive data
console.log("Authentication successful");If you discover a security issue:
- DO NOT commit the fix publicly
- DO NOT discuss in public issues
- DO contact: security@promptcraft.app
- DO provide detailed information
- DO wait for response before disclosure
Overall Security Rating: π’ EXCELLENT
- β No secrets exposed
- β All sensitive files ignored
- β RLS properly configured
- β Authentication secure
- β Code clean and production-ready
- β Best practices followed
Status: SAFE TO DEPLOY π
- Date: 25 November 2025
- Auditor: Development Team
- Status: β PASSED
- Next Audit: Before next major release
π Security is not a feature, it's a requirement
This checklist should be reviewed before every deployment