feat: Add seed script with demo authentication and environment-based …#758
feat: Add seed script with demo authentication and environment-based …#758shubh-gitpush wants to merge 4 commits into
Conversation
|
@aryandas2911 Could you please review this? It may cause merge conflicts if additional PRs get merged meanwhile. |
There was a problem hiding this comment.
pls use the updated task categories
There was a problem hiding this comment.
pls use the existing URLs and dont add extra URLS
There was a problem hiding this comment.
pls use the existing URLs and no extra URLs
d40aae5 to
270e5e6
Compare
|
@aryandas2911 please check once more there are dfferent links for development and production.Feel feel to suggest any changes. |
|
for development we are using app.use( and const api = axios.create({ kindly keep it like that only and update the tasks categories with the updated task categories in the seed.js |
7d2acf2 to
0d22ef4
Compare
|
@aryandas2911 made the changes kindly check |
|
@aryandas2911 Could you please review this? It may cause merge conflicts if additional PRs get merged meanwhile. |
|
@aryandas2911 are there any updates required from my side,if yes feel free to tell. |
|
@aryandas2911 could you please provide some feedback as it has been 4 days since i have opened a pr. |
|
@aryandas2911 any update on this pr? |
…to fix-seed-demo
ffa0e40 to
e3e3a5f
Compare
📌 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.