This document outlines security best practices for the DreamBeesArt application, particularly around credential management and secret protection.
.env: Template file with placeholder values (committed to version control).env.local: Local configuration with actual credentials (NOT committed, gitignored)- Other
.env.*.local: Branch/environment-specific configurations (gitignored)
The application uses SQLite for persistence and HTTP-only cookies for session state. Keep server-only secrets in .env.local or your deployment secret manager:
SESSION_SECRET=replace_with_a_long_random_secret
SQLITE_DATABASE_PATH=DreamBees.db.env- Template with placeholder values- Source code without hardcoded secrets
- Configuration files (
.gitignore,tsconfig.json, etc.) - Documentation (this
SECURITY.mdfile)
.env.local- Actual deployment secrets- SQLite database files containing production/customer data
- API secrets, tokens, or passwords
*.localfiles.envfiles (unless they only contain placeholders)
The .gitignore file includes the following patterns to prevent credential leaks:
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
*.local
-
Copy the template:
cp .env .env.local
-
Edit
.env.localwith your actual deployment secrets -
Verify the file is not committed using
git status -
The application will load credentials from
.env.localautomatically
- Configure your hosting provider with
SESSION_SECRETand database path/storage - Keep SQLite database files on persistent, private storage
- Serve the app over HTTPS so secure cookies can be used in production
-
.envfile uses placeholder values (committed) - Real credentials stored in
.env.local(gitignored) - No hardcoded secrets in source code
-
.gitignoreproperly configured - Security documentation created
- Team members informed of security practices
❌ Don't:
- Commit
.env.localor any file with real credentials - Hardcode secrets in plain text files
- Push sensitive data to public repositories
✅ Do:
- Use
.envfor templates and.env.localfor actual credentials - Review git history before committing sensitive changes
- Rotate credentials if they are exposed
- Keep authentication and database access server-side through Next API routes
If you believe credentials have been exposed:
- Immediately rotate affected secrets
- Update your
.env.localfile - Rotate any affected tokens if applicable
- Review git history for any committed secrets