asdasd
This commit is contained in:
7
.pnpmrc
Normal file
7
.pnpmrc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Optimize Node.js memory usage during builds
|
||||||
|
node-options=--max-old-space-size=4096
|
||||||
|
# Reduce output noise
|
||||||
|
loglevel=error
|
||||||
|
# Speed up builds
|
||||||
|
fund=false
|
||||||
|
audit=false
|
||||||
15
Dockerfile
15
Dockerfile
@@ -7,10 +7,13 @@ WORKDIR /app
|
|||||||
# Install git early for commit hash
|
# Install git early for commit hash
|
||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
# Install pnpm
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
# Install dependencies with increased memory limit for Next.js 16
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN npm install --force
|
|
||||||
|
# Install dependencies with pnpm
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
@@ -25,7 +28,7 @@ ENV API_HOSTNAME=internal-api.inboxi.ng
|
|||||||
# Build the Next.js application with increased memory for Turbopack
|
# Build the Next.js application with increased memory for Turbopack
|
||||||
# Next.js 16 uses Turbopack by default which may need more memory
|
# Next.js 16 uses Turbopack by default which may need more memory
|
||||||
RUN echo "Building with GIT_COMMIT_SHA=$(cat /app/git_commit_sha)" && \
|
RUN echo "Building with GIT_COMMIT_SHA=$(cat /app/git_commit_sha)" && \
|
||||||
NODE_OPTIONS='--max_old_space_size=4096' NEXT_TELEMETRY_DISABLED=1 npm run build
|
NODE_OPTIONS='--max_old_space_size=4096' NEXT_TELEMETRY_DISABLED=1 pnpm run build
|
||||||
|
|
||||||
# ---- Production Stage ----
|
# ---- Production Stage ----
|
||||||
# Use Node 20 for production as well to match builder
|
# Use Node 20 for production as well to match builder
|
||||||
@@ -37,7 +40,7 @@ WORKDIR /app
|
|||||||
RUN mkdir -p /app/public
|
RUN mkdir -p /app/public
|
||||||
|
|
||||||
# Copy only necessary files from builder
|
# Copy only necessary files from builder
|
||||||
COPY --from=builder /app/package.json /app/package-lock.json ./
|
COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
|
||||||
COPY --from=builder /app/.next ./.next
|
COPY --from=builder /app/.next ./.next
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
@@ -57,4 +60,4 @@ ENV API_HOSTNAME=internal-api.inboxi.ng
|
|||||||
# The file is available at /app/git_commit_sha if needed
|
# The file is available at /app/git_commit_sha if needed
|
||||||
|
|
||||||
# Start Next.js server
|
# Start Next.js server
|
||||||
CMD ["npm", "run", "start"]
|
CMD ["pnpm", "run", "start"]
|
||||||
@@ -16,12 +16,12 @@ For detailed documentation, guides, and troubleshooting, see the **[docs/](./doc
|
|||||||
First, run the development server:
|
First, run the development server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
pnpm dev
|
||||||
|
# or
|
||||||
npm run dev
|
npm run dev
|
||||||
# or
|
# or
|
||||||
yarn dev
|
yarn dev
|
||||||
# or
|
# or
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
bun dev
|
bun dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export default function AnalyticsDashboard({
|
|||||||
}: AnalyticsDashboardProps) {
|
}: AnalyticsDashboardProps) {
|
||||||
const [data, setData] = useState<AnalyticsOverview>(initialData);
|
const [data, setData] = useState<AnalyticsOverview>(initialData);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [timeRange, setTimeRange] = useState("30");
|
const [timeRange, setTimeRange] = useState("90");
|
||||||
const [hideNumbers, setHideNumbers] = useState(false);
|
const [hideNumbers, setHideNumbers] = useState(false);
|
||||||
const [profitDateRange, setProfitDateRange] = useState<DateRange | undefined>(
|
const [profitDateRange, setProfitDateRange] = useState<DateRange | undefined>(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ interface PredictionsChartProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function PredictionsChart({
|
export default function PredictionsChart({
|
||||||
timeRange = 30,
|
timeRange = 90,
|
||||||
}: PredictionsChartProps) {
|
}: PredictionsChartProps) {
|
||||||
const [predictions, setPredictions] = useState<PredictionsOverview | null>(
|
const [predictions, setPredictions] = useState<PredictionsOverview | null>(
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ This document provides instructions for building the project on slower CPUs or r
|
|||||||
Run the optimized build using:
|
Run the optimized build using:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build:optimized
|
pnpm run build:optimized
|
||||||
```
|
```
|
||||||
|
|
||||||
## Optimization Features
|
## Optimization Features
|
||||||
@@ -26,7 +26,7 @@ If you need to manually optimize the build process:
|
|||||||
|
|
||||||
### 1. Clean the caches
|
### 1. Clean the caches
|
||||||
```bash
|
```bash
|
||||||
npm run clean
|
pnpm run clean
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Set Node.js memory limit
|
### 2. Set Node.js memory limit
|
||||||
@@ -36,12 +36,12 @@ export NODE_OPTIONS="--max-old-space-size=4096"
|
|||||||
|
|
||||||
### 3. Skip non-essential checks
|
### 3. Skip non-essential checks
|
||||||
```bash
|
```bash
|
||||||
NEXT_SKIP_LINT=1 NEXT_SKIP_TS_CHECK=1 npm run build
|
NEXT_SKIP_LINT=1 NEXT_SKIP_TS_CHECK=1 pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Use SWC compiler with optimized settings
|
### 4. Use SWC compiler with optimized settings
|
||||||
```bash
|
```bash
|
||||||
NEXT_TELEMETRY_DISABLED=1 npm run build:fast
|
NEXT_TELEMETRY_DISABLED=1 pnpm run build:fast
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration Files
|
## Configuration Files
|
||||||
@@ -49,7 +49,7 @@ NEXT_TELEMETRY_DISABLED=1 npm run build:fast
|
|||||||
The following configuration files have been optimized:
|
The following configuration files have been optimized:
|
||||||
|
|
||||||
- **next.config.mjs**: Contains SWC optimizations and standalone output
|
- **next.config.mjs**: Contains SWC optimizations and standalone output
|
||||||
- **.npmrc**: Configures Node.js memory limits and disables notifications
|
- **.pnpmrc**: Configures Node.js memory limits and disables notifications
|
||||||
- **.env.production**: Sets environment variables for production builds
|
- **.env.production**: Sets environment variables for production builds
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
@@ -60,7 +60,7 @@ If you encounter "JavaScript heap out of memory" errors, try:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
export NODE_OPTIONS="--max-old-space-size=2048"
|
export NODE_OPTIONS="--max-old-space-size=2048"
|
||||||
npm run build:fast
|
pnpm run build:fast
|
||||||
```
|
```
|
||||||
|
|
||||||
### Slow Builds
|
### Slow Builds
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export async function logoutUser(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove the auth token from cookies
|
// Remove the auth token from cookies
|
||||||
document.cookie = 'Authorization=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; Secure; SameSite=Strict';
|
document.cookie = 'Authorization=; path=/; Secure; SameSite=Strict';
|
||||||
|
|
||||||
// Remove from localStorage as backup
|
// Remove from localStorage as backup
|
||||||
localStorage.removeItem('Authorization');
|
localStorage.removeItem('Authorization');
|
||||||
|
|||||||
7162
pnpm-lock.yaml
generated
Normal file
7162
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,7 @@ console.log('🚀 Starting optimized build process...');
|
|||||||
|
|
||||||
// Build with optimized settings
|
// Build with optimized settings
|
||||||
try {
|
try {
|
||||||
execSync('npm run build:fast', {
|
execSync('pnpm run build:fast', {
|
||||||
stdio: 'inherit',
|
stdio: 'inherit',
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
|||||||
Reference in New Issue
Block a user