@@ -24,13 +24,12 @@ export async function scanForRepositories(rootPath: string): Promise<RepositoryI
2424 const isRepo = await isValidRepository ( folderPath ) ;
2525
2626 if ( isRepo ) {
27- const type = await detectProjectType ( folderPath , entry . name ) ;
2827 const hasCodeSyncer = await hasCodeSyncerSetup ( folderPath ) ;
2928
3029 repos . push ( {
3130 name : entry . name ,
3231 path : folderPath ,
33- type,
32+ type : undefined , // AI will analyze
3433 description : undefined , // AI will analyze
3534 techStack : undefined , // AI will analyze
3635 hasCodeSyncer,
@@ -83,130 +82,10 @@ async function isValidRepository(folderPath: string): Promise<boolean> {
8382 }
8483}
8584
86- /**
87- * Detect project type based on folder structure, files, and repository name
88- */
89- async function detectProjectType ( folderPath : string , repoName : string ) : Promise < 'frontend' | 'backend' | 'mobile' | 'fullstack' > {
90- try {
91- // Analyze repository name for hints
92- const nameLower = repoName . toLowerCase ( ) ;
93- const nameHints = {
94- backend : [ 'server' , 'api' , 'backend' , 'service' , 'socket' , 'gateway' , 'middleware' ] ,
95- frontend : [ 'client' , 'frontend' , 'web' , 'app' , 'ui' , 'admin' , 'dashboard' ] ,
96- mobile : [ 'mobile' , 'ios' , 'android' , 'app' ] ,
97- } ;
98-
99- // Check for Java projects (Spring Boot)
100- const hasPomXml = await fs . pathExists ( path . join ( folderPath , 'pom.xml' ) ) ;
101- const hasGradle = await fs . pathExists ( path . join ( folderPath , 'build.gradle' ) ) ;
102- if ( hasPomXml || hasGradle ) {
103- // Check if it's Android (mobile) or Spring (backend)
104- const hasAndroid = await fs . pathExists ( path . join ( folderPath , 'app' , 'src' , 'main' , 'AndroidManifest.xml' ) ) ;
105- if ( hasAndroid ) {
106- return 'mobile' ;
107- }
108- return 'backend' ; // Java Spring Boot
109- }
110-
111- // Check for Python projects (Django, FastAPI)
112- const hasRequirements = await fs . pathExists ( path . join ( folderPath , 'requirements.txt' ) ) ;
113- const hasPipfile = await fs . pathExists ( path . join ( folderPath , 'Pipfile' ) ) ;
114- if ( hasRequirements || hasPipfile ) {
115- try {
116- let content = '' ;
117- if ( hasRequirements ) {
118- content = await fs . readFile ( path . join ( folderPath , 'requirements.txt' ) , 'utf-8' ) ;
119- }
120- // Check for web frameworks
121- if ( content . includes ( 'django' ) || content . includes ( 'fastapi' ) || content . includes ( 'flask' ) ) {
122- return 'backend' ;
123- }
124- } catch {
125- // If can't read file, default to backend
126- }
127- return 'backend' ; // Python backend
128- }
129-
130- // Check for Node.js projects
131- const packageJsonPath = path . join ( folderPath , 'package.json' ) ;
132- if ( await fs . pathExists ( packageJsonPath ) ) {
133- const packageJson = await fs . readJson ( packageJsonPath ) ;
134- const deps = {
135- ...packageJson . dependencies ,
136- ...packageJson . devDependencies ,
137- } ;
138-
139- // Check for mobile
140- if ( deps [ 'react-native' ] || deps [ 'expo' ] || deps [ '@react-native' ] ) {
141- return 'mobile' ;
142- }
143-
144- // Strong hint from repo name (socket server, api server, etc.)
145- if ( nameHints . backend . some ( keyword => nameLower . includes ( keyword ) ) ) {
146- // If it has socket.io or backend keywords in name, prioritize backend
147- if ( deps [ 'socket.io' ] || deps [ 'express' ] || deps [ 'fastify' ] || deps [ '@nestjs/core' ] ) {
148- return 'backend' ;
149- }
150- }
151-
152- // Check for frontend (React, Vue, etc.)
153- if ( deps [ 'react' ] || deps [ 'vue' ] || deps [ 'angular' ] || deps [ 'svelte' ] ) {
154- // Check repo name hints
155- if ( nameHints . frontend . some ( keyword => nameLower . includes ( keyword ) ) ) {
156- return 'frontend' ;
157- }
158-
159- // Check if it's Next.js (could be fullstack)
160- if ( deps [ 'next' ] ) {
161- // If has database or backend hints in name, it's fullstack
162- if ( deps [ 'prisma' ] || deps [ 'mongoose' ] || deps [ '@prisma/client' ] ||
163- nameLower . includes ( 'fullstack' ) || nameLower . includes ( 'full-stack' ) ) {
164- return 'fullstack' ;
165- }
166- // If name suggests frontend only, return frontend
167- if ( nameHints . frontend . some ( keyword => nameLower . includes ( keyword ) ) ) {
168- return 'frontend' ;
169- }
170- // Next.js with no DB is usually frontend
171- return 'frontend' ;
172- }
173- return 'frontend' ;
174- }
175-
176- // Check for backend (Express, Fastify, NestJS, Socket.IO)
177- if ( deps [ 'express' ] || deps [ 'fastify' ] || deps [ 'koa' ] || deps [ '@nestjs/core' ] ||
178- deps [ 'socket.io' ] || deps [ 'ws' ] ) {
179- return 'backend' ;
180- }
181- }
182-
183- // Check for mobile-specific files
184- const hasPodfile = await fs . pathExists ( path . join ( folderPath , 'ios' , 'Podfile' ) ) ;
185- const hasAndroidGradle = await fs . pathExists ( path . join ( folderPath , 'android' , 'build.gradle' ) ) ;
186- if ( hasPodfile || hasAndroidGradle ) {
187- return 'mobile' ;
188- }
189-
190- // Use repo name as fallback
191- if ( nameHints . backend . some ( keyword => nameLower . includes ( keyword ) ) ) {
192- return 'backend' ;
193- }
194- if ( nameHints . frontend . some ( keyword => nameLower . includes ( keyword ) ) ) {
195- return 'frontend' ;
196- }
197- if ( nameHints . mobile . some ( keyword => nameLower . includes ( keyword ) ) ) {
198- return 'mobile' ;
199- }
200-
201- // Default to fullstack if can't determine
202- return 'fullstack' ;
203- } catch {
204- return 'fullstack' ;
205- }
206- }
207-
208- // Tech stack and description detection removed
209- // AI will analyze these accurately during setup phase
85+ // All project analysis removed - AI will analyze during setup phase
86+ // - Project type (frontend/backend/mobile/fullstack)
87+ // - Tech stack
88+ // - Description
21089
21190/**
21291 * Check if CodeSyncer is already set up in the repository
0 commit comments