feat: initialization migration to Nuxt + Backend
This commit initializes both the Nuxt frontend and the Rust backend of the new version of phundrak.com
This commit is contained in:
0
frontend/.volarrc
Normal file
0
frontend/.volarrc
Normal file
109
frontend/README.org
Normal file
109
frontend/README.org
Normal file
@@ -0,0 +1,109 @@
|
||||
#+title: phundrak.com frontend
|
||||
#+author: Lucien Cartier-Tilet
|
||||
#+email: lucien@phundrak.com
|
||||
|
||||
This is the frontend of =phundrak.com=, written with Nuxt.
|
||||
|
||||
* Setup
|
||||
|
||||
** Environment
|
||||
*** Nix Environment
|
||||
If you use Nix, you can set up your environment using the [[file:flake.nix][=flake.nix=]]
|
||||
file, which will give you the exact same development environment as I
|
||||
use.
|
||||
|
||||
#+begin_src bash
|
||||
nix develop
|
||||
#+end_src
|
||||
|
||||
If you have [[https://direnv.net/][=direnv=]] installed, you can simply use it to automatically
|
||||
enable this environment. However, I *strongly* recommend you to read the
|
||||
content of the =flake.nix= file before doing so, as you should with any
|
||||
Nix-defined environment you did not create.
|
||||
|
||||
#+begin_src bash
|
||||
direnv allow .
|
||||
#+end_src
|
||||
|
||||
*** Required Tools
|
||||
To be able to work on this project, you need a Javascript package
|
||||
manager, such as:
|
||||
- =npm=
|
||||
- =pnpm= (recommended)
|
||||
- =yarn=
|
||||
- =bun=
|
||||
|
||||
In my case, I use pnpm.
|
||||
|
||||
You can skip this if you are already using my Nix environment.
|
||||
|
||||
** Dependencies
|
||||
Once you have your environment ready, you can now install the
|
||||
project’s dependencies.
|
||||
|
||||
#+begin_src bash
|
||||
# npm
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install
|
||||
|
||||
# yarn
|
||||
yarn install
|
||||
|
||||
# bun
|
||||
bun install
|
||||
#+end_src
|
||||
|
||||
* Running the Project
|
||||
You are now ready to start the development server on
|
||||
=http://localhost:3000=.
|
||||
|
||||
#+begin_src bash
|
||||
# npm
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm dev
|
||||
|
||||
# yarn
|
||||
yarn dev
|
||||
|
||||
# bun
|
||||
bun run dev
|
||||
#+end_src
|
||||
|
||||
* Production
|
||||
Once you are satisfied with the project, you can build the application in production mode.
|
||||
|
||||
#+begin_src bash
|
||||
# npm
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm build
|
||||
|
||||
# yarn
|
||||
yarn build
|
||||
|
||||
# bun
|
||||
bun run build
|
||||
#+end_src
|
||||
|
||||
You can preview locally the production build too.
|
||||
|
||||
#+begin_src bash
|
||||
# npm
|
||||
npm run preview
|
||||
|
||||
# pnpm
|
||||
pnpm preview
|
||||
|
||||
# yarn
|
||||
yarn preview
|
||||
|
||||
# bun
|
||||
bun run preview
|
||||
#+end_src
|
||||
|
||||
Check out the [[https://nuxt.com/docs/getting-started/deployment][deployment documentation]] for more information.
|
||||
5
frontend/app/app.vue
Normal file
5
frontend/app/app.vue
Normal file
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Nuxt works!</h1>
|
||||
</div>
|
||||
</template>
|
||||
11
frontend/components/Navbar.vue
Normal file
11
frontend/components/Navbar.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<nav>
|
||||
<!-- Your navbar content here -->
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
34
frontend/content.config.ts
Normal file
34
frontend/content.config.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defineCollection, defineContentConfig } from '@nuxt/content';
|
||||
import { z } from 'zod';
|
||||
z;
|
||||
|
||||
const commonSchema = z.object({});
|
||||
|
||||
export default defineContentConfig({
|
||||
collections: {
|
||||
content_en: defineCollection({
|
||||
type: 'page',
|
||||
source: {
|
||||
include: 'en/**',
|
||||
prefix: '',
|
||||
},
|
||||
schema: commonSchema,
|
||||
}),
|
||||
content_fr: defineCollection({
|
||||
type: 'page',
|
||||
source: {
|
||||
include: 'fr/**',
|
||||
prefix: '',
|
||||
},
|
||||
schema: commonSchema,
|
||||
}),
|
||||
content_lfn: defineCollection({
|
||||
type: 'page',
|
||||
source: {
|
||||
include: 'lfn/**',
|
||||
prefix: '',
|
||||
},
|
||||
schema: commonSchema,
|
||||
}),
|
||||
},
|
||||
});
|
||||
6
frontend/eslint.config.mjs
Normal file
6
frontend/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
|
||||
)
|
||||
15
frontend/i18n.config.ts
Normal file
15
frontend/i18n.config.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export default defineI18nConfig(() => ({
|
||||
legacy: false,
|
||||
locale: 'en',
|
||||
messages: {
|
||||
en: {
|
||||
welcome: 'Welcome',
|
||||
},
|
||||
fr: {
|
||||
welcome: 'Bienvenue',
|
||||
},
|
||||
lfn: {
|
||||
welcome: 'Bonveni',
|
||||
},
|
||||
},
|
||||
}));
|
||||
44
frontend/nuxt.config.ts
Normal file
44
frontend/nuxt.config.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: {
|
||||
enabled: true,
|
||||
vueDevTools: true,
|
||||
telemetry: false,
|
||||
},
|
||||
|
||||
modules: [
|
||||
'@nuxt/content',
|
||||
'@nuxt/eslint',
|
||||
'@nuxt/image',
|
||||
'@nuxt/test-utils',
|
||||
'@nuxt/ui',
|
||||
'@vueuse/nuxt',
|
||||
'@nuxtjs/i18n',
|
||||
'@nuxtjs/turnstile',
|
||||
],
|
||||
|
||||
content: {
|
||||
database: {
|
||||
type: 'sqlite',
|
||||
filename: '.data/content/contents.sqlite',
|
||||
},
|
||||
},
|
||||
i18n: {
|
||||
locales: [
|
||||
{ code: 'en', name: 'English', language: 'en-UK' },
|
||||
{ code: 'fr', name: 'Français', language: 'fr-FR' },
|
||||
{ code: 'lfn', name: 'Lingua Franca Nova', language: 'lfn' },
|
||||
],
|
||||
strategy: 'prefix_except_default',
|
||||
defaultLocale: 'en',
|
||||
},
|
||||
turnstile: {
|
||||
siteKey: '', // Overridden by NUXT_PUBLIC_TURNSTILE_SITE_KEY
|
||||
},
|
||||
runtimeConfig: {
|
||||
turnstile: {
|
||||
secretKey: '', // Overriden by NUXT_TURNSTILE_SECRET_KEY
|
||||
},
|
||||
},
|
||||
});
|
||||
36
frontend/package.json
Normal file
36
frontend/package.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare",
|
||||
"cleanup": "nuxt cleanup"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/content": "3.8.0",
|
||||
"@nuxt/eslint": "1.10.0",
|
||||
"@nuxt/image": "1.11.0",
|
||||
"@nuxt/scripts": "^0.12.2",
|
||||
"@nuxt/test-utils": "3.20.1",
|
||||
"@nuxt/ui": "4.1.0",
|
||||
"@nuxtjs/turnstile": "1.1.1",
|
||||
"@vueuse/nuxt": "14.0.0",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"eslint": "^9.39.1",
|
||||
"nitropack": "^2.12.9",
|
||||
"nuxi": "^3.30.0",
|
||||
"nuxt": "^4.2.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.1.12",
|
||||
"vue": "^3.5.22",
|
||||
"vue-router": "^4.6.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxtjs/i18n": "^10.2.0",
|
||||
"zod": "^4.1.12"
|
||||
}
|
||||
}
|
||||
12313
frontend/pnpm-lock.yaml
generated
Normal file
12313
frontend/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
7
frontend/pnpm-workspace.yaml
Normal file
7
frontend/pnpm-workspace.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
onlyBuiltDependencies:
|
||||
- '@parcel/watcher'
|
||||
- better-sqlite3
|
||||
- esbuild
|
||||
- sharp
|
||||
- unrs-resolver
|
||||
- vue-demi
|
||||
BIN
frontend/public/favicon.ico
Normal file
BIN
frontend/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
2
frontend/public/robots.txt
Normal file
2
frontend/public/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-Agent: *
|
||||
Disallow:
|
||||
54
frontend/shell.nix
Normal file
54
frontend/shell.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
inputs.devenv.lib.mkShell {
|
||||
inherit inputs pkgs;
|
||||
modules = [
|
||||
{
|
||||
devenv.root = let
|
||||
devenvRootFileContent = builtins.readFile "${self}/.devenv-root";
|
||||
in
|
||||
pkgs.lib.mkIf (devenvRootFileContent != "") devenvRootFileContent;
|
||||
}
|
||||
{
|
||||
env.PNPM_HOME = "${self}/.pnpm-store";
|
||||
|
||||
packages = with pkgs; [
|
||||
# LSP
|
||||
nodePackages."@tailwindcss/language-server"
|
||||
vscode-langservers-extracted
|
||||
vue-language-server
|
||||
|
||||
rustywind
|
||||
nodePackages.prettier
|
||||
nodePackages.eslint
|
||||
|
||||
# Node
|
||||
nodejs_24
|
||||
nodePackages.pnpm
|
||||
|
||||
# Typescript
|
||||
typescript
|
||||
nodePackages.typescript-language-server
|
||||
];
|
||||
|
||||
enterShell = ''
|
||||
echo "🚀 Nuxt.js development environment loaded!"
|
||||
echo "📦 Node.js version: $(node --version)"
|
||||
echo "📦 pnpm version: $(pnpm --version)"
|
||||
echo ""
|
||||
echo "Available LSP servers:"
|
||||
echo " - typescript-language-server (TypeScript)"
|
||||
echo " - vue-language-server (Vue/Volar)"
|
||||
echo " - tailwindcss-language-server (Tailwind CSS)"
|
||||
echo " - vscode-langservers-extracted (HTML, CSS, JSON, ESLint)"
|
||||
echo ""
|
||||
echo "Run 'pnpm install' to install dependencies"
|
||||
echo "Run 'pnpm dev' to start the development server"
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
18
frontend/tsconfig.json
Normal file
18
frontend/tsconfig.json
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user