From 82c4b3f2ea77014c2bdf83617a0f3b6c7133cfba Mon Sep 17 00:00:00 2001 From: Douglas DUTEIL Date: Fri, 22 Dec 2023 16:34:24 +0100 Subject: [PATCH] chore: add utility npm run dev --- .editorconfig | 21 +++++++++++++++++++++ README.md | 25 ++++++++----------------- front/index.html | 8 ++++---- front/package.json | 2 +- front/src/routes/Router.tsx | 5 +++-- package.json | 4 ++++ 6 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c2cdfb8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/README.md b/README.md index a950a16..7e5aa06 100644 --- a/README.md +++ b/README.md @@ -18,22 +18,11 @@ Install locally the application: git clone git@github.com:betagouv/espace-partenaire.git ``` -Copy back .env - -``` -cp back/.env.dist back/.env -``` - -Copy front .env - -``` -cp front/.env.dist front/.env -``` - -Install project: - -``` -make i +```sh +$ npm install +$ npm dev # will do a docker compose up ! +$ npm build +$ npm start ``` ## Start backend @@ -43,6 +32,7 @@ Launch backend ``` make sb ``` + You can access the project here : http://localhost:3000/welcome If you want to launch a the front served by the backend: @@ -50,6 +40,7 @@ If you want to launch a the front served by the backend: ``` make f ``` + You can see the static front on http://localhost:3000 ## Start front end for dev @@ -59,8 +50,8 @@ Launch the project with another node server locally (not on docker this time): ``` make sf ``` -You can access it on http://localhost:3001/ : +You can access it on http://localhost:3001/ : ## Global Architecture diff --git a/front/index.html b/front/index.html index 71c9dd2..9504936 100644 --- a/front/index.html +++ b/front/index.html @@ -10,17 +10,17 @@ - - + + diff --git a/front/package.json b/front/package.json index add2832..357ee30 100644 --- a/front/package.json +++ b/front/package.json @@ -4,7 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", + "dev": "vite build --watch", "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", diff --git a/front/src/routes/Router.tsx b/front/src/routes/Router.tsx index a3d5c5b..9c82a91 100644 --- a/front/src/routes/Router.tsx +++ b/front/src/routes/Router.tsx @@ -72,9 +72,10 @@ const router = createBrowserRouter([ path: '/dashboard/new', element: ( - + <>test + {/* - + */} ), }, diff --git a/package.json b/package.json index bdef2d8..7b910a3 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,10 @@ }, "private": true, "scripts": { + "dev": "npx npm-run-all --parallel dev:*", + "dev:front": "npm run dev --workspace front", + "dev:back": "npm run start:dev --workspace back", + "dev:database": "docker compose up", "build": "npm run build --workspaces", "start": "npm run start --workspace back" },