diff --git a/.env b/.env index 0ce64b6..ad2311a 100644 --- a/.env +++ b/.env @@ -9,4 +9,4 @@ SERVER_PORT=8080 SERVER_HOST=localhost CV_AI_MODEL=your_ai_model -OPENROUTER_API_KEY=your_openrouter_api_key \ No newline at end of file +OPENROUTER_API_KEY=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 \ No newline at end of file diff --git a/Makefile b/Makefile index f134f2c..cda852d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ SCRAPER_LINKEDIN_DIR=./services/scraper-linkedin SCRAPER_GLASSDOOR_DIR=./services/scraper-glassdoor CRON_ANALYZER_DIR=./apps/cron-analyzer CV_ANALYZER_DIR=./apps/cv-analyzer -DOCS_DIR=./internal/swagger +DOCS_DIR=./services/api/pkg/swagger BIN_DIR=./bin API_MAIN_FILE=$(API_DIR)/cmd/server/main.go SCRAPER_LINKEDIN_MAIN_FILE=$(SCRAPER_LINKEDIN_DIR)/main.go diff --git a/go.work b/go.work index 4b187ab..295a216 100644 --- a/go.work +++ b/go.work @@ -8,7 +8,6 @@ use ( ./internal/pkg/infrastructure ./internal/pkg/openrouter ./internal/pkg/utils - ./internal/swagger ./libs/ports ./libs/repo ./libs/server diff --git a/services/api/.env b/services/api/.env new file mode 100644 index 0000000..ad2311a --- /dev/null +++ b/services/api/.env @@ -0,0 +1,12 @@ +DB_HOST=localhost +DB_PORT=5432 +DB_USER=your_db_user +DB_PASSWORD=your_db_password +DB_NAME=linkedin_jobs +DB_SSLMODE=disable + +SERVER_PORT=8080 +SERVER_HOST=localhost + +CV_AI_MODEL=your_ai_model +OPENROUTER_API_KEY=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 \ No newline at end of file diff --git a/services/api/pkg/swagger/docs.go b/services/api/pkg/swagger/docs.go index a4149f0..1a64398 100644 --- a/services/api/pkg/swagger/docs.go +++ b/services/api/pkg/swagger/docs.go @@ -1,5 +1,5 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT -package docs +// Package swagger Code generated by swaggo/swag. DO NOT EDIT +package swagger import "github.com/swaggo/swag" @@ -69,9 +69,183 @@ const docTemplate = `{ } } } + }, + "/jobs/analysis": { + "get": { + "description": "Retrieves all job analysis results from the database", + "produces": [ + "application/json" + ], + "tags": [ + "jobs" + ], + "summary": "Get all job analysis results", + "responses": { + "200": { + "description": "List of job analysis results", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.JobAnalysisResult" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + }, + "/jobs/analysis/top-matches": { + "get": { + "description": "Retrieves jobs with high analysis match scores", + "produces": [ + "application/json" + ], + "tags": [ + "jobs" + ], + "summary": "Get top matching jobs", + "parameters": [ + { + "type": "integer", + "description": "Minimum match score (default: 70)", + "name": "min_score", + "in": "query" + } + ], + "responses": { + "200": { + "description": "List of top matching job analysis results", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.JobAnalysisResult" + } + } + }, + "400": { + "description": "Invalid minimum score", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + }, + "/jobs/{id}/analysis": { + "get": { + "description": "Retrieves the analysis result for a specific job", + "produces": [ + "application/json" + ], + "tags": [ + "jobs" + ], + "summary": "Get job analysis result by job ID", + "parameters": [ + { + "type": "integer", + "description": "Job ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Job analysis result", + "schema": { + "$ref": "#/definitions/domain.JobAnalysisResult" + } + }, + "400": { + "description": "Invalid job ID", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "Analysis result not found", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } } }, "definitions": { + "domain.JobAnalysisResult": { + "type": "object", + "properties": { + "analysisResult": { + "type": "string" + }, + "analyzedAt": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "jobID": { + "type": "integer", + "format": "int64" + }, + "keySkills": { + "type": "array", + "items": { + "type": "string" + } + }, + "matchScore": { + "type": "integer" + }, + "missingSkills": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommendations": { + "type": "string" + } + } + }, "domain.JobProvider": { "type": "integer", "enum": [ diff --git a/services/api/pkg/swagger/swagger.json b/services/api/pkg/swagger/swagger.json index 934c847..c6c28fd 100644 --- a/services/api/pkg/swagger/swagger.json +++ b/services/api/pkg/swagger/swagger.json @@ -62,9 +62,183 @@ } } } + }, + "/jobs/analysis": { + "get": { + "description": "Retrieves all job analysis results from the database", + "produces": [ + "application/json" + ], + "tags": [ + "jobs" + ], + "summary": "Get all job analysis results", + "responses": { + "200": { + "description": "List of job analysis results", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.JobAnalysisResult" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + }, + "/jobs/analysis/top-matches": { + "get": { + "description": "Retrieves jobs with high analysis match scores", + "produces": [ + "application/json" + ], + "tags": [ + "jobs" + ], + "summary": "Get top matching jobs", + "parameters": [ + { + "type": "integer", + "description": "Minimum match score (default: 70)", + "name": "min_score", + "in": "query" + } + ], + "responses": { + "200": { + "description": "List of top matching job analysis results", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/domain.JobAnalysisResult" + } + } + }, + "400": { + "description": "Invalid minimum score", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + }, + "/jobs/{id}/analysis": { + "get": { + "description": "Retrieves the analysis result for a specific job", + "produces": [ + "application/json" + ], + "tags": [ + "jobs" + ], + "summary": "Get job analysis result by job ID", + "parameters": [ + { + "type": "integer", + "description": "Job ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Job analysis result", + "schema": { + "$ref": "#/definitions/domain.JobAnalysisResult" + } + }, + "400": { + "description": "Invalid job ID", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "404": { + "description": "Analysis result not found", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "500": { + "description": "Internal server error", + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } } }, "definitions": { + "domain.JobAnalysisResult": { + "type": "object", + "properties": { + "analysisResult": { + "type": "string" + }, + "analyzedAt": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "jobID": { + "type": "integer", + "format": "int64" + }, + "keySkills": { + "type": "array", + "items": { + "type": "string" + } + }, + "matchScore": { + "type": "integer" + }, + "missingSkills": { + "type": "array", + "items": { + "type": "string" + } + }, + "recommendations": { + "type": "string" + } + } + }, "domain.JobProvider": { "type": "integer", "enum": [ diff --git a/services/api/pkg/swagger/swagger.yaml b/services/api/pkg/swagger/swagger.yaml index 34d8a9e..7040064 100644 --- a/services/api/pkg/swagger/swagger.yaml +++ b/services/api/pkg/swagger/swagger.yaml @@ -1,5 +1,30 @@ basePath: / definitions: + domain.JobAnalysisResult: + properties: + analysisResult: + type: string + analyzedAt: + type: string + id: + format: int64 + type: integer + jobID: + format: int64 + type: integer + keySkills: + items: + type: string + type: array + matchScore: + type: integer + missingSkills: + items: + type: string + type: array + recommendations: + type: string + type: object domain.JobProvider: enum: - 0 @@ -71,4 +96,94 @@ paths: summary: Create a new job tags: - jobs + /jobs/{id}/analysis: + get: + description: Retrieves the analysis result for a specific job + parameters: + - description: Job ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: Job analysis result + schema: + $ref: '#/definitions/domain.JobAnalysisResult' + "400": + description: Invalid job ID + schema: + additionalProperties: + type: string + type: object + "404": + description: Analysis result not found + schema: + additionalProperties: + type: string + type: object + "500": + description: Internal server error + schema: + additionalProperties: + type: string + type: object + summary: Get job analysis result by job ID + tags: + - jobs + /jobs/analysis: + get: + description: Retrieves all job analysis results from the database + produces: + - application/json + responses: + "200": + description: List of job analysis results + schema: + items: + $ref: '#/definitions/domain.JobAnalysisResult' + type: array + "500": + description: Internal server error + schema: + additionalProperties: + type: string + type: object + summary: Get all job analysis results + tags: + - jobs + /jobs/analysis/top-matches: + get: + description: Retrieves jobs with high analysis match scores + parameters: + - description: 'Minimum match score (default: 70)' + in: query + name: min_score + type: integer + produces: + - application/json + responses: + "200": + description: List of top matching job analysis results + schema: + items: + $ref: '#/definitions/domain.JobAnalysisResult' + type: array + "400": + description: Invalid minimum score + schema: + additionalProperties: + type: string + type: object + "500": + description: Internal server error + schema: + additionalProperties: + type: string + type: object + summary: Get top matching jobs + tags: + - jobs swagger: "2.0" diff --git a/services/scraper-glassdoor/.env b/services/scraper-glassdoor/.env new file mode 100644 index 0000000..ad2311a --- /dev/null +++ b/services/scraper-glassdoor/.env @@ -0,0 +1,12 @@ +DB_HOST=localhost +DB_PORT=5432 +DB_USER=your_db_user +DB_PASSWORD=your_db_password +DB_NAME=linkedin_jobs +DB_SSLMODE=disable + +SERVER_PORT=8080 +SERVER_HOST=localhost + +CV_AI_MODEL=your_ai_model +OPENROUTER_API_KEY=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 \ No newline at end of file diff --git a/services/scraper-linkedin/.env b/services/scraper-linkedin/.env new file mode 100644 index 0000000..ad2311a --- /dev/null +++ b/services/scraper-linkedin/.env @@ -0,0 +1,12 @@ +DB_HOST=localhost +DB_PORT=5432 +DB_USER=your_db_user +DB_PASSWORD=your_db_password +DB_NAME=linkedin_jobs +DB_SSLMODE=disable + +SERVER_PORT=8080 +SERVER_HOST=localhost + +CV_AI_MODEL=your_ai_model +OPENROUTER_API_KEY=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 \ No newline at end of file