diff --git a/Dockerfile b/Dockerfile index 577c32b..bf7e44c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ WORKDIR /app ENV NODE_ENV=production \ NEXT_TELEMETRY_DISABLED=1 \ - PORT=4023 \ + PORT=4024 \ HOSTNAME=0.0.0.0 # Create a non-root user @@ -52,6 +52,6 @@ COPY --from=builder /app/public ./public RUN chown -R nextjs:nodejs /app USER nextjs -EXPOSE 4023 +EXPOSE 4024 CMD ["node", "server.js"] diff --git a/README.md b/README.md index 9c4f0b7..2ed7e75 100644 --- a/README.md +++ b/README.md @@ -136,11 +136,11 @@ yarn dev 4. **Access the application:** -- Main site: [http://localhost:4023](http://localhost:4023) -- Authentication: [http://localhost:4023/auth](http://localhost:4023/auth) -- Admin dashboard: [http://localhost:4023/admin](http://localhost:4023/admin) -- Topics: [http://localhost:4023/topics](http://localhost:4023/topics) -- Tools: [http://localhost:4023/tools](http://localhost:4023/tools) +- Main site: [http://localhost:4024](http://localhost:4024) +- Authentication: [http://localhost:4024/auth](http://localhost:4024/auth) +- Admin dashboard: [http://localhost:4024/admin](http://localhost:4024/admin) +- Topics: [http://localhost:4024/topics](http://localhost:4024/topics) +- Tools: [http://localhost:4024/tools](http://localhost:4024/tools) ## 🏗️ Architecture @@ -236,7 +236,7 @@ siliconpin/ ```bash # Development -yarn dev # Start development server (port 4023) +yarn dev # Start development server (port 4024) yarn build # Build for production yarn start # Start production server diff --git a/app/api/balance/add/route.ts b/app/api/balance/add/route.ts index d8c4622..95ff03f 100644 --- a/app/api/balance/add/route.ts +++ b/app/api/balance/add/route.ts @@ -86,7 +86,7 @@ export async function POST(request: NextRequest) { const phone = '9876543210' // Default phone or fetch from user profile // Success and failure URLs for balance transactions - const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:4023' + const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:4024' const surl = `${baseUrl}/api/balance/success` const furl = `${baseUrl}/api/balance/failure` diff --git a/app/api/payments/initiate/route.ts b/app/api/payments/initiate/route.ts index ffea5a0..a63aab8 100644 --- a/app/api/payments/initiate/route.ts +++ b/app/api/payments/initiate/route.ts @@ -61,7 +61,7 @@ export async function POST(request: NextRequest) { const phone = '9876543210' // Default phone or fetch from user profile // Success and failure URLs - const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:4023' + const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:4024' const surl = `${baseUrl}/api/payments/success` const furl = `${baseUrl}/api/payments/failure` diff --git a/app/robots.ts b/app/robots.ts index 39e5867..ece8192 100644 --- a/app/robots.ts +++ b/app/robots.ts @@ -1,7 +1,7 @@ import { MetadataRoute } from 'next' export default function robots(): MetadataRoute.Robots { - const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:4023' + const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:4024' return { rules: [ diff --git a/app/sitemap.ts b/app/sitemap.ts index 969c380..1aca293 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -2,7 +2,7 @@ import { MetadataRoute } from 'next' import TopicModel from '@/models/topic' export default async function sitemap(): Promise { - const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:4023' + const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:4024' // Static pages const staticPages = [ diff --git a/app/topics/[slug]/page.tsx b/app/topics/[slug]/page.tsx index 5b08bcd..3f94e90 100644 --- a/app/topics/[slug]/page.tsx +++ b/app/topics/[slug]/page.tsx @@ -21,7 +21,7 @@ async function getTopicPost(slug: string): Promise { const baseUrl = process.env.NODE_ENV === 'production' ? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}` - : 'http://localhost:4023' + : 'http://localhost:4024' const response = await fetch(`${baseUrl}/api/topics/${encodeURIComponent(slug)}`, { headers: { @@ -58,7 +58,7 @@ async function getRelatedPosts(slug: string, limit: number = 2): Promise> { const baseUrl = process.env.NODE_ENV === 'production' ? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}` - : 'http://localhost:4023' + : 'http://localhost:4024' const response = await fetch(`${baseUrl}/api/topics/tags`, { headers: { diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index c39eac5..02db4c2 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -3,7 +3,7 @@ services: container_name: siliconpin-web build: . ports: - - "4023:4023" + - "4024:4024" depends_on: sp_mongo: condition: service_healthy diff --git a/docker-compose.yml b/docker-compose.yml index fa0c20e..c8afdaf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,14 +4,14 @@ services: container_name: siliconpin restart: unless-stopped ports: - - "4023:4023" + - "4024:4024" environment: - NODE_ENV=production - - PORT=4023 + - PORT=4024 - HOSTNAME=0.0.0.0 - LOG_LEVEL=info healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://0.0.0.0:4023/"] + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://0.0.0.0:4024/"] interval: 30s timeout: 10s retries: 3 diff --git a/docs/API.md b/docs/API.md index 2c8401c..cf6f65f 100644 --- a/docs/API.md +++ b/docs/API.md @@ -4,7 +4,7 @@ This document describes the comprehensive API endpoints available in the Silicon ## Base URL -- Development: `http://localhost:4023` +- Development: `http://localhost:4024` - Production: `https://siliconpin.com` ## Authentication @@ -354,23 +354,23 @@ axios.interceptors.response.use( ```bash # Register a new user -curl -X POST http://localhost:4023/api/auth/register \ +curl -X POST http://localhost:4024/api/auth/register \ -H "Content-Type: application/json" \ -d '{"name":"Test User","email":"test@example.com","password":"password123"}' \ -c cookies.txt # Login -curl -X POST http://localhost:4023/api/auth/login \ +curl -X POST http://localhost:4024/api/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"test@example.com","password":"password123"}' \ -c cookies.txt # Get user profile (protected route) -curl -X GET http://localhost:4023/api/auth/me \ +curl -X GET http://localhost:4024/api/auth/me \ -b cookies.txt # Logout -curl -X POST http://localhost:4023/api/auth/logout \ +curl -X POST http://localhost:4024/api/auth/logout \ -b cookies.txt ``` diff --git a/package.json b/package.json index bb5f880..6ab49d4 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "scripts": { - "dev": "next dev -p 4023", + "dev": "next dev -p 4024", "build": "next build", - "start": "next start -p 4023", + "start": "next start -p 4024", "lint": "next lint", "lint:fix": "next lint --fix", "type-check": "tsc --noEmit",