You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your task is to generate a complete backend codebase within a single file for a project named "${projectName}". The code should be written using the Express framework with ES Module syntax (using \`import\` statements), and the database is ${databaseType}. The code must be written in \`${fileType}\`. The backend code should be scalable, maintainable, and adhere to best practices.
30
-
25
+
return`Role: You are an expert backend developer.
26
+
Task: Your task is to generate a complete backend codebase within a single file for a project named "${projectName}". The code should be written using the Express framework with ES Module syntax (using \`import\` statements), and the database is ${databaseType}. The code must be written in \`${fileType}\`. The backend code should be scalable, maintainable, and adhere to best practices.
// Parse dependency file if provided, otherwise use defaults
191
+
// TODO: get dependencies info from embedding model
192
+
letdependencies;
193
+
try{
194
+
dependencies=dependencyFile
195
+
? JSON.parse(dependencyFile)
196
+
: defaultDependencies;
197
+
}catch(error){
198
+
dependencies=defaultDependencies;
199
+
}
200
+
201
+
return`Role: You are an expert backend developer.
202
+
Task: Your task is to generate a complete backend codebase using Express framework, database ${databaseType}, and language Javascript. The backend code should be scalable, maintainable, and adhere to best practices.
203
+
Current File: ${currentFile}.
204
+
205
+
## Project External Dependencies
206
+
The project uses the following dependencies:
207
+
\`\`\`json
208
+
${JSON.stringify(dependencies,null,2)}
209
+
\`\`\`
210
+
211
+
212
+
213
+
### Instructions and Rules:
214
+
1. Implement Only One file: Implement only the file specified in "Current File" - do not generate code for multiple files.
215
+
2. COMPLETE CODE: Your code will be part of the entire project, so please implement complete, reliable, reusable code with no TODOs or placeholders.
216
+
3. ES Module Syntax: Use ES Module syntax (import/export) consistently throughout the code.
217
+
4. File Structure and Dependencies: The current file might depend on other files in the project use the Project Internal Dependencies to help you.
218
+
5. CAREFULLY CHECK:
219
+
- Before importing a file, verify that the file should logically exist
220
+
- Ensure that you haven't missed any internal dependencies import
221
+
6. Error Handling: Implement comprehensive error handling for database operations, API calls, and all async operations.
222
+
7. Database Specific: For ${databaseType}, ensure you're using appropriate connection methods and query formats.
223
+
8. Configuration: Use environment variables for sensitive values and configuration (use process.env)
224
+
9. RESTful Standards: When implementing controllers and routes, follow RESTful API standards.
225
+
10. Documentation: Include JSDoc comments for functions and important code sections.
226
+
11. Logging: Implement appropriate logging for errors and significant operations.
227
+
12. Schema Init: For database files, ensure proper initialization of tables and schemas if needed.
0 commit comments