Déployer des sites web et apps Google AI Studio

Publie ton site web ou ton app web Google AI Studio sur Hostinger avec GitHub, et garde-le à jour.

Feuille de route et ressources

Enregistrer ton projet sur GitHub

Connecter Google AI Studio à GitHub

Ouvre le site web ou l'app web que tu as déjà créé.

Ouvrir Google AI Studio

https://aistudio.google.com

Your app in Google AI Studio Settings GitHub

Première fois ? Clique sur "Sign in to GitHub to continue" Clique sur "Install & Authorize" quand on te le demande

Settings est l'icône en forme d'engrenage en haut à droite. Déjà connecté à GitHub ? Passe à la tâche suivante.

Créer un compte GitHub

Only if you don't have one yet.

https://github.com/signup

Créer un dépôt et enregistrer

Un dépôt est le dossier de ton projet sur GitHub. Hostinger lit ton projet depuis ce dépôt.

Clique sur "Create new repository" Saisis un nom de dépôt. La description est facultative Choisis Private Clique sur "Create GitHub repository" Clique sur "Push changes to GitHub" Attends que le statut affiche "GitHub & Google AI Studio are currently in sync"

Ce message confirme que ton projet est enregistré.

Configurer Hostinger

Obtenir un hébergement Hostinger

Il te faut un plan Hostinger qui inclut les Web Apps. Tu en as déjà un ? Ouvre ton compte et passe à l'étape suivante.

Obtenir un hébergement Web App Hostinger

Choisis un plan qui inclut les Web Apps Node.js.

USED IN TUTORIAL

Créer une Web App et importer ton projet

Hostinger Websites Create website Web App

Choisis ton domaine, ou un domaine temporaire pour commencer Choisis Import your Git repository Choisis Continue with GitHub et autorise Hostinger si on te le demande Sélectionne le dépôt que tu as enregistré à l'étape 1

Hostinger peut te présenter ces choix sous forme de questions de son assistant plutôt que d'un formulaire. Les choix sont les mêmes.

Vérifier les paramètres et déployer

Vérifier les paramètres de build

Hostinger détecte automatiquement les paramètres de build de ton projet. Vérifie le framework sélectionné, puis continue si tout semble correct.

Pas sûr de tes paramètres de build ?

Facultatif. Colle ceci dans ton projet Google AI Studio et compare sa réponse avec ce que Hostinger a sélectionné. Il lit seulement tes fichiers.

Check this project's deployment settings for Hostinger. This is a read-only check. I am deploying this project to Hostinger as a Web App, imported from GitHub. Hostinger has already suggested build settings, and I want to confirm them against the real project. Inspect the actual project files: package.json, the lockfile, the build configuration and any server file. Do not guess from the preview or from how the app looks. Rules: - Do NOT change, create or delete any file. - Do NOT print the value of any API key or secret. Keep two things separate: - FRONTEND TOOLING: what builds the pages, for example Vite. - SERVER RUNTIME: whether a Node.js server must keep running in production, for example an Express server that serves the app or calls an API. If the project has a Node.js server that must keep running, the Hostinger framework preset should match that server, even when the pages are built with Vite. If there is no server, the preset should match the frontend build tool. Reply in this short format, as plain text and not JSON: Framework preset to choose in Hostinger: Needs a running Node.js backend: Yes or No, with a one-line reason Root directory: only if the app is not at the repository root Package manager: Build command: or "none needed" Server entry file: or "none" Node.js version: only if the project states one, otherwise "not specified" Mismatch to fix: anything that would break on Hostinger, or "none found" If you cannot verify a line from the files, write "not sure" instead of guessing.

Ajouter tes variables d'environnement

Aucune variable affichée ? Passe cette étape.

Vérifie les variables d'environnement détectées par Hostinger Saisis les valeurs dont ton projet a besoin Clique sur Continue

Les secrets enregistrés dans Google AI Studio ne sont pas copiés vers Hostinger : saisis-les à nouveau ici. Si ton projet utilise la Gemini API, crée une clé sur cette page :

Ouvrir Google AI Studio

API keys page

https://aistudio.google.com/apikey

IMPORTANT

Saisis les clés d'API uniquement dans Hostinger. Ne mets jamais une clé privée dans une variable qui commence par VITE_, et n'envoie jamais sur GitHub un fichier .env contenant de vraies clés.

Tu ne sais pas de quelles variables ton projet a besoin ?

Trouver les variables dont mon projet a besoin

Colle ceci dans ton projet Google AI Studio. Il liste les noms des variables que ton code lit réellement et ne modifie rien.

List the environment variables this project needs on Hostinger. This is a read-only check. Search the real source code for process.env and import.meta.env, and read any example environment file. Do not guess and do not invent names. Rules: - Do NOT change, create or delete any file. - Report variable NAMES only. Never print a value. - Do not suggest several names for the same key. Report the one name the code reads. For each variable, give one line: NAME, what it is for, Required or Optional, read on the SERVER or in BROWSER code Do not list variables the hosting platform normally sets by itself, such as NODE_ENV or PORT, unless the code cannot work without a value I must enter. Then add one last line: Private key exposed in browser code: Yes or No Answer Yes if a private key, such as a Gemini API key, is read through a VITE_ variable or otherwise ends up in code that runs in the browser.

Sortir une clé privée du code du navigateur

Utilise-le seulement si la vérification ci-dessus indique qu'une clé privée est exposée dans le code du navigateur. Les variables qui commencent par VITE_ sont intégrées à des pages que tout le monde peut lire.

