Skip to content

Commit

Permalink
refactor(api): migrate api routes, utils, and models to server directory
Browse files Browse the repository at this point in the history
This commit migrates the API routes, utility functions, and data models to the server directory. This change improves code organization and maintainability by centralizing server-side logic.  It also clarifies the separation of concerns between client and server components.  The new structure is more aligned with best practices for Nuxt 3 projects.
  • Loading branch information
shba007 committed Dec 5, 2024
1 parent 476bd6d commit 60f20fa
Show file tree
Hide file tree
Showing 24 changed files with 4,026 additions and 4,549 deletions.
2 changes: 1 addition & 1 deletion .changeset/fast-geese-cover.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"ai-service": minor
'ai-service': minor
---

changeset init
18 changes: 8 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.js]
indent_style = space
indent_size = 2

[{package.json,*.yml,*.cjson}]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
quote_type = single
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

5 changes: 0 additions & 5 deletions .eslintrc

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/ci-cd.yml

This file was deleted.

14 changes: 5 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ env:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
node-version: '20.x'
cache: 'npm'

- name: Install Dependencies
run: npm ci
Expand All @@ -41,24 +41,20 @@ jobs:

deploy:
needs: build
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Download artifact
uses: actions/download-artifact@v4

- name: Display structure of downloaded files
run: ls -R -a

- name: Upload artifact to VPS
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: 22
# testimonials.yml not added as it is confidencial
source: artifact/*
target: ~/api-ai/
target: ~/api-vision/
rm: true
overwrite: true
strip_components: 1
6 changes: 3 additions & 3 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
node-version: '20.x'
cache: 'npm'

- name: Install Dependencies
run: npm ci
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
24 changes: 24 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules
package.json
package-lock.json

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<img src="./public/logo.png" lt="Logo" width="80" />
<p>

# AI Service
> Global AI Service
# Vision Service

> Global Vision Service
<p align="center">
<a href="https://uptime.betterstack.com/?utm_source=status_badge">
<img src="https://uptime.betterstack.com/status-badges/v3/monitor/10kju.svg" alt="uptime status">
</a>
</p>

![Landing](public/previews/landing.webp)

# TODO

- Generated Wearied Earrings Photo
22 changes: 0 additions & 22 deletions middleware/cors.ts

This file was deleted.

13 changes: 7 additions & 6 deletions nitro.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { defineNitroConfig } from 'nitropack'

export default defineNitroConfig({
routeRules: {
'/**': { cors: true, headers: { 'access-control-allow-methods': 'GET,PUT,POST,DELETE' } },
},
imports: {
imports: [
{ name: 'ofetch', from: 'ofetch' },
],
imports: [{ name: 'ofetch', from: 'ofetch' }],
},
storage: {
'db': {
db: {
driver: 'fs',
base: './data/db'
}
base: './data/db',
},
},
runtimeConfig: {
apiUrl: '',
Expand Down
Loading

0 comments on commit 60f20fa

Please sign in to comment.