mirror of
https://github.com/ArthurDanjou/artapi.git
synced 2026-01-14 16:44:23 +01:00
Initial commit for ArtRag
This commit is contained in:
1
.env.example
Normal file
1
.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
NUXT_PUBLIC_HELLO_TEXT="Hello from the Edge 👋"
|
||||||
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# Nuxt dev/build outputs
|
||||||
|
.output
|
||||||
|
.data
|
||||||
|
.nuxt
|
||||||
|
.nitro
|
||||||
|
.cache
|
||||||
|
.wrangler
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Node dependencies
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
.DS_Store
|
||||||
|
.fleet
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Local env files
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
60
README.md
Normal file
60
README.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# Hello Edge
|
||||||
|
|
||||||
|
A minimal [Nuxt](https://nuxt.com) starter deployed on the Edge using [NuxtHub](https://hub.nuxt.com).
|
||||||
|
|
||||||
|
https://hello.nuxt.dev
|
||||||
|
|
||||||
|
<a href="https://hello.nuxt.dev">
|
||||||
|
<img src="https://github.com/nuxt-hub/hello-edge/assets/904724/99d1bd54-ef7e-4ac9-83ad-0a290f85edcf" alt="Hello World template for NuxtHub" />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Server-Side rendering on Cloudflare Workers
|
||||||
|
- ESLint setup
|
||||||
|
- Ready to add a database, blob and KV storage
|
||||||
|
- One click deploy on 275+ locations for free
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
Make sure to install the dependencies with [pnpm](https://pnpm.io/installation#using-corepack):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
You can update the main text displayed by creating a `.env`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
NUXT_PUBLIC_HELLO_TEXT="Hello my world!"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development Server
|
||||||
|
|
||||||
|
Start the development server on `http://localhost:3000`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## Production
|
||||||
|
|
||||||
|
Build the application for production:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deploy
|
||||||
|
|
||||||
|
|
||||||
|
Deploy the application on the Edge with [NuxtHub](https://hub.nuxt.com) on your Cloudflare account:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx nuxthub deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Then checkout your server logs, analaytics and more in the [NuxtHub Admin](https://admin.hub.nuxt.com).
|
||||||
|
|
||||||
|
You can also deploy using [Cloudflare Pages CI](https://hub.nuxt.com/docs/getting-started/deploy#cloudflare-pages-ci).
|
||||||
|
|
||||||
5
app/app.vue
Normal file
5
app/app.vue
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<NuxtRouteAnnouncer />
|
||||||
|
<NuxtLoadingIndicator />
|
||||||
|
<NuxtPage />
|
||||||
|
</template>
|
||||||
48
app/pages/index.vue
Normal file
48
app/pages/index.vue
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const runtimeConfig = useRuntimeConfig()
|
||||||
|
const colors = ['#f87171', '#fb923c', '#fbbf24', '#facc15', '#a3e635', '#4ade80', '#34d399', '#2dd4bf', '#22d3ee', '#38bdf8', '#60a5fa', '#818cf8', '#a78bfa', '#c084fc', '#e879f9', '#f472b6', '#fb7185']
|
||||||
|
const color = useState('color', () => colors[Math.floor(Math.random() * colors.length)])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="centered">
|
||||||
|
<h1 :style="{ color }">
|
||||||
|
{{ runtimeConfig.public.helloText }}
|
||||||
|
</h1>
|
||||||
|
<NuxtLink
|
||||||
|
to="/"
|
||||||
|
external
|
||||||
|
>
|
||||||
|
refresh
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.centered {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
margin: 0;
|
||||||
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
h1 {
|
||||||
|
font-size: 64px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #888;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
6
eslint.config.mjs
Normal file
6
eslint.config.mjs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// @ts-check
|
||||||
|
import withNuxt from './.nuxt/eslint.config.mjs'
|
||||||
|
|
||||||
|
export default withNuxt(
|
||||||
|
// Your custom configs here
|
||||||
|
)
|
||||||
49
nuxt.config.ts
Normal file
49
nuxt.config.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
|
export default defineNuxtConfig({
|
||||||
|
// https://nuxt.com/modules
|
||||||
|
modules: ['@nuxthub/core', '@nuxt/eslint', '@nuxt/content'],
|
||||||
|
|
||||||
|
// https://devtools.nuxt.com
|
||||||
|
devtools: {
|
||||||
|
enabled: true,
|
||||||
|
|
||||||
|
timeline: {
|
||||||
|
enabled: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Env variables - https://nuxt.com/docs/getting-started/configuration#environment-variables-and-private-tokens
|
||||||
|
runtimeConfig: {
|
||||||
|
public: {
|
||||||
|
// Can be overridden by NUXT_PUBLIC_HELLO_TEXT environment variable
|
||||||
|
helloText: 'Hello from the Edge 👋'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
future: { compatibilityVersion: 4 },
|
||||||
|
compatibilityDate: '2025-11-12',
|
||||||
|
|
||||||
|
nitro: {
|
||||||
|
experimental: {
|
||||||
|
openAPI: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// https://hub.nuxt.com/docs/getting-started/installation#options
|
||||||
|
hub: {
|
||||||
|
database: true,
|
||||||
|
ai: true,
|
||||||
|
analytics: true,
|
||||||
|
kv: true,
|
||||||
|
cache: true
|
||||||
|
},
|
||||||
|
|
||||||
|
// Development config
|
||||||
|
eslint: {
|
||||||
|
config: {
|
||||||
|
stylistic: {
|
||||||
|
quotes: 'single',
|
||||||
|
commaDangle: 'never'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
43
package.json
Normal file
43
package.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"name": "artrag",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "nuxt build",
|
||||||
|
"dev": "nuxt dev",
|
||||||
|
"generate": "nuxt generate",
|
||||||
|
"preview": "npx nuxthub preview",
|
||||||
|
"deploy": "npx nuxthub deploy",
|
||||||
|
"postinstall": "nuxt prepare",
|
||||||
|
"lint": "eslint ."
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@nuxt/content": "3.8.0",
|
||||||
|
"@nuxt/eslint": "^1.4.1",
|
||||||
|
"@nuxthub/core": "^0.9.0",
|
||||||
|
"better-sqlite3": "^12.4.1",
|
||||||
|
"nuxt": "^3.17.5",
|
||||||
|
"vue": "^3.5.16",
|
||||||
|
"vue-router": "^4.5.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@nuxt/eslint-config": "^1.4.1",
|
||||||
|
"eslint": "^9.29.0",
|
||||||
|
"typescript": "^5.8.3",
|
||||||
|
"vue-tsc": "^2.2.10",
|
||||||
|
"wrangler": "^4.20.1"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@10.12.1",
|
||||||
|
"pnpm": {
|
||||||
|
"onlyBuiltDependencies": [
|
||||||
|
"@parcel/watcher",
|
||||||
|
"esbuild",
|
||||||
|
"sharp",
|
||||||
|
"unrs-resolver",
|
||||||
|
"workerd"
|
||||||
|
],
|
||||||
|
"ignoredBuiltDependencies": [
|
||||||
|
"better-sqlite3"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
1
server/api/ping.ts
Normal file
1
server/api/ping.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export default eventHandler(() => 'pong')
|
||||||
3
server/tsconfig.json
Normal file
3
server/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "../.nuxt/tsconfig.server.json"
|
||||||
|
}
|
||||||
4
tsconfig.json
Normal file
4
tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
// https://nuxt.com/docs/guide/concepts/typescript
|
||||||
|
"extends": "./.nuxt/tsconfig.json"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user