From 28a6fb7a316771ee4795ec3929fe8664c034af7e Mon Sep 17 00:00:00 2001 From: Arthur Wambst Date: Sun, 13 Apr 2025 02:42:16 +0200 Subject: [PATCH] fast late first push --- .gitignore | 36 ++++++++++ README.md | 6 ++ la-banquise/.dockerignore | 4 ++ la-banquise/.gitignore | 6 ++ la-banquise/Dockerfile | 22 ++++++ la-banquise/README.md | 87 ++++++++++++++++++++++++ la-banquise/app/app.css | 15 +++++ la-banquise/app/root.tsx | 75 +++++++++++++++++++++ la-banquise/app/routes.ts | 3 + la-banquise/app/routes/home.tsx | 13 ++++ la-banquise/app/welcome/logo-dark.svg | 23 +++++++ la-banquise/app/welcome/logo-light.svg | 23 +++++++ la-banquise/app/welcome/welcome.tsx | 89 +++++++++++++++++++++++++ la-banquise/index.html | 13 ++++ la-banquise/package.json | 23 +++++++ la-banquise/postcss.config.js | 7 ++ la-banquise/public/favicon.ico | Bin 0 -> 15086 bytes la-banquise/react-router.config.ts | 7 ++ la-banquise/src/App.css | 5 ++ la-banquise/src/App.jsx | 21 ++++++ la-banquise/src/components/Iceberg.jsx | 28 ++++++++ la-banquise/src/index.css | 12 ++++ la-banquise/src/index.html | 12 ++++ la-banquise/src/main.jsx | 15 +++++ la-banquise/tailwind.config.js | 22 ++++++ la-banquise/tsconfig.json | 27 ++++++++ la-banquise/vite.config.ts | 15 +++++ shell.nix | 15 +++++ 28 files changed, 624 insertions(+) create mode 100644 .gitignore create mode 100644 la-banquise/.dockerignore create mode 100644 la-banquise/.gitignore create mode 100644 la-banquise/Dockerfile create mode 100644 la-banquise/README.md create mode 100644 la-banquise/app/app.css create mode 100644 la-banquise/app/root.tsx create mode 100644 la-banquise/app/routes.ts create mode 100644 la-banquise/app/routes/home.tsx create mode 100644 la-banquise/app/welcome/logo-dark.svg create mode 100644 la-banquise/app/welcome/logo-light.svg create mode 100644 la-banquise/app/welcome/welcome.tsx create mode 100644 la-banquise/index.html create mode 100644 la-banquise/package.json create mode 100644 la-banquise/postcss.config.js create mode 100644 la-banquise/public/favicon.ico create mode 100644 la-banquise/react-router.config.ts create mode 100644 la-banquise/src/App.css create mode 100644 la-banquise/src/App.jsx create mode 100644 la-banquise/src/components/Iceberg.jsx create mode 100644 la-banquise/src/index.css create mode 100644 la-banquise/src/index.html create mode 100644 la-banquise/src/main.jsx create mode 100644 la-banquise/tailwind.config.js create mode 100644 la-banquise/tsconfig.json create mode 100644 la-banquise/vite.config.ts create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b20434 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +# dependencies +/node_modules + +# build output +/dist +/.vite + +# dotenv environment files (si tu en as) +.env +.env.*.local + +# system files +.DS_Store +Thumbs.db + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# editor stuff +.vscode +.idea +*.swp +*.swo + +# OS junk +*.log + +# optional: nix store link if using nix develop +.result + +# optional: lockfiles you don't use +package-lock.json + diff --git a/README.md b/README.md index 2f89e0d..c38c432 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # website-front +On nix : +nix-shell +To run the dev env : + +cd la-banquise +npm run dev diff --git a/la-banquise/.dockerignore b/la-banquise/.dockerignore new file mode 100644 index 0000000..9b8d514 --- /dev/null +++ b/la-banquise/.dockerignore @@ -0,0 +1,4 @@ +.react-router +build +node_modules +README.md \ No newline at end of file diff --git a/la-banquise/.gitignore b/la-banquise/.gitignore new file mode 100644 index 0000000..9b7c041 --- /dev/null +++ b/la-banquise/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +/node_modules/ + +# React Router +/.react-router/ +/build/ diff --git a/la-banquise/Dockerfile b/la-banquise/Dockerfile new file mode 100644 index 0000000..207bf93 --- /dev/null +++ b/la-banquise/Dockerfile @@ -0,0 +1,22 @@ +FROM node:20-alpine AS development-dependencies-env +COPY . /app +WORKDIR /app +RUN npm ci + +FROM node:20-alpine AS production-dependencies-env +COPY ./package.json package-lock.json /app/ +WORKDIR /app +RUN npm ci --omit=dev + +FROM node:20-alpine AS build-env +COPY . /app/ +COPY --from=development-dependencies-env /app/node_modules /app/node_modules +WORKDIR /app +RUN npm run build + +FROM node:20-alpine +COPY ./package.json package-lock.json /app/ +COPY --from=production-dependencies-env /app/node_modules /app/node_modules +COPY --from=build-env /app/build /app/build +WORKDIR /app +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/la-banquise/README.md b/la-banquise/README.md new file mode 100644 index 0000000..5c4780a --- /dev/null +++ b/la-banquise/README.md @@ -0,0 +1,87 @@ +# Welcome to React Router! + +A modern, production-ready template for building full-stack React applications using React Router. + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/remix-run/react-router-templates/tree/main/default) + +## Features + +- 🚀 Server-side rendering +- ⚡️ Hot Module Replacement (HMR) +- 📦 Asset bundling and optimization +- 🔄 Data loading and mutations +- 🔒 TypeScript by default +- 🎉 TailwindCSS for styling +- 📖 [React Router docs](https://reactrouter.com/) + +## Getting Started + +### Installation + +Install the dependencies: + +```bash +npm install +``` + +### Development + +Start the development server with HMR: + +```bash +npm run dev +``` + +Your application will be available at `http://localhost:5173`. + +## Building for Production + +Create a production build: + +```bash +npm run build +``` + +## Deployment + +### Docker Deployment + +To build and run using Docker: + +```bash +docker build -t my-app . + +# Run the container +docker run -p 3000:3000 my-app +``` + +The containerized application can be deployed to any platform that supports Docker, including: + +- AWS ECS +- Google Cloud Run +- Azure Container Apps +- Digital Ocean App Platform +- Fly.io +- Railway + +### DIY Deployment + +If you're familiar with deploying Node applications, the built-in app server is production-ready. + +Make sure to deploy the output of `npm run build` + +``` +├── package.json +├── package-lock.json (or pnpm-lock.yaml, or bun.lockb) +├── build/ +│ ├── client/ # Static assets +│ └── server/ # Server-side code +``` + +## Styling + +This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer. + +--- + +Built with ❤️ using React Router. diff --git a/la-banquise/app/app.css b/la-banquise/app/app.css new file mode 100644 index 0000000..99345d8 --- /dev/null +++ b/la-banquise/app/app.css @@ -0,0 +1,15 @@ +@import "tailwindcss"; + +@theme { + --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} + +html, +body { + @apply bg-white dark:bg-gray-950; + + @media (prefers-color-scheme: dark) { + color-scheme: dark; + } +} diff --git a/la-banquise/app/root.tsx b/la-banquise/app/root.tsx new file mode 100644 index 0000000..9fc6636 --- /dev/null +++ b/la-banquise/app/root.tsx @@ -0,0 +1,75 @@ +import { + isRouteErrorResponse, + Links, + Meta, + Outlet, + Scripts, + ScrollRestoration, +} from "react-router"; + +import type { Route } from "./+types/root"; +import "./app.css"; + +export const links: Route.LinksFunction = () => [ + { rel: "preconnect", href: "https://fonts.googleapis.com" }, + { + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossOrigin: "anonymous", + }, + { + rel: "stylesheet", + href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap", + }, +]; + +export function Layout({ children }: { children: React.ReactNode }) { + return ( + + + + + + + + + {children} + + + + + ); +} + +export default function App() { + return ; +} + +export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { + let message = "Oops!"; + let details = "An unexpected error occurred."; + let stack: string | undefined; + + if (isRouteErrorResponse(error)) { + message = error.status === 404 ? "404" : "Error"; + details = + error.status === 404 + ? "The requested page could not be found." + : error.statusText || details; + } else if (import.meta.env.DEV && error && error instanceof Error) { + details = error.message; + stack = error.stack; + } + + return ( +
+

