A high-performance portfolio and blog system for a system architect, featuring:
- Project showcase with ETL/POS/Logistics examples
- Technical blog with MDX support
- Admin dashboard with analytics
- Secure authentication (Google + Credentials)
- Production-ready deployment on Google Cloud
A modern portfolio & project site for a system architect and full-stack developer — designed to scale, impress, and handle real production use.
/– Landing Page พร้อม Hero, CTA, Feature Cards/about– แนะนำตัวจากประสบการณ์จริง/projects– Showcase โปรเจกต์ (ETL, POS, Logistics ฯลฯ)/contact– ช่องทางติดต่อ + ปุ่มอีเมล/blog– Blog สำหรับผู้ใช้งานทั่วไป
/dashboard– ต้อง Login (USER, EDITOR, ADMIN)/dashboard/admin– เฉพาะ ADMIN/blog/edit– สำหรับ EDITOR, ADMIN/blog/admin– เฉพาะ ADMIN
- ✅ Login ผ่าน Email/Password และ Google OAuth
- ✅ Role-based Access Control (
USER,EDITOR,ADMIN) - ✅ Middleware ป้องกัน route + Redirect
- ✅ Session management with JWT
- ✅
/unauthorizedpage สำหรับผู้ที่ไม่มีสิทธิ์
| Component | Feature |
|---|---|
| ✅ Navbar | Responsive + Role-aware Links |
| ✅ Theme | Light/Dark toggle (next-themes) |
| ✅ Hero Section | Framer Motion Animated |
| ✅ Card Layout | Tailwind + shadcn/ui |
| ✅ CTA Buttons | Modern design |
| ✅ Avatar/Profile | Sign in/out + Role dropdown (พร้อมเพิ่ม menu) |
| Layer | Tool/Library | Purpose |
|---|---|---|
| Frontend | Next.js 15 App Router | File-based routing + SSR |
| Styling | TailwindCSS + shadcn/ui | UI Component + Utility styling |
| Auth | next-auth + JWT | Google/Auth login & Role control |
| ORM | Prisma | Type-safe DB Access |
| DB | PostgreSQL 16 | Structured relational storage |
| Icons | Lucide-react | Icon Set |
| Animation | Framer Motion | Section transitions |
| Themes | next-themes | Dark/Light/System toggle |
| Middleware | next-auth/jwt | Route-level protection |
orignx.dev/
├── app/
│ ├── about/ # About page
│ ├── projects/ # Project showcase
│ ├── contact/ # Contact form
│ ├── dashboard/ # Protected dashboard
│ └── blog/ # Public blog
├── prisma/
│ └── schema.prisma # Database schema
├── components/ # UI components
├── lib/ # Helpers (auth, db, session)
├── middleware.ts # Auth + Role control
├── .env.example # Environment variables
└── deploy.sh # CI/CD script
- Google Cloud VM (Ubuntu 24.04)
- Docker + Docker Compose
- DNS for
orignx.dev
git clone https://github.com/yourusername/orignx.dev.git
cd orignx.dev
cp .env.example .env
nano .env
sudo certbot --nginx -d orignx.dev -d www.orignx.dev
docker-compose -f docker-compose.prod.yml up -d --build
docker exec orignx_app npx prisma migrate deploy.github/workflows/deploy.yml
name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to Server
run: |
ssh [email protected] "cd /var/www/orignx.dev && git pull && ./deploy.sh"- ✅ Role-based route guard via middleware
- ✅ JWT session token
- ✅ Rate limiting via Nginx
- ✅ Security headers (CSP, TLS 1.3)
- ✅ Automated SSL with Certbot
- ✅ Auto upgrade & image pull
sudo apt update && sudo apt upgrade -y
docker-compose pullDATABASE_URL="postgresql://postgres:password@db:5432/orignx"
NEXTAUTH_SECRET="your-secret"
NEXTAUTH_URL="https://orignx.dev"
GOOGLE_CLIENT_ID=your_google_id
GOOGLE_CLIENT_SECRET=your_google_secretgenerator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
name String?
email String @unique
role Role @default(USER)
createdAt DateTime @default(now())
}
enum Role {
USER
EDITOR
ADMIN
}
model Post {
id String @id @default(cuid())
title String
content String?
authorId String
author User @relation(fields: [authorId], references: [id])
createdAt DateTime @default(now())
}
model Project {
id String @id @default(cuid())
title String
description String?
createdAt DateTime @default(now())
authorId String
author User @relation(fields: [authorId], references: [id])
}docker-compose.monitoring.yml
services:
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
ports:
- "3001:3000"
depends_on:
- prometheus- ✅ Domain + SSL setup via Certbot
- ✅ Middleware auth + role guard
- ✅ Login with Google/Credentials
- ✅ Blog & Dashboard with RBAC
- ✅ Responsive design with Dark/Light theme
- ✅ CI/CD deploy script
- ✅ Monitoring with Prometheus + Grafana
MIT License - See LICENSE for details.