Skip to content

Commit

Permalink
chore: add utility npm run dev (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil authored Dec 22, 2023
1 parent 4b1c44a commit e079018
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 22 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,13 +32,15 @@ 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:

```
make f
```

You can see the static front on http://localhost:3000

## Start front end for dev
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions front/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
<link rel="icon" href="./dsfr/favicon/favicon.svg" type="image/svg+xml" />
<link
rel="shortcut icon"
href="./dsfr/favicon/favicon.ico"
href="/dsfr/favicon/favicon.ico"
type="image/x-icon"
/>
<link
rel="manifest"
href="./favicon/manifest.webmanifest"
href="/favicon/manifest.webmanifest"
crossorigin="use-credentials"
/>

<link rel="stylesheet" href="./dsfr/utility/icons/icons.min.css" />
<link rel="stylesheet" href="./dsfr/dsfr.min.css" />
<link rel="stylesheet" href="/dsfr/utility/icons/icons.min.css" />
<link rel="stylesheet" href="/dsfr/dsfr.min.css" />
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit e079018

Please sign in to comment.