Compare commits

10 Commits

Author SHA1 Message Date
ab0ad65d5e feat: ajouter la page de chat et configurer les routes associées 2025-12-18 22:47:11 +01:00
4bbf401636 Merge pull request #11 from ArthurDanjou/fix_activity
fix: supprimer les commentaires eslint inutiles dans la configuration…
2025-12-18 21:52:06 +01:00
dc04539d1e fix: supprimer l'événement de pull_request dans la configuration de déploiement Cloudflare 2025-12-18 21:48:11 +01:00
2ffffe3e32 fix: supprimer les commentaires eslint inutiles dans la configuration du worker 2025-12-18 21:44:34 +01:00
55b79f0dc2 fix: mettre à jour la configuration de déploiement Cloudflare et ajuster les règles de route pour l'API 2025-12-18 21:38:34 +01:00
80c88466d3 fix: ajuster l'intervalle de rafraîchissement des activités et ajouter des règles de route pour l'API 2025-12-18 21:30:30 +01:00
59bcfbd248 fix: corriger le répertoire de sortie de construction des pages dans la configuration de wrangler 2025-12-18 21:22:06 +01:00
041c25d1fd fix: corriger le nom de déploiement pour Cloudflare Pages et nettoyer la configuration de wrangler 2025-12-18 21:17:26 +01:00
442cab6026 fix: supprimer les configurations inutilisées et ajouter une nouvelle entrée de navigation pour le chat 2025-12-18 21:07:27 +01:00
2e5cdde145 fix: ajouter la configuration de pré-rendu pour les pages et nettoyer les annotations ESLint 2025-12-18 21:01:09 +01:00
11 changed files with 73 additions and 58 deletions

View File

@@ -1,9 +1,14 @@
name: Deploy to Cloudflare Workers
name: Deploy to Cloudflare Pages
on:
push:
branches:
- master
- '**'
permissions:
contents: read
deployments: write
pull-requests: write
jobs:
deploy:
@@ -35,12 +40,14 @@ jobs:
STUDIO_GITHUB_CLIENT_ID: ${{ vars.STUDIO_GITHUB_CLIENT_ID }}
STUDIO_GITHUB_CLIENT_SECRET: ${{ vars.STUDIO_GITHUB_CLIENT_SECRET }}
- name: Publish to Cloudflare Workers
- name: Publish to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy
command: pages deploy --branch=${{ env.BRANCH_NAME }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

View File

@@ -5,9 +5,11 @@ import { activityMessages, IDEs } from '~~/types'
const { locale, locales, t } = useI18n({ useScope: 'local' })
const { data: activity, refresh } = await useAsyncData<Activity>('activity', () => $fetch('/api/activity'))
const { data: activity, refresh } = await useAsyncData<Activity>('activity', () => $fetch('/api/activity'),
{ lazy: true }
)
useIntervalFn(refresh, 5000)
useIntervalFn(refresh, 1000)
const codingActivities = computed(() => {
const list = activity.value?.data.activities ?? []

13
app/pages/chat.vue Normal file
View File

@@ -0,0 +1,13 @@
<script lang="ts" setup>
</script>
<template>
<div>
CHAT
</div>
</template>
<style scoped>
</style>

View File

@@ -73,13 +73,6 @@ export default defineNuxtConfig({
i18n: {
strategy: 'no_prefix',
compilation: {
strictMessage: false,
},
bundle: {
fullInstall: false,
dropMessageCompiler: true,
},
locales: [
{
label: 'English',
@@ -103,8 +96,22 @@ export default defineNuxtConfig({
defaultLocale: 'en',
},
routeRules: {
'/api/activity': {
proxy: `${process.env.NUXT_API_URL}/api/activity`
},
'/api/stats': {
proxy: `${process.env.NUXT_API_URL}/api/stats`
}
},
nitro: {
preset: 'cloudflare_pages',
prerender: {
routes: ['/'],
crawlLinks: true,
}
},
runtimeConfig: {
@@ -117,4 +124,8 @@ export default defineNuxtConfig({
},
},
},
experimental: {
viewTransition: true
},
})

View File

@@ -1,4 +0,0 @@
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig(event)
return await $fetch(`${config.api.url}/api/activity`)
})

View File

@@ -1,4 +0,0 @@
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig(event)
return await $fetch(`${config.api.url}/api/stats`)
})

View File

@@ -1,3 +0,0 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}

View File

@@ -1,3 +1,17 @@
{
"extends": "./.nuxt/tsconfig.json"
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}

View File

@@ -123,21 +123,6 @@ export const activityMessages: Record<'en' | 'fr' | 'es', ActivityMessages> = {
},
}
export interface Tag {
label: string
title?: string
translation: string
}
export const TAGS: readonly Tag[] = [
{ label: 'R', translation: 'tags.r' },
{ label: 'AI', translation: 'tags.ai' },
{ label: 'Data', translation: 'tags.data' },
{ label: 'Web', translation: 'tags.web' },
{ label: 'Python', translation: 'tags.python' },
{ label: 'Maths', translation: 'tags.maths' },
] as const
export const socials = [
{ icon: 'i-ph-x-logo-duotone', label: 'Twitter', to: 'https://twitter.com/ArthurDanj' },
{ icon: 'i-ph-github-logo-duotone', label: 'GitHub', to: 'https://github.com/ArthurDanjou' },
@@ -156,6 +141,7 @@ interface Nav {
export const navs: readonly Nav[] = [
{ label: { en: 'home', fr: 'accueil', es: 'inicio' }, to: '/', icon: 'house-duotone' },
{ label: { en: 'chat', fr: 'chat', es: 'chat' }, to: '/chat', icon: 'chat-circle-dots-duotone' },
{
label: { en: 'resume', fr: 'cv', es: 'currículum' },
icon: 'address-book-duotone',

View File

@@ -1,6 +1,6 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: 889e96b9a6e7cd90ad202f69774b6cc7)
// Runtime types generated with workerd@1.20251217.0 2025-12-13 nodejs_compat
// Generated by Wrangler by running `wrangler types` (hash: 9ebceff030e512b05e46edbb174bea44)
// Runtime types generated with workerd@1.20251217.0 2025-12-13
declare namespace Cloudflare {
interface Env {
CACHE: KVNamespace;
@@ -12,12 +12,6 @@ declare namespace Cloudflare {
}
}
interface Env extends Cloudflare.Env {}
type StringifyValues<EnvType extends Record<string, unknown>> = {
[Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
};
declare namespace NodeJS {
interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "NUXT_PUBLIC_I18N_BASE_URL" | "NUXT_API_URL" | "STUDIO_GITHUB_CLIENT_ID" | "STUDIO_GITHUB_CLIENT_SECRET">> {}
}
// Begin runtime types
/*! *****************************************************************************
@@ -8599,7 +8593,7 @@ type AIGatewayHeaders = {
[key: string]: string | number | boolean | object;
};
type AIGatewayUniversalRequest = {
provider: AIGatewayProviders | string; // eslint-disable-line
provider: AIGatewayProviders | string;
endpoint: string;
headers: Partial<AIGatewayHeaders>;
query: unknown;
@@ -8615,7 +8609,7 @@ declare abstract class AiGateway {
gateway?: UniversalGatewayOptions;
extraHeaders?: object;
}): Promise<Response>;
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
getUrl(provider?: AIGatewayProviders | string): Promise<string>;
}
interface AutoRAGInternalError extends Error {
}

View File

@@ -2,12 +2,7 @@
"$schema": "node_modules/wrangler/config-schema.json",
"name": "artsite",
"compatibility_date": "2025-12-13",
"compatibility_flags": [
"nodejs_compat"
],
"placement": {
"mode": "smart"
},
"pages_build_output_dir": "dist/public",
"d1_databases": [
{
"binding": "DB",
@@ -19,5 +14,9 @@
"binding": "CACHE",
"id": "f0766ace1d24423ba6e5cac4fb8f2054"
}
]
],
"ai": {
"binding": "AI",
"remote": true
}
}