-first-commit

This commit is contained in:
2025-12-16 18:29:49 +07:00
commit 2a0e7d8a12
13 changed files with 250 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules
package-lock.json

View File

@@ -0,0 +1,3 @@
npx nuxi@latest init frontend # (หรือตาม template ที่เครื่องมี)
cd frontend
npm install vuetify vite-plugin-vuetify @mdi/font axios pinia @pinia/nuxt tailwindcss

View File

@@ -0,0 +1,3 @@
mkdir backend && cd backend
npm init -y
npm install express cors dotenv knex mysql2 jsonwebtoken bcrypt morgan multer swagger-ui-express swagger-jsdoc

26
backend/package.json Normal file
View File

@@ -0,0 +1,26 @@
{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
"dependencies": {
"bcrypt": "^6.0.0",
"cors": "^2.8.5",
"dotenv": "^17.2.3",
"express": "^5.2.1",
"jsonwebtoken": "^9.0.3",
"knex": "^3.1.0",
"morgan": "^1.10.1",
"multer": "^2.0.2",
"mysql2": "^3.15.3",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1"
}
}

62
docker-compose.yml Normal file
View File

@@ -0,0 +1,62 @@
services:
# 1. Database Service (พระเอกของเรา)
db:
image: mysql:8.0 # หรือ mariadb:latest ตามโจทย์ระบุ
container_name: skill_db_container
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: skills_db
MYSQL_USER: user
MYSQL_PASSWORD: password
TZ: Asia/Bangkok
ports:
# 🔥 สำคัญมาก: เปิด Port 3306 ออกมาเพื่อให้
# Backend (ที่รันบนเครื่อง) และ HeidiSQL/DBeaver เข้าถึงได้
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
# ถ้ามีไฟล์ schema.sql ให้ map เข้าไปรันออโต้เลย (ประหยัดเวลา import)
# - ./schema.sql:/docker-entrypoint-initdb.d/00-schema.sql:ro
networks:
- skill_net
# -------------------------------------------------------
# 2. phpMyAdmin (ตัวช่วยชีวิต)
# -------------------------------------------------------
pma:
image: phpmyadmin/phpmyadmin
container_name: skill_pma_container
environment:
PMA_HOST: db
PMA_USER: root
PMA_PASSWORD: rootpassword
ports:
- "8080:80" # เข้าผ่าน http://localhost:8080
depends_on:
- db
networks:
- skill_net
# -------------------------------------------------------
# 3. Backend & Frontend (เตรียมไว้สำหรับตอนส่งงาน)
# * ตอนพัฒนาเราจะ comment ปิดไว้ก่อน เพื่อรันบนเครื่อง (เร็วสุด) *
# -------------------------------------------------------
# api:
# build: ./backend
# ports: ["7000:7000"]
# depends_on: [db]
# networks: [skill_net]
# web:
# build: ./frontend
# ports: ["3000:3000"]
# depends_on: [api]
# networks: [skill_net]
volumes:
db_data:
networks:
skill_net:
driver: bridge

24
frontend/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist
# Node dependencies
node_modules
# Logs
logs
*.log
# Misc
.DS_Store
.fleet
.idea
# Local env files
.env
.env.*
!.env.example

75
frontend/README.md Normal file
View File

@@ -0,0 +1,75 @@
# Nuxt Minimal Starter
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
## Setup
Make sure to install dependencies:
```bash
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun install
```
## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run dev
```
## Production
Build the application for production:
```bash
# npm
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run build
```
Locally preview production build:
```bash
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

6
frontend/app/app.vue Normal file
View File

@@ -0,0 +1,6 @@
<template>
<div>
<NuxtRouteAnnouncer />
<NuxtWelcome />
</div>
</template>

5
frontend/nuxt.config.ts Normal file
View File

@@ -0,0 +1,5 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
devtools: { enabled: true }
})

24
frontend/package.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "frontend",
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@mdi/font": "^7.4.47",
"@pinia/nuxt": "^0.11.3",
"axios": "^1.13.2",
"nuxt": "^4.2.2",
"pinia": "^3.0.4",
"tailwindcss": "^4.1.18",
"vite-plugin-vuetify": "^2.1.2",
"vue": "^3.5.25",
"vue-router": "^4.6.4",
"vuetify": "^3.11.3"
}
}

BIN
frontend/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,2 @@
User-Agent: *
Disallow:

18
frontend/tsconfig.json Normal file
View File

@@ -0,0 +1,18 @@
{
// https://nuxt.com/docs/guide/concepts/typescript
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}