feat: Add seed script with demo authentication and environment-based …#758
Open
shubh-gitpush wants to merge 1 commit into
Open
feat: Add seed script with demo authentication and environment-based …#758shubh-gitpush wants to merge 1 commit into
shubh-gitpush wants to merge 1 commit into
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
Implemented a comprehensive seeding and demo authentication system for DailyForge with database-optional test mode. This enables developers and new contributors to quickly set up the project and test features without requiring external database configuration. Also includes security hardening for production deployments.
🔗 Related Issue
Closes #201
🛠 Changes Made
Backend Changes
Seed Script (
backend/scripts/seed.js)MONGO_URIand enters test mode automaticallyAuthentication System (
backend/controllers/authController.js)demo@dailyforge.dev/DemoPassword123!NODE_ENV=developmentTask Controller (
backend/controllers/taskController.js)Routine Controller (
backend/controllers/routineController.js)Database Configuration (
backend/config/db.js)MONGO_URIis emptyServer Configuration (
backend/src/server.js)Environment Files
.env- Local development config withNODE_ENV=development.env.example- Documentation for all environment variablesPackage.json
npm run seedscript for database seedingFrontend Changes
Axios Configuration (
frontend/src/api/axios.js)http://localhost:5000/api/VITE_API_URLenv var or defaults to deployed backendEnvironment Files
.env- Optional production API URL override.env.example- Configuration documentationDocumentation Updates
README.md
CONTRIBUTING.md
CI/CD & Automation
Pull Request Template (
.github/pull_request_template.md)CI Pipeline (
.github/workflows/ci.yml)Bug Fixes
sensorsdeclaration in RoutineBuilder.jsx🔐 Security Highlights
✅ Demo credentials only work in development mode (
NODE_ENV=development)✅ Production deployments have
NODE_ENV=production- demo login is rejected✅ CORS configured for both local dev and production URLs
✅ Password hashing with bcrypt maintained
✅ JWT token expiration set to 24 hours
✅ Testing & Validation
npm run seed: Runs without database🚀 How to Test
npm install(both frontend and backend)npm run seed(in backend directory)npm run dev(in backend directory)npm run dev(in frontend directory)demo@dailyforge.dev/DemoPassword123!📝 Notes
📸 Screenshots (if applicable)
Add screenshots or GIFs to explain UI changes.
✅ Checklist
🚀 Notes for Reviewers
Anything specific you want reviewed.