xonyis-stater-next
v0.1.13
Published
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
Readme
This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npx xonyis-stater-next nom-du-projet
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Configuration de la Base de Données MySQL
Ce projet utilise Prisma pour la gestion de la base de données MySQL.
1. Configuration de la connexion
Créez un fichier .env à la racine du projet avec votre URL de connexion MySQL :
DATABASE_URL="mysql://user:password@localhost:3306/database_name"Remplacez :
user: votre nom d'utilisateur MySQLpassword: votre mot de passe MySQLlocalhost:3306: l'adresse et le port de votre serveur MySQLdatabase_name: le nom de votre base de données
2. Définir vos modèles
Éditez le fichier prisma/schema.prisma pour définir vos modèles de données.
3. Générer le client Prisma
npm run db:generate4. Appliquer les migrations
npm run db:migrateOu pour synchroniser le schéma sans migrations :
npm run db:push5. Ouvrir Prisma Studio (interface graphique)
npm run db:studioUtilisation dans votre code
Importez le client Prisma depuis @/lib/db :
import { prisma } from "@/lib/db";
// Exemple d'utilisation
const users = await prisma.user.findMany();Un exemple d'API route est disponible dans src/app/api/example/route.ts.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