A private API key in this project is read in browser code. Move it to the server so visitors can never see it. First confirm it from the real files: show me the file and line where browser code reads the key, without printing the key's value. If you cannot find one, stop and tell me. Do not change anything. If it is confirmed, make the smallest change that fixes it, and keep the design and every feature exactly as they are: - Call the API from a server route. Use the Node.js server the project already has. Add a minimal one only if there is none. - Read the key on the server from an environment variable that does NOT start with VITE_. - Make the browser code call my own server route instead of the API directly. - Remove the key from every file that is sent to the browser. Rules: - Never print the key's value. - Do not add a .env file with real keys to the repository. - Do not change unrelated code. When you finish, tell me: - the files you changed - the exact variable name to add in Hostinger - whether the project now needs a running Node.js server, so I can check the framework Hostinger selected

Déployer

Vérifie la configuration finale Clique sur Deploy Attends la fin du build Ouvre le site web en production

Si le build échoue

Copie l'erreur affichée par Hostinger, colle-la dans ce prompt et lance-le dans ton projet Google AI Studio. Ensuite, enregistre la correction sur GitHub, ou modifie le paramètre dans Hostinger et redéploie.

Corriger un déploiement qui a échoué

Trouve la vraie cause à partir de ton erreur et corrige uniquement celle-ci.

My project failed to deploy on Hostinger. I deployed it as a Web App imported from GitHub. Here is the exact error from Hostinger's build log: [PASTE THE ERROR HERE] Here is what Hostinger selected: Framework: [PASTE IT HERE] Other build settings, if you can see them: [PASTE THEM HERE, OR DELETE THIS LINE] Find the real cause from this error and the actual project files: package.json, the build configuration and any server file. Do not try random changes, and do not invent a cause the error and the files do not support. If the error is not enough to be sure, tell me what else to copy from Hostinger. - If a Hostinger setting is wrong, tell me exactly which setting to change and to what. Do not change code for that. - If the code or configuration is wrong, fix only that. Keep the design and features the same. - Do not upgrade unrelated packages. - If the log contains a key or password, do not repeat it. Never print the value of an API key or secret. Reply with: Cause: What you changed, or which Hostinger setting to change: What I should do next:

Tester et mettre à jour ton site web

Tester le site web en production

Ouvre ton site web en production et vérifie que ses pages et ses fonctionnalités principales marchent.

Si ton projet a des fonctionnalités d'IA, une connexion ou des services connectés, teste-les aussi.

Si quelque chose ne marche pas sur le site web en production

Copie le prompt qui correspond à ton problème et lance-le dans ton projet Google AI Studio. Ensuite, enregistre la correction sur GitHub.

Corriger une page vide ou blanche

Le build s'est terminé, mais le site web en production affiche une page vide.

My project deployed to Hostinger without a build error, but the live website shows a blank page. It works in the Google AI Studio preview. Find what is different in production. Check the real project files for: - errors that only happen in the production build - asset and script paths that break outside the preview, including the base path in the build configuration - a server that does not serve the built files, or serves them from the wrong folder - a server that listens on a fixed port instead of the port the hosting gives it - code that needs an environment variable which is missing in production If I paste errors from the browser console below, start from them: [PASTE ANY BROWSER CONSOLE ERRORS HERE, OR DELETE THIS LINE] Base the fix on what you find in the files and the errors, not on guesses. If you cannot tell the cause, say what else I should copy for you. Keep the design and features exactly the same, and never print the value of an API key or secret. Reply with: Cause: What you changed, or which Hostinger setting to change: What I should do next:

Corriger une fonctionnalité d'IA, la connexion ou une autre fonctionnalité

Le site web se charge, mais une fonctionnalité ne marche pas.

My project is live on Hostinger and the pages load, but this feature does not work: [DESCRIBE THE FEATURE AND WHAT HAPPENS] Any error message I can see: [PASTE IT HERE, OR DELETE THIS LINE] It works in the Google AI Studio preview. Find why it fails in production. Check the real project files for: - the environment variables this feature reads. List their NAMES so I can confirm each one has a value in Hostinger - code that depends on Google AI Studio's own environment or secrets and has no equivalent on Hostinger - API calls that need a running Node.js server, in case the project was deployed without one - addresses that point to the preview or to localhost instead of the live domain - for sign-in or outside services: settings that must list my live domain Never ask me for the value of an API key or secret, and never print one. Never move a private key into browser code or into a VITE_ variable to make the feature work. Do not invent a cause the files and the error do not support. Keep the design and other features the same. Reply with: Cause: What you changed, or what I must set in Hostinger or in the outside service: What I should do next:

Corriger une erreur 404 sur une page interne

La page d'accueil fonctionne, mais ouvrir ou actualiser une autre page affiche une erreur 404.

My project is live on Hostinger. The home page works, but opening or refreshing an inner page shows a 404 page. Inspect how this project handles routes: the router in the frontend, and the server file if there is one. - If the project runs its own Node.js server, make that server return the app's main page for routes the frontend router handles, without breaking API routes or static files. - If the project has no server, do not add one. Tell me what the hosting must do for these routes and which Hostinger setting to check. Change only what this problem needs. Keep the design and features the same. Reply with: Cause: What you changed, or which Hostinger setting to change: What I should do next:

Mettre à jour ton site web

Chaque mise à jour suit le même chemin : Google AI Studio → GitHub → Hostinger → Site web en production.

Fais une petite modification dans Google AI Studio Ouvre Settings, puis GitHub Clique sur "Push changes to GitHub" Attends que le projet soit synchronisé Attends que Hostinger déploie la mise à jour Actualise ton site web en production et vérifie la modification

Hostinger déploie la mise à jour tout seul tant que ton dépôt GitHub reste connecté et que le déploiement automatique est activé pour ta Web App.