-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.js
More file actions
33 lines (27 loc) · 1.22 KB
/
setup.js
File metadata and controls
33 lines (27 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fs = require('fs');
const path = require('path');
// Create .env file if it doesn't exist
const envPath = path.join(__dirname, '.env');
const envExample = `# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/student_feedback
# JWT Secret for authentication (generate a secure random string)
JWT_SECRET=your_jwt_secret_key_here
# OpenAI API Key for AI features (get from https://platform.openai.com/)
OPENAI_API_KEY=your_openai_api_key_here
# Server Port
PORT=5000`;
if (!fs.existsSync(envPath)) {
fs.writeFileSync(envPath, envExample);
console.log('✅ Created .env file with default configuration');
console.log('⚠️ Please update the .env file with your actual API keys and configuration');
} else {
console.log('✅ .env file already exists');
}
console.log('\n🚀 Setup complete! Next steps:');
console.log('1. Update .env file with your MongoDB URI and OpenAI API key');
console.log('2. Install backend dependencies: npm install');
console.log('3. Install frontend dependencies: cd client && npm install');
console.log('4. Start MongoDB service');
console.log('5. Start backend: npm run dev');
console.log('6. Start frontend: cd client && npm start');
console.log('\n📖 See README.md for detailed instructions');