change port 4023 to 4024

main
Kar k1 2025-08-30 18:28:24 +05:30
parent 7219108342
commit f29889df9a
12 changed files with 27 additions and 27 deletions

View File

@ -36,7 +36,7 @@ WORKDIR /app
ENV NODE_ENV=production \ ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1 \ NEXT_TELEMETRY_DISABLED=1 \
PORT=4023 \ PORT=4024 \
HOSTNAME=0.0.0.0 HOSTNAME=0.0.0.0
# Create a non-root user # Create a non-root user
@ -52,6 +52,6 @@ COPY --from=builder /app/public ./public
RUN chown -R nextjs:nodejs /app RUN chown -R nextjs:nodejs /app
USER nextjs USER nextjs
EXPOSE 4023 EXPOSE 4024
CMD ["node", "server.js"] CMD ["node", "server.js"]

View File

@ -136,11 +136,11 @@ yarn dev
4. **Access the application:** 4. **Access the application:**
- Main site: [http://localhost:4023](http://localhost:4023) - Main site: [http://localhost:4024](http://localhost:4024)
- Authentication: [http://localhost:4023/auth](http://localhost:4023/auth) - Authentication: [http://localhost:4024/auth](http://localhost:4024/auth)
- Admin dashboard: [http://localhost:4023/admin](http://localhost:4023/admin) - Admin dashboard: [http://localhost:4024/admin](http://localhost:4024/admin)
- Topics: [http://localhost:4023/topics](http://localhost:4023/topics) - Topics: [http://localhost:4024/topics](http://localhost:4024/topics)
- Tools: [http://localhost:4023/tools](http://localhost:4023/tools) - Tools: [http://localhost:4024/tools](http://localhost:4024/tools)
## 🏗️ Architecture ## 🏗️ Architecture
@ -236,7 +236,7 @@ siliconpin/
```bash ```bash
# Development # Development
yarn dev # Start development server (port 4023) yarn dev # Start development server (port 4024)
yarn build # Build for production yarn build # Build for production
yarn start # Start production server yarn start # Start production server

View File

@ -86,7 +86,7 @@ export async function POST(request: NextRequest) {
const phone = '9876543210' // Default phone or fetch from user profile const phone = '9876543210' // Default phone or fetch from user profile
// Success and failure URLs for balance transactions // 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 surl = `${baseUrl}/api/balance/success`
const furl = `${baseUrl}/api/balance/failure` const furl = `${baseUrl}/api/balance/failure`

View File

@ -61,7 +61,7 @@ export async function POST(request: NextRequest) {
const phone = '9876543210' // Default phone or fetch from user profile const phone = '9876543210' // Default phone or fetch from user profile
// Success and failure URLs // 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 surl = `${baseUrl}/api/payments/success`
const furl = `${baseUrl}/api/payments/failure` const furl = `${baseUrl}/api/payments/failure`

View File

@ -1,7 +1,7 @@
import { MetadataRoute } from 'next' import { MetadataRoute } from 'next'
export default function robots(): MetadataRoute.Robots { 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 { return {
rules: [ rules: [

View File

@ -2,7 +2,7 @@ import { MetadataRoute } from 'next'
import TopicModel from '@/models/topic' import TopicModel from '@/models/topic'
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:4023' const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:4024'
// Static pages // Static pages
const staticPages = [ const staticPages = [

View File

@ -21,7 +21,7 @@ async function getTopicPost(slug: string): Promise<ITopic | null> {
const baseUrl = const baseUrl =
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'
? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}` ? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}`
: 'http://localhost:4023' : 'http://localhost:4024'
const response = await fetch(`${baseUrl}/api/topics/${encodeURIComponent(slug)}`, { const response = await fetch(`${baseUrl}/api/topics/${encodeURIComponent(slug)}`, {
headers: { headers: {
@ -58,7 +58,7 @@ async function getRelatedPosts(slug: string, limit: number = 2): Promise<ITopic[
const baseUrl = const baseUrl =
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'
? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}` ? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}`
: 'http://localhost:4023' : 'http://localhost:4024'
const response = await fetch( const response = await fetch(
`${baseUrl}/api/topics/${encodeURIComponent(slug)}/related?limit=${limit}`, `${baseUrl}/api/topics/${encodeURIComponent(slug)}/related?limit=${limit}`,

View File

@ -86,7 +86,7 @@ async function getTopics(searchParams: Promise<{ [key: string]: string | string[
const baseUrl = const baseUrl =
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'
? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}` ? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}`
: 'http://localhost:4023' : 'http://localhost:4024'
const searchQuery = new URLSearchParams({ const searchQuery = new URLSearchParams({
page: page.toString(), page: page.toString(),
@ -144,7 +144,7 @@ async function getTags(): Promise<Array<{ id: string; name: string }>> {
const baseUrl = const baseUrl =
process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'production'
? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}` ? `${process.env.NEXTAUTH_URL || 'https://siliconpin.com'}`
: 'http://localhost:4023' : 'http://localhost:4024'
const response = await fetch(`${baseUrl}/api/topics/tags`, { const response = await fetch(`${baseUrl}/api/topics/tags`, {
headers: { headers: {

View File

@ -3,7 +3,7 @@ services:
container_name: siliconpin-web container_name: siliconpin-web
build: . build: .
ports: ports:
- "4023:4023" - "4024:4024"
depends_on: depends_on:
sp_mongo: sp_mongo:
condition: service_healthy condition: service_healthy

View File

@ -4,14 +4,14 @@ services:
container_name: siliconpin container_name: siliconpin
restart: unless-stopped restart: unless-stopped
ports: ports:
- "4023:4023" - "4024:4024"
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=4023 - PORT=4024
- HOSTNAME=0.0.0.0 - HOSTNAME=0.0.0.0
- LOG_LEVEL=info - LOG_LEVEL=info
healthcheck: 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 interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3

View File

@ -4,7 +4,7 @@ This document describes the comprehensive API endpoints available in the Silicon
## Base URL ## Base URL
- Development: `http://localhost:4023` - Development: `http://localhost:4024`
- Production: `https://siliconpin.com` - Production: `https://siliconpin.com`
## Authentication ## Authentication
@ -354,23 +354,23 @@ axios.interceptors.response.use(
```bash ```bash
# Register a new user # 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" \ -H "Content-Type: application/json" \
-d '{"name":"Test User","email":"test@example.com","password":"password123"}' \ -d '{"name":"Test User","email":"test@example.com","password":"password123"}' \
-c cookies.txt -c cookies.txt
# Login # Login
curl -X POST http://localhost:4023/api/auth/login \ curl -X POST http://localhost:4024/api/auth/login \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password123"}' \ -d '{"email":"test@example.com","password":"password123"}' \
-c cookies.txt -c cookies.txt
# Get user profile (protected route) # 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 -b cookies.txt
# Logout # Logout
curl -X POST http://localhost:4023/api/auth/logout \ curl -X POST http://localhost:4024/api/auth/logout \
-b cookies.txt -b cookies.txt
``` ```

View File

@ -3,9 +3,9 @@
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 4023", "dev": "next dev -p 4024",
"build": "next build", "build": "next build",
"start": "next start -p 4023", "start": "next start -p 4024",
"lint": "next lint", "lint": "next lint",
"lint:fix": "next lint --fix", "lint:fix": "next lint --fix",
"type-check": "tsc --noEmit", "type-check": "tsc --noEmit",