diff --git a/.env.example b/.env.example old mode 100644 new mode 100755 diff --git a/.eslintrc.cjs b/.eslintrc.cjs old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/components.json b/components.json old mode 100644 new mode 100755 diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile new file mode 100644 index 0000000..b4e79ab --- /dev/null +++ b/docker/development/Dockerfile @@ -0,0 +1,53 @@ +# syntax=docker.io/docker/dockerfile:1 + +FROM node:18-alpine AS base + +# 1. Install dependencies only when needed +FROM base AS deps +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +RUN apk add --no-cache libc6-compat + +WORKDIR /app + +# Install dependencies based on the preferred package manager +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ +RUN \ + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \ + else echo "Lockfile not found." && exit 1; \ + fi + +# 2. Rebuild the source code only when needed +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +# This will do the trick, use the corresponding env file for each environment. +COPY .env .env.production +RUN npm run build + +# 3. Production image, copy all the files and run next +FROM base AS runner +WORKDIR /app + +ENV NODE_ENV=production + +RUN addgroup -g 1001 -S nodejs +RUN adduser -S nextjs -u 1001 + +COPY --from=builder /app/public ./public + +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + + +USER nextjs + +EXPOSE 3000 + +ENV PORT=3000 + +CMD HOSTNAME="0.0.0.0" node server.js diff --git a/docker/development/compose.yaml b/docker/development/compose.yaml new file mode 100644 index 0000000..cd560b5 --- /dev/null +++ b/docker/development/compose.yaml @@ -0,0 +1,17 @@ +services: + gib_portfolio: + build: + context: ../../ + dockerfile: docker/development/Dockerfile + image: with-docker-multi-env-development + container_name: gib_portfolio + networks: + - node_apps + ports: + - "3000:3000" + tty: true + restart: unless-stopped +networks: + node_apps: + external: true + diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile new file mode 100644 index 0000000..5a1e113 --- /dev/null +++ b/docker/production/Dockerfile @@ -0,0 +1,54 @@ +# syntax=docker.io/docker/dockerfile:1 + +FROM node:18-alpine AS base + +# 1. Install dependencies only when needed +FROM base AS deps +# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. +RUN apk add --no-cache libc6-compat + +WORKDIR /app + +# Install dependencies based on the preferred package manager +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ +RUN \ + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \ + else echo "Lockfile not found." && exit 1; \ + fi + + +# 2. Rebuild the source code only when needed +FROM base AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +# This will do the trick, use the corresponding env file for each environment. +COPY .env .env.production +RUN npm run build + +# 3. Production image, copy all the files and run next +FROM base AS runner +WORKDIR /app + +ENV NODE_ENV=production + +RUN addgroup -g 1001 -S nodejs +RUN adduser -S nextjs -u 1001 + +COPY --from=builder /app/public ./public + +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + + +USER nextjs + +EXPOSE 3000 + +ENV PORT=3000 + +CMD HOSTNAME="0.0.0.0" node server.js diff --git a/docker/production/compose.yaml b/docker/production/compose.yaml new file mode 100644 index 0000000..fa7ea90 --- /dev/null +++ b/docker/production/compose.yaml @@ -0,0 +1,16 @@ +services: + gib_portfolio: + build: + context: ../../ + dockerfile: docker/production/Dockerfile + image: with-docker-multi-env-development + container_name: gib_portfolio + networks: + - node_apps + ports: + - "3000:3000" + tty: true + restart: unless-stopped +networks: + node_apps: + external: true diff --git a/drizzle.config.ts b/drizzle.config.ts old mode 100644 new mode 100755 diff --git a/next.config.js b/next.config.js old mode 100644 new mode 100755 index 9bfe4a0..ffbf3fa --- a/next.config.js +++ b/next.config.js @@ -2,9 +2,12 @@ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful * for Docker builds. */ -await import("./src/env.js"); +import './src/env.js'; /** @type {import("next").NextConfig} */ -const config = {}; +const config = { + output: 'standalone', +}; export default config; + diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 7b35a27..71fb085 --- a/package.json +++ b/package.json @@ -11,9 +11,7 @@ "db:studio": "drizzle-kit studio", "dev": "next dev", "lint": "next lint", - "start": "next start", - "goprod": "next build && next start", - "go": "git pull docker master && next dev" + "start": "next start" }, "dependencies": { "@radix-ui/react-accordion": "^1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml old mode 100644 new mode 100755 diff --git a/postcss.config.cjs b/postcss.config.cjs old mode 100644 new mode 100755 diff --git a/prettier.config.js b/prettier.config.js old mode 100644 new mode 100755 diff --git a/public/favicon.png b/public/favicon.png old mode 100644 new mode 100755 diff --git a/public/gib_pfp.jpg b/public/gib_pfp.jpg old mode 100644 new mode 100755 diff --git a/public/original.png b/public/original.png old mode 100644 new mode 100755 diff --git a/public/videos/FuseRNDemo.mp4 b/public/videos/FuseRNDemo.mp4 old mode 100644 new mode 100755 diff --git a/public/videos/techtrackeriosdemo.mp4 b/public/videos/techtrackeriosdemo.mp4 old mode 100644 new mode 100755 diff --git a/public/videos/techtrackerwebdemo.mp4 b/public/videos/techtrackerwebdemo.mp4 old mode 100644 new mode 100755 diff --git a/scripts/files_to_clipboard.py b/scripts/files_to_clipboard.py new file mode 100755 index 0000000..7654166 --- /dev/null +++ b/scripts/files_to_clipboard.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 + +import os +import sys +import argparse +from pathlib import Path +import pyperclip +import questionary + +# List of directories to exclude +EXCLUDED_DIRS = {'node_modules', '.next', '.venv', '.git', '__pycache__', '.idea', '.vscode', 'ui'} + +def collect_files(project_path): + """ + Collects files from the project directory, excluding specified directories and filtering by extensions. + Returns a list of file paths relative to the project directory. + """ + collected_files = [] + + for root, dirs, files in os.walk(project_path): + # Exclude specified directories + dirs[:] = [d for d in dirs if d not in EXCLUDED_DIRS] + + for file in files: + file_path = Path(root) / file + relative_path = file_path.relative_to(project_path) + collected_files.append(relative_path) + + return collected_files + +def main(): + # Parse command-line arguments + parser = argparse.ArgumentParser(description='Generate Markdown from selected files.') + parser.add_argument('path', nargs='?', default='.', help='Path to the project directory') + args = parser.parse_args() + + project_path = Path(args.path).resolve() + if not project_path.is_dir(): + print(f"Error: '{project_path}' is not a directory.") + sys.exit(1) + + # Collect files from the project directory + file_list = collect_files(project_path) + + if not file_list: + print("No files found in the project directory with the specified extensions.") + sys.exit(1) + + # Sort file_list for better organization + file_list.sort() + + # Interactive file selection using questionary + print("\nSelect the files you want to include:") + selected_files = questionary.checkbox( + "Press space to select files, and Enter when you're done:", + choices=[str(f) for f in file_list] + ).ask() + + if not selected_files: + print("No files selected.") + sys.exit(1) + + # Generate markdown + markdown_lines = [] + markdown_lines.append('') + + for selected_file in selected_files: + file_path = project_path / selected_file + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + # Determine the language for code block from file extension + language = file_path.suffix.lstrip('.') + markdown_lines.append(f'{selected_file}') + markdown_lines.append(f'```{language}') + markdown_lines.append(content) + markdown_lines.append('```') + markdown_lines.append('') + except Exception as e: + print(f"Error reading file {selected_file}: {e}") + + markdown_text = '\n'.join(markdown_lines) + + # Write markdown to file + output_file = 'output.md' + with open(output_file, 'w', encoding='utf-8') as f: + f.write(markdown_text) + print(f"\nMarkdown file '{output_file}' has been generated.") + + # Copy markdown content to clipboard + pyperclip.copy(markdown_text) + print("Markdown content has been copied to the clipboard.") + +if __name__ == "__main__": + # Check if required libraries are installed + try: + import questionary + import pyperclip + except ImportError as e: + missing_module = e.name + print(f"Error: Missing required module '{missing_module}'.") + print(f"Please install it by running: pip install {missing_module}") + sys.exit(1) + + main() diff --git a/scripts/next.config.build.js b/scripts/next.config.build.js new file mode 100644 index 0000000..6ec99c0 --- /dev/null +++ b/scripts/next.config.build.js @@ -0,0 +1,18 @@ +/** + * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful + * for Docker builds. + */ +import './src/env.js'; + +/** @type {import("next").NextConfig} */ +const config = { + output: 'standalone', + typescript: { + ignoreBuildErrors: true, + }, + eslint: { + ignoreDuringBuilds: true, + }, +}; + +export default config; diff --git a/scripts/next.config.default.js b/scripts/next.config.default.js new file mode 100644 index 0000000..ffbf3fa --- /dev/null +++ b/scripts/next.config.default.js @@ -0,0 +1,13 @@ +/** + * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful + * for Docker builds. + */ +import './src/env.js'; + +/** @type {import("next").NextConfig} */ +const config = { + output: 'standalone', +}; + +export default config; + diff --git a/scripts/reload_container.sh b/scripts/reload_container.sh new file mode 100755 index 0000000..230d8aa --- /dev/null +++ b/scripts/reload_container.sh @@ -0,0 +1,7 @@ +git pull +mv ~/Documents/Web/completeuphoria/next.config.js ~/Documents/Web/completeuphoria/scripts/next.config.default.js +cp ~/Documents/Web/completeuphoria/scripts/next.config.build.js ~/Documents/Web/completeuphoria/next.config.js +sudo docker compose -f docker/development/compose.yaml down +sudo docker compose -f docker/development/compose.yaml build +sudo docker compose -f docker/development/compose.yaml up -d +cp ~/Documents/Web/completeuphoria/scripts/next.config.default.js ~/Documents/Web/completeuphoria/next.config.js diff --git a/src/app/layout.tsx b/src/app/layout.tsx old mode 100644 new mode 100755 diff --git a/src/app/page.tsx b/src/app/page.tsx old mode 100644 new mode 100755 diff --git a/src/components/general/aboutme.tsx b/src/components/general/aboutme.tsx old mode 100644 new mode 100755 diff --git a/src/components/general/pfpname.tsx b/src/components/general/pfpname.tsx old mode 100644 new mode 100755 diff --git a/src/components/general/techchart.tsx b/src/components/general/techchart.tsx old mode 100644 new mode 100755 diff --git a/src/components/projects/fuse.tsx b/src/components/projects/fuse.tsx old mode 100644 new mode 100755 diff --git a/src/components/projects/lazyprimeagen.tsx b/src/components/projects/lazyprimeagen.tsx old mode 100644 new mode 100755 diff --git a/src/components/projects/sunhat.tsx b/src/components/projects/sunhat.tsx old mode 100644 new mode 100755 diff --git a/src/components/projects/techtracker.tsx b/src/components/projects/techtracker.tsx old mode 100644 new mode 100755 diff --git a/src/components/projects/tenantportal.tsx b/src/components/projects/tenantportal.tsx old mode 100644 new mode 100755 diff --git a/src/components/projects/wiredworld.tsx b/src/components/projects/wiredworld.tsx old mode 100644 new mode 100755 diff --git a/src/components/theme/themeprovider.tsx b/src/components/theme/themeprovider.tsx old mode 100644 new mode 100755 diff --git a/src/components/theme/themetoggle.tsx b/src/components/theme/themetoggle.tsx old mode 100644 new mode 100755 diff --git a/src/components/ui/accordion.tsx b/src/components/ui/accordion.tsx old mode 100644 new mode 100755 diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx old mode 100644 new mode 100755 diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx old mode 100644 new mode 100755 diff --git a/src/components/ui/chart.tsx b/src/components/ui/chart.tsx old mode 100644 new mode 100755 diff --git a/src/components/ui/chart2.tsx b/src/components/ui/chart2.tsx old mode 100644 new mode 100755 diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx old mode 100644 new mode 100755 diff --git a/src/env.js b/src/env.js old mode 100644 new mode 100755 diff --git a/src/lib/utils.ts b/src/lib/utils.ts old mode 100644 new mode 100755 diff --git a/src/server/db/index.ts b/src/server/db/index.ts old mode 100644 new mode 100755 diff --git a/src/server/db/schema.ts b/src/server/db/schema.ts old mode 100644 new mode 100755 diff --git a/src/styles/globals.css b/src/styles/globals.css old mode 100644 new mode 100755 diff --git a/tailwind.config.ts b/tailwind.config.ts old mode 100644 new mode 100755 diff --git a/tsconfig.json b/tsconfig.json old mode 100644 new mode 100755