From acce5666e549d8245e1a7603016992b96e423cf8 Mon Sep 17 00:00:00 2001 From: Sonny Date: Mon, 24 Apr 2023 23:24:58 +0200 Subject: [PATCH] docs: add setup dev & prod --- README.md | 45 +++++++++++++++++++++------------------------ example.env | 2 +- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b12f3e3..bd737eb 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,31 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +# Setup -## Getting Started +Créer un fichier .env et éditer les valeurs -First, run the development server: - -```bash -npm run dev -# or -yarn dev +``` +cp example.env .env ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## Dev -You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. +Laisser la variable d'environnement `DATABASE_URL` -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. +``` +cd docker +make start-dev +cd .. +npx prisma db push +npm run dev +``` -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. +## Prod -## Learn More +Retirer la variable d'environnement `DATABASE_URL` si vous souhaitez utiliser la DB dans le docker/docker-compose.yml -To learn more about Next.js, take a look at the following resources: +``` +cd docker +make build +make start-prod +``` -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. +(migrations automatiques) diff --git a/example.env b/example.env index 14f2f1b..0cdedbe 100644 --- a/example.env +++ b/example.env @@ -1,5 +1,5 @@ MYSQL_USER="my_user" -MYSQL_PASSWORD="" +MYSQL_PASSWORD="root" MYSQL_DATABASE="my-links" MYSQL_ROOT_PASSWORD="root"