openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: DevScope AI API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: analyze description: GitHub profile analysis - name: report description: Public shareable report snapshots - name: history description: Analysis history - name: analyses description: Score trend and analysis data - name: ai description: AI-powered generation endpoints paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /analyze/{username}: get: operationId: analyzeGithubUser tags: [analyze] summary: Analyze GitHub user profile description: Fetches GitHub data, scores the profile, and returns AI insights parameters: - name: username in: path required: true schema: type: string responses: "200": description: Analysis result content: application/json: schema: $ref: "#/components/schemas/AnalysisResult" "404": description: GitHub user not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "429": description: Rate limit exceeded content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /history: get: operationId: getAnalysisHistory tags: [history] summary: Get recent analysis history description: Returns the most recently analyzed profiles parameters: - name: limit in: query required: false schema: type: integer default: 10 maximum: 50 responses: "200": description: List of recent analyses content: application/json: schema: type: array items: $ref: "#/components/schemas/AnalysisSummary" /history/{username}: get: operationId: getUserAnalysisHistory tags: [history] summary: Get analysis history for a specific user description: Returns all past analyses for a given GitHub username parameters: - name: username in: path required: true schema: type: string responses: "200": description: Analysis history for user content: application/json: schema: type: array items: $ref: "#/components/schemas/AnalysisSummary" /ai/roadmap: post: operationId: postAiRoadmap tags: [ai] summary: Generate a 4-week improvement roadmap description: Calls Gemini AI to produce a personalised weekly action plan based on score data. Results are cached for 7 days; pass regenerate:true to force a fresh generation. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/WeeklyRoadmapRequest" responses: "200": description: 4-week roadmap content: application/json: schema: $ref: "#/components/schemas/WeeklyRoadmap" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /analyses/trend/{username}: get: operationId: getScoreTrend tags: [analyses] summary: Get score trend for a GitHub user description: Returns all historical scores for a username sorted chronologically (oldest first) parameters: - name: username in: path required: true schema: type: string responses: "200": description: Score trend data points content: application/json: schema: type: array items: $ref: "#/components/schemas/ScoreTrendPoint" "400": description: Invalid username content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /roadmap/{username}: get: operationId: getAiRoadmap tags: [analyze] summary: Get AI improvement roadmap for a GitHub user description: Generates a personalized, structured improvement roadmap using Gemini AI based on the user's latest analysis parameters: - name: username in: path required: true schema: type: string responses: "200": description: AI-generated improvement roadmap content: application/json: schema: $ref: "#/components/schemas/Roadmap" "404": description: No analysis found for this user content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /compare: get: operationId: compareGithubProfiles tags: [analyze] summary: Compare two GitHub profiles side-by-side description: Analyzes two GitHub profiles in parallel, scores each, generates AI insights, and returns a structured comparison with an AI-generated hiring verdict. parameters: - name: user1 in: query required: true schema: type: string description: First GitHub username - name: user2 in: query required: true schema: type: string description: Second GitHub username responses: "200": description: Side-by-side comparison result content: application/json: schema: $ref: "#/components/schemas/CompareResult" "400": description: Missing or invalid parameters content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: One or both GitHub users not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "429": description: GitHub API rate limit exceeded content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /report/{username}: get: operationId: getReportByUsername tags: [report] summary: Get latest public report for a GitHub user description: Returns the most recently saved analysis snapshot from the database. No GitHub API call is made — pure DB read. parameters: - name: username in: path required: true schema: type: string responses: "200": description: Latest analysis snapshot content: application/json: schema: $ref: "#/components/schemas/AnalysisResult" "404": description: No report found for this user content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /report/view/{id}: get: operationId: getReportById tags: [report] summary: Get a specific analysis snapshot by ID description: Returns an exact saved analysis snapshot by its numeric ID. Permanent link — the data never changes. parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Analysis snapshot content: application/json: schema: $ref: "#/components/schemas/AnalysisResult" "400": description: Invalid ID content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "404": description: Report not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Internal server error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /stats: get: operationId: getPlatformStats tags: [history] summary: Get platform-wide statistics description: Returns aggregate stats about all analyses performed responses: "200": description: Platform statistics content: application/json: schema: $ref: "#/components/schemas/PlatformStats" components: schemas: HealthStatus: type: object properties: status: type: string required: - status ErrorResponse: type: object properties: error: type: string message: type: string required: - error - message GithubProfile: type: object properties: login: type: string name: type: string nullable: true avatar_url: type: string bio: type: string nullable: true location: type: string nullable: true public_repos: type: integer followers: type: integer following: type: integer created_at: type: string html_url: type: string required: - login - avatar_url - public_repos - followers - following - created_at - html_url LanguageDistribution: type: object additionalProperties: type: number description: Language name to percentage mapping ScoreBreakdown: type: object properties: repoQuality: type: number description: Score for repository quality (0-30) activityConsistency: type: number description: Score for activity consistency (0-25) techDiversity: type: number description: Score for technology diversity (0-20) popularity: type: number description: Score for popularity via stars/forks (0-15) completeness: type: number description: Score for profile completeness (0-10) total: type: number description: Total score (0-100) required: - repoQuality - activityConsistency - techDiversity - popularity - completeness - total AiInsights: type: object properties: strengths: type: array items: type: string weaknesses: type: array items: type: string suggestions: type: array items: type: string hiringRecommendation: type: string enum: [strong_hire, hire, consider, pass] summary: type: string required: - strengths - weaknesses - suggestions - hiringRecommendation - summary RepoStats: type: object properties: totalRepos: type: integer totalStars: type: integer totalForks: type: integer avgStarsPerRepo: type: number reposWithReadme: type: integer reposWithDescription: type: integer mostStarredRepo: type: string nullable: true topLanguages: type: array items: type: string required: - totalRepos - totalStars - totalForks - avgStarsPerRepo - reposWithReadme - reposWithDescription - topLanguages AnalysisResult: type: object properties: id: type: integer username: type: string profile: $ref: "#/components/schemas/GithubProfile" repoStats: $ref: "#/components/schemas/RepoStats" languageDistribution: $ref: "#/components/schemas/LanguageDistribution" scoreBreakdown: $ref: "#/components/schemas/ScoreBreakdown" aiInsights: $ref: "#/components/schemas/AiInsights" analyzedAt: type: string cached: type: boolean required: - username - profile - repoStats - languageDistribution - scoreBreakdown - aiInsights - analyzedAt - cached AnalysisSummary: type: object properties: id: type: integer username: type: string score: type: number hiringRecommendation: type: string avatarUrl: type: string nullable: true analyzedAt: type: string topLanguages: type: array items: type: string required: - id - username - score - hiringRecommendation - analyzedAt - topLanguages WeeklyRoadmapRequest: type: object properties: username: type: string score: type: number breakdown: type: object additionalProperties: type: number weaknesses: type: array items: type: string strengths: type: array items: type: string targetRole: type: string languages: type: array items: type: string topRepos: type: array items: type: string regenerate: type: boolean description: Force regeneration even if a cached roadmap exists required: - username - score WeeklyRoadmap: type: object properties: username: type: string score: type: number targetRole: type: string modelUsed: type: string week1: type: array items: type: string week2: type: array items: type: string week3: type: array items: type: string week4: type: array items: type: string generatedAt: type: string cached: type: boolean required: - username - score - week1 - week2 - week3 - week4 - generatedAt - cached ScoreTrendPoint: type: object properties: date: type: string description: ISO date string (YYYY-MM-DD) score: type: number description: Score value at that date (0-100) required: - date - score RoadmapAction: type: object properties: text: type: string priority: type: string enum: [high, medium, low] category: type: string required: - text - priority - category RoadmapPhase: type: object properties: label: type: string timeframe: type: string actions: type: array items: $ref: "#/components/schemas/RoadmapAction" required: - label - timeframe - actions Roadmap: type: object properties: username: type: string score: type: number immediate: $ref: "#/components/schemas/RoadmapPhase" shortTerm: $ref: "#/components/schemas/RoadmapPhase" midTerm: $ref: "#/components/schemas/RoadmapPhase" longTerm: $ref: "#/components/schemas/RoadmapPhase" generatedAt: type: string required: - username - score - immediate - shortTerm - midTerm - longTerm - generatedAt CategoryWinners: type: object properties: repoQuality: type: string enum: [user1, user2, tie] activityConsistency: type: string enum: [user1, user2, tie] techDiversity: type: string enum: [user1, user2, tie] popularity: type: string enum: [user1, user2, tie] completeness: type: string enum: [user1, user2, tie] required: - repoQuality - activityConsistency - techDiversity - popularity - completeness ComparisonSummary: type: object properties: winner: type: string enum: [user1, user2, tie] winnerUsername: type: string reason: type: string description: AI-generated or deterministic hiring verdict scoreDiff: type: number description: Absolute difference between the two scores categoryWinners: $ref: "#/components/schemas/CategoryWinners" required: - winner - winnerUsername - reason - scoreDiff - categoryWinners CompareResult: type: object properties: user1: $ref: "#/components/schemas/AnalysisResult" user2: $ref: "#/components/schemas/AnalysisResult" comparison: $ref: "#/components/schemas/ComparisonSummary" required: - user1 - user2 - comparison PlatformStats: type: object properties: totalAnalyses: type: integer uniqueUsers: type: integer avgScore: type: number topLanguages: type: array items: type: string hiringBreakdown: type: object properties: strong_hire: type: integer hire: type: integer consider: type: integer pass: type: integer required: - strong_hire - hire - consider - pass required: - totalAnalyses - uniqueUsers - avgScore - topLanguages - hiringBreakdown