diff --git a/backend/.env.example b/backend/.env.example index d56d6cc..4831ecf 100755 --- a/backend/.env.example +++ b/backend/.env.example @@ -19,12 +19,12 @@ S3_BUCKET=your-bucket-name JWT_SECRET=your-secret-key-change-this-in-production-use-strong-random-value # Server Configuration -PORT=8080 +PORT=8521 ENV=development # CORS Origins (comma-separated) -CORS_ORIGINS=http://localhost:3000 +CORS_ORIGINS=http://localhost:8963 # File Upload -MAX_UPLOAD_SIZE=10485760 # 10MB in bytes +MAX_UPLOAD_SIZE=10485760 UPLOAD_DIR=./uploads diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 720f36a..b66b68b 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -62,6 +62,36 @@ const docTemplate = `{ } }, "/api/v1/companies": { + "get": { + "description": "Returns a list of all companies.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Companies" + ], + "summary": "List Companies", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse" + } + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, "post": { "description": "Registers a new company and creates an initial admin user.", "consumes": [ diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 8777cc9..999d8b1 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -56,6 +56,36 @@ } }, "/api/v1/companies": { + "get": { + "description": "Returns a list of all companies.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Companies" + ], + "summary": "List Companies", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse" + } + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "type": "string" + } + } + } + }, "post": { "description": "Registers a new company and creates an initial admin user.", "consumes": [ diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index ec24508..5fca3d7 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -106,6 +106,26 @@ paths: tags: - Auth /api/v1/companies: + get: + consumes: + - application/json + description: Returns a list of all companies. + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/github_com_rede5_gohorsejobs_backend_internal_core_dto.CompanyResponse' + type: array + "500": + description: Internal Server Error + schema: + type: string + summary: List Companies + tags: + - Companies post: consumes: - application/json diff --git a/backend/go.mod b/backend/go.mod index b0d14c1..c53beec 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -3,6 +3,10 @@ module github.com/rede5/gohorsejobs/backend go 1.24.0 require ( + github.com/aws/aws-sdk-go-v2 v1.41.0 + github.com/aws/aws-sdk-go-v2/config v1.32.5 + github.com/aws/aws-sdk-go-v2/credentials v1.19.5 + github.com/aws/aws-sdk-go-v2/service/s3 v1.93.2 github.com/golang-jwt/jwt/v5 v5.3.0 github.com/google/uuid v1.6.0 github.com/joho/godotenv v1.5.1 @@ -14,10 +18,7 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.41.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect - github.com/aws/aws-sdk-go-v2/config v1.32.5 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.19.5 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 // indirect @@ -27,7 +28,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.7 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.93.2 // indirect github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.30.7 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index d89472e..0da010e 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -1,6 +1,6 @@ import { getToken } from "./auth"; -const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080"; +const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8521"; export interface ApiUser { id: string; diff --git a/frontend/src/lib/auth.ts b/frontend/src/lib/auth.ts index d4227ca..3617a0f 100644 --- a/frontend/src/lib/auth.ts +++ b/frontend/src/lib/auth.ts @@ -1,7 +1,7 @@ import type { User } from "./types"; const AUTH_KEY = "job-portal-auth"; -const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080/api/v1"; +const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8521/api/v1"; interface LoginResponse { token: string; diff --git a/frontend/src/lib/storage.ts b/frontend/src/lib/storage.ts index fe94c8f..dd8b607 100644 --- a/frontend/src/lib/storage.ts +++ b/frontend/src/lib/storage.ts @@ -2,7 +2,7 @@ * Storage service for S3 file uploads via pre-signed URLs */ -const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080/api/v1"; +const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8521/api/v1"; interface UploadUrlResponse { uploadUrl: string; diff --git a/run_dev.sh b/run_dev.sh index 742d5cb..15819d7 100755 --- a/run_dev.sh +++ b/run_dev.sh @@ -38,7 +38,7 @@ if [ ! -d "frontend/node_modules" ]; then fi # Start Backend -echo "🔹 Starting Backend (Go)..." +echo "🔹 Starting Backend (Go) on port 8521..." (cd backend && go run cmd/api/main.go) & BACKEND_PID=$! @@ -46,9 +46,15 @@ BACKEND_PID=$! sleep 2 # Start Frontend -echo "🔹 Starting Frontend (Next.js)..." -(cd frontend && npm run dev) & +echo "🔹 Starting Frontend (Next.js) on port 8963..." +(cd frontend && npm run dev -- -p 8963) & FRONTEND_PID=$! +echo "" +echo "📡 Services running:" +echo " - Backend: http://localhost:8521" +echo " - Frontend: http://localhost:8963" +echo "" + # Wait for both processes wait $BACKEND_PID $FRONTEND_PID