{message}

+

{details}

+ {stack && ( +
+          {stack}
+        
+ )} +
+ ); +} diff --git a/la-banquise/app/routes.ts b/la-banquise/app/routes.ts new file mode 100644 index 0000000..102b402 --- /dev/null +++ b/la-banquise/app/routes.ts @@ -0,0 +1,3 @@ +import { type RouteConfig, index } from "@react-router/dev/routes"; + +export default [index("routes/home.tsx")] satisfies RouteConfig; diff --git a/la-banquise/app/routes/home.tsx b/la-banquise/app/routes/home.tsx new file mode 100644 index 0000000..398e47c --- /dev/null +++ b/la-banquise/app/routes/home.tsx @@ -0,0 +1,13 @@ +import type { Route } from "./+types/home"; +import { Welcome } from "../welcome/welcome"; + +export function meta({}: Route.MetaArgs) { + return [ + { title: "New React Router App" }, + { name: "description", content: "Welcome to React Router!" }, + ]; +} + +export default function Home() { + return ; +} diff --git a/la-banquise/app/welcome/logo-dark.svg b/la-banquise/app/welcome/logo-dark.svg new file mode 100644 index 0000000..dd82028 --- /dev/null +++ b/la-banquise/app/welcome/logo-dark.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/la-banquise/app/welcome/logo-light.svg b/la-banquise/app/welcome/logo-light.svg new file mode 100644 index 0000000..7328492 --- /dev/null +++ b/la-banquise/app/welcome/logo-light.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/la-banquise/app/welcome/welcome.tsx b/la-banquise/app/welcome/welcome.tsx new file mode 100644 index 0000000..8ac6e1d --- /dev/null +++ b/la-banquise/app/welcome/welcome.tsx @@ -0,0 +1,89 @@ +import logoDark from "./logo-dark.svg"; +import logoLight from "./logo-light.svg"; + +export function Welcome() { + return ( +
+
+
+
+ React Router + React Router +
+
+
+ +
+
+
+ ); +} + +const resources = [ + { + href: "https://reactrouter.com/docs", + text: "React Router Docs", + icon: ( + + + + ), + }, + { + href: "https://rmx.as/discord", + text: "Join Discord", + icon: ( + + + + ), + }, +]; diff --git a/la-banquise/index.html b/la-banquise/index.html new file mode 100644 index 0000000..7dedc4b --- /dev/null +++ b/la-banquise/index.html @@ -0,0 +1,13 @@ + + + + + + La Banquise + + +
+ + + + diff --git a/la-banquise/package.json b/la-banquise/package.json new file mode 100644 index 0000000..e730048 --- /dev/null +++ b/la-banquise/package.json @@ -0,0 +1,23 @@ +{ + "name": "la-banquise", + "version": "1.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "@vitejs/plugin-react": "^4.3.4", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-router-dom": "^7.5.0" + }, + "devDependencies": { + "@vitejs/plugin-react": "^4.3.4", + "autoprefixer": "^10.4.12", + "postcss": "^8.4.18", + "tailwindcss": "^3.2.0", + "vite": "^4.0.0", + "vite-plugin-pages": "^0.33.0" + } +} diff --git a/la-banquise/postcss.config.js b/la-banquise/postcss.config.js new file mode 100644 index 0000000..1d5ee78 --- /dev/null +++ b/la-banquise/postcss.config.js @@ -0,0 +1,7 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {} + } +} + diff --git a/la-banquise/public/favicon.ico b/la-banquise/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5dbdfcddcb14182535f6d32d1c900681321b1aa3 GIT binary patch literal 15086 zcmeI33v3ic7{|AFEmuJ-;v>ep_G*NPi6KM`qNryCe1PIJ8siIN1WZ(7qVa)RVtmC% z)Ch?tN+afMKm;5@rvorJk zcXnoOc4q51HBQnQH_jn!cAg&XI1?PlX>Kl^k8qq0;zkha`kY$Fxt#=KNJAE9CMdpW zqr4#g8`nTw191(+H4xW8Tmyru2I^3=J1G3emPxkPXA=3{vvuvse_WWSshqaqls^-m zgB7q8&Vk*aYRe?sn$n53dGH#%3y%^vxv{pL*-h0Z4bmb_(k6{FL7HWIz(V*HT#IcS z-wE{)+0x1U!RUPt3gB97%p}@oHxF4|6S*+Yw=_tLtxZ~`S=z6J?O^AfU>7qOX`JNBbV&8+bO0%@fhQitKIJ^O^ zpgIa__qD_y07t@DFlBJ)8SP_#^j{6jpaXt{U%=dx!qu=4u7^21lWEYHPPY5U3TcoQ zX_7W+lvZi>TapNk_X>k-KO%MC9iZp>1E`N34gHKd9tK&){jq2~7OsJ>!G0FzxQFw6G zm&Vb(2#-T|rM|n3>uAsG_hnbvUKFf3#ay@u4uTzia~NY%XgCHfx4^To4BDU@)HlV? z@EN=g^ymETa1sQK{kRwyE4Ax8?wT&GvaG@ASO}{&a17&^v`y z!oPdiSiia^oov(Z)QhG2&|FgE{M9_4hJROGbnj>#$~ZF$-G^|zPj*QApltKe?;u;uKHJ~-V!=VLkg7Kgct)l7u39f@%VG8e3f$N-B zAu3a4%ZGf)r+jPAYCSLt73m_J3}p>}6Tx0j(wg4vvKhP!DzgiWANiE;Ppvp}P2W@m z-VbYn+NXFF?6ngef5CfY6ZwKnWvNV4z6s^~yMXw2i5mv}jC$6$46g?G|CPAu{W5qF zDobS=zb2ILX9D827g*NtGe5w;>frjanY{f)hrBP_2ehBt1?`~ypvg_Ot4x1V+43P@Ve8>qd)9NX_jWdLo`Zfy zoeam9)@Dpym{4m@+LNxXBPjPKA7{3a&H+~xQvr>C_A;7=JrfK~$M2pCh>|xLz>W6SCs4qC|#V`)# z)0C|?$o>jzh<|-cpf

K7osU{Xp5PG4-K+L2G=)c3f&}H&M3wo7TlO_UJjQ-Oq&_ zjAc9=nNIYz{c3zxOiS5UfcE1}8#iI4@uy;$Q7>}u`j+OU0N<*Ezx$k{x_27+{s2Eg z`^=rhtIzCm!_UcJ?Db~Lh-=_))PT3{Q0{Mwdq;0>ZL%l3+;B&4!&xm#%HYAK|;b456Iv&&f$VQHf` z>$*K9w8T+paVwc7fLfMlhQ4)*zL_SG{~v4QR;IuX-(oRtYAhWOlh`NLoX0k$RUYMi z2Y!bqpdN}wz8q`-%>&Le@q|jFw92ErW-hma-le?S z-@OZt2EEUm4wLsuEMkt4zlyy29_3S50JAcQHTtgTC{P~%-mvCTzrjXOc|{}N`Cz`W zSj7CrXfa7lcsU0J(0uSX6G`54t^7}+OLM0n(|g4waOQ}bd3%!XLh?NX9|8G_|06Ie zD5F1)w5I~!et7lA{G^;uf7aqT`KE&2qx9|~O;s6t!gb`+zVLJyT2T)l*8l(j literal 0 HcmV?d00001 diff --git a/la-banquise/react-router.config.ts b/la-banquise/react-router.config.ts new file mode 100644 index 0000000..6ff16f9 --- /dev/null +++ b/la-banquise/react-router.config.ts @@ -0,0 +1,7 @@ +import type { Config } from "@react-router/dev/config"; + +export default { + // Config options... + // Server-side render by default, to enable SPA mode set this to `false` + ssr: true, +} satisfies Config; diff --git a/la-banquise/src/App.css b/la-banquise/src/App.css new file mode 100644 index 0000000..c1506c7 --- /dev/null +++ b/la-banquise/src/App.css @@ -0,0 +1,5 @@ +body { + background: linear-gradient(#002244, #004466); + overflow: hidden; +} + diff --git a/la-banquise/src/App.jsx b/la-banquise/src/App.jsx new file mode 100644 index 0000000..57f9482 --- /dev/null +++ b/la-banquise/src/App.jsx @@ -0,0 +1,21 @@ +import Iceberg from './components/Iceberg'; + +const icebergsData = [ + { href: '/service1', top: '20%', left: '10%' }, + { href: '/service2', top: '40%', left: '70%' }, + { href: '/service3', top: '60%', left: '30%' }, + { href: '/service4', top: '75%', left: '55%' }, +]; + +function App() { + return ( +

+ {icebergsData.map((iceberg, index) => ( + + ))} +
+ ); +} + +export default App; + diff --git a/la-banquise/src/components/Iceberg.jsx b/la-banquise/src/components/Iceberg.jsx new file mode 100644 index 0000000..c10f97f --- /dev/null +++ b/la-banquise/src/components/Iceberg.jsx @@ -0,0 +1,28 @@ +const Iceberg = ({ href, style }) => { + return ( + + + + + + ); +}; + +export default Iceberg; + diff --git a/la-banquise/src/index.css b/la-banquise/src/index.css new file mode 100644 index 0000000..de147e5 --- /dev/null +++ b/la-banquise/src/index.css @@ -0,0 +1,12 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* Fond océan pour l'ensemble du site */ +body { + background: linear-gradient(180deg, #1e3c72, #2a5298); + min-height: 100vh; + margin: 0; + font-family: Arial, sans-serif; +} + diff --git a/la-banquise/src/index.html b/la-banquise/src/index.html new file mode 100644 index 0000000..de58d31 --- /dev/null +++ b/la-banquise/src/index.html @@ -0,0 +1,12 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* Fond océan pour l'ensemble du site */ +body { + background: linear-gradient(180deg, #1e3c72, #2a5298); + min-height: 100vh; + margin: 0; + font-family: 'Arial', sans-serif; +} + diff --git a/la-banquise/src/main.jsx b/la-banquise/src/main.jsx new file mode 100644 index 0000000..7ce3ed0 --- /dev/null +++ b/la-banquise/src/main.jsx @@ -0,0 +1,15 @@ +// src/main.jsx +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import { BrowserRouter } from 'react-router-dom'; +import App from './App'; +import './index.css'; + +ReactDOM.createRoot(document.getElementById('root')).render( + + + + + +); + diff --git a/la-banquise/tailwind.config.js b/la-banquise/tailwind.config.js new file mode 100644 index 0000000..f8262f8 --- /dev/null +++ b/la-banquise/tailwind.config.js @@ -0,0 +1,22 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + "./index.html", + "./src/**/*.{js,jsx}" + ], + theme: { + extend: { + keyframes: { + float: { + '0%, 100%': { transform: 'translateY(0)' }, + '50%': { transform: 'translateY(-10px)' }, + }, + }, + animation: { + float: 'float 4s ease-in-out infinite', + }, + }, + }, + plugins: [], +} + diff --git a/la-banquise/tsconfig.json b/la-banquise/tsconfig.json new file mode 100644 index 0000000..dc391a4 --- /dev/null +++ b/la-banquise/tsconfig.json @@ -0,0 +1,27 @@ +{ + "include": [ + "**/*", + "**/.server/**/*", + "**/.client/**/*", + ".react-router/types/**/*" + ], + "compilerOptions": { + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "types": ["node", "vite/client"], + "target": "ES2022", + "module": "ES2022", + "moduleResolution": "bundler", + "jsx": "react-jsx", + "rootDirs": [".", "./.react-router/types"], + "baseUrl": ".", + "paths": { + "~/*": ["./app/*"] + }, + "esModuleInterop": true, + "verbatimModuleSyntax": true, + "noEmit": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true + } +} diff --git a/la-banquise/vite.config.ts b/la-banquise/vite.config.ts new file mode 100644 index 0000000..0087b50 --- /dev/null +++ b/la-banquise/vite.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import Pages from 'vite-plugin-pages'; + +export default defineConfig({ + plugins: [ + react(), + // Plugin pour générer automatiquement les routes basées sur les fichiers dans src/pages + Pages({ + extensions: ['jsx', 'tsx'], // Extensions reconnues pour les pages + // Vous pouvez ajouter d'autres options ici (path route, etc.) + }) + ] +}); + diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..9c86acf --- /dev/null +++ b/shell.nix @@ -0,0 +1,15 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = [ + pkgs.nodejs_23 + pkgs.nodePackages.tailwindcss + pkgs.nodePackages.postcss + pkgs.nodePackages.autoprefixer + ]; + + shellHook = '' + echo "✅ Environnement Node.js avec Tailwind, PostCSS et Autoprefixer prêt !" + ''; +} +