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 \
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"]

View File

@ -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

View File

@ -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`

View File

@ -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`

View File

@ -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: [

View File

@ -2,7 +2,7 @@ import { MetadataRoute } from 'next'
import TopicModel from '@/models/topic'
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
const staticPages = [

View File

@ -21,7 +21,7 @@ async function getTopicPost(slug: string): Promise<ITopic | null> {
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<ITopic[
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)}/related?limit=${limit}`,

View File

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

View File

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

View File

@ -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

View File

@ -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
```

View File

@ -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",