From 748f0b43d650c00b49fca291b9d8903229dece10 Mon Sep 17 00:00:00 2001 From: Jonathan ARNAULT Date: Fri, 2 Aug 2024 14:34:19 +0200 Subject: [PATCH 1/4] Feat(ops): Add deploy script --- makefile | 5 ++++- package.json | 1 + scripts/ghpages-deploy.mjs | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 scripts/ghpages-deploy.mjs diff --git a/makefile b/makefile index 9450bc6..464766f 100644 --- a/makefile +++ b/makefile @@ -22,8 +22,11 @@ stop: stop-supabase ## stop the stack locally build: ## build the app npm run build -start-prod: build +prod-start: build open http://127.0.0.1:3000 && npx serve -l tcp://127.0.0.1:3000 dist +prod-deploy: build ## deploy the app to production + npm run ghpages:deploy + supabase-remote-init: npm run supabase:remote:init diff --git a/package.json b/package.json index d551da2..ab9d425 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "preview": "vite preview", "lint": "eslint --ext .js,.ts,.tsx \"./src/**/*.{js,ts,tsx}\"", "prettier": "prettier --config ./.prettierrc.mjs --write --list-different \"src/**/*.{js,json,ts,tsx,css,md}\"", + "ghpages:deploy": "node ./scripts/ghpages-deploy.mjs", "supabase:remote:init": "node ./scripts/supabase-remote-init.mjs" } } diff --git a/scripts/ghpages-deploy.mjs b/scripts/ghpages-deploy.mjs new file mode 100644 index 0000000..2e88b58 --- /dev/null +++ b/scripts/ghpages-deploy.mjs @@ -0,0 +1,7 @@ +import * as ghpages from 'gh-pages'; + +ghpages.publish('dist', { branch: 'gh-pages' }, function (err) { + if (err) { + console.error('Failed to deploy to GitHub Pages', err); + } +}); From cad60d03742afb45b7cbe2dacda4c02731e91a92 Mon Sep 17 00:00:00 2001 From: Jonathan ARNAULT Date: Fri, 2 Aug 2024 16:42:02 +0200 Subject: [PATCH 2/4] Feat(crm): Add supabase deploy scripts --- README.md | 86 ++++++++++++++++++++++++-------------------- makefile | 9 +++-- supabase/config.toml | 2 +- 3 files changed, 56 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index cf7ae71..411ae99 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# React-admin CRM +# Atomic CRM This is a demo of the [react-admin](https://github.com/marmelab/react-admin) library for React.js. It's a CRM for a fake Web agency with a few sales. You can test it online at https://marmelab.com/react-admin-crm. @@ -8,67 +8,77 @@ React-admin usually requires a REST/GraphQL server to provide data. In this demo To explore the source code, start with [src/App.tsx](https://github.com/marmelab/react-admin/blob/master/examples/crm/src/App.tsx). -**Note**: This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). ## Setup -After having cloned the react-admin repository, run the following command at the project root: +To run this project you will need the following tools installed on your computer: +- Make +- Node 20 LTS +- NPM +- Docker (required by supabase) -```sh -npm install -``` - - -## Available Scripts - -In the project directory, you can run: - -### `npm start` +After having cloned the [`atomic-crm` repository](https://github.com/marmelab/atomic-crm), run the following command at the project root: -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. +```sh +# Install dependencies +make install -### `npm test` +# Start the stack in development mode +make start +``` -Launches the test runner in the interactive watch mode.
-See the section about [running tests](#running-tests) for more information. +## Remote Instance Setup -### `npm run build` +You can create a remote supabase using the following script: +```sh +make supabase-remote-init +``` -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance. +The script will prompt your for the project configuration and will apply migrations and deploy edge functions. -The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! -### `npm run deploy` +## Manual Remove Instance Link -Create a remote Supabase project and initialize it with the migrations. +If you already created the supabase instance, you can link the instance manually using the following commands: -## Manual Deployment +First, login into your supabase account: -To deploy this application, you need a Supabase instance. +```sh +npx supabase login +``` -Login into your supabase account: +Now, link this project to the local supabase instance. You'll be asked to enter the database password. +```sh +npx supabase link --project-ref ******************** +``` +Then, apply the migrations on it: ```sh -npx supabase login +npx supabase db push +npx supabase functions deploy ``` -Then, create a new supabase project. Keep note of the database password you'll have to enter and of the supabase project reference. +Finally, create the `.env.production.local` file with your supabase configuration: + ```sh -npx supabase projects create react-admin-crm +VITE_SUPABASE_URL= +VITE_SUPABASE_ANON_KEY= ``` -Now, link this project to the local supabase instance. You'll be asked to enter the database password. +## Deploy Updates + +If you want to deploy a new version of your CRM, you can run the following command: ```sh -supabase link --project-ref ******************** +make prod-deploy ``` -Finally, apply the migrations on it: +It will apply migrations, deploy edge functions and push the built applications to the `gh-pages` branch. + +## Test Production Mode + +If you want to test you application in production mode using the remote supabase instance, you can run the following command: ```sh -supabase db push +make prod-start ``` + +Note: It will apply migrations and deploy edge functions. diff --git a/makefile b/makefile index 464766f..989ccc9 100644 --- a/makefile +++ b/makefile @@ -22,11 +22,16 @@ stop: stop-supabase ## stop the stack locally build: ## build the app npm run build -prod-start: build +prod-start: build supabase-deploy open http://127.0.0.1:3000 && npx serve -l tcp://127.0.0.1:3000 dist -prod-deploy: build ## deploy the app to production +prod-deploy: build supabase-deploy npm run ghpages:deploy supabase-remote-init: npm run supabase:remote:init + $(MAKE) supabase-deploy + +supabase-deploy: + npx supabase db push + npx supabase functions deploy diff --git a/supabase/config.toml b/supabase/config.toml index 1647bb2..4e1e101 100644 --- a/supabase/config.toml +++ b/supabase/config.toml @@ -1,6 +1,6 @@ # A string used to distinguish different Supabase projects on the same host. Defaults to the # working directory name when running `supabase init`. -project_id = "react-admin-crm" +project_id = "atomic-crm-demo" [api] enabled = true From 77de6e198aecb54bced1c75edfe81a559c868026 Mon Sep 17 00:00:00 2001 From: Jonathan ARNAULT Date: Fri, 2 Aug 2024 16:51:31 +0200 Subject: [PATCH 3/4] Fix(ops): Add gh-pages to packages --- package-lock.json | 316 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 2 files changed, 318 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 4a40a2f..329d3e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,6 +51,7 @@ "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-testing-library": "^5.11.0", "execa": "git+https://github.com/sindresorhus/execa", + "gh-pages": "^6.1.1", "ink": "^5.0.1", "lint-staged": "^13.0.3", "pg": "^8.11.3", @@ -4489,6 +4490,15 @@ "node": ">=8" } }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/array.prototype.findlast": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", @@ -4609,6 +4619,12 @@ "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "dev": true + }, "node_modules/attr-accept": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-2.2.2.tgz", @@ -5378,6 +5394,12 @@ "node": ">=16" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -5899,6 +5921,12 @@ "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==", "dev": true }, + "node_modules/email-addresses": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-5.0.0.tgz", + "integrity": "sha512-4OIPYlA6JXqtVn8zpHpGiI7vE6EQOAg16aGnDMIAlZVinnoZ8208tW1hAbjWydgN/4PLTT9q+O1K6AH/vALJGw==", + "dev": true + }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -6897,6 +6925,32 @@ "node": ">= 12" } }, + "node_modules/filename-reserved-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", + "integrity": "sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/filenamify": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", + "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", + "dev": true, + "dependencies": { + "filename-reserved-regex": "^2.0.0", + "strip-outer": "^1.0.1", + "trim-repeated": "^1.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -6917,6 +6971,23 @@ "node": ">=0.10.0" } }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, "node_modules/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", @@ -6995,6 +7066,20 @@ "node": ">=12.20.0" } }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -7117,6 +7202,56 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gh-pages": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-6.1.1.tgz", + "integrity": "sha512-upnohfjBwN5hBP9w2dPE7HO5JJTHzSGMV1JrLrHvNuqmjoYHg6TBrCcnEoorjG/e0ejbuvnwyKMdTyM40PEByw==", + "dev": true, + "dependencies": { + "async": "^3.2.4", + "commander": "^11.0.0", + "email-addresses": "^5.0.0", + "filenamify": "^4.3.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "^11.1.1", + "globby": "^6.1.0" + }, + "bin": { + "gh-pages": "bin/gh-pages.js", + "gh-pages-clean": "bin/gh-pages-clean.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gh-pages/node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", + "dev": true, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages/node_modules/globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", + "dev": true, + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -8323,6 +8458,18 @@ "jsonexport": "bin/jsonexport.js" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -8904,6 +9051,21 @@ "lz-string": "bin/bin.js" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/memoize-one": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz", @@ -9472,6 +9634,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", @@ -9787,6 +9958,100 @@ "node": ">=0.10" } }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -11370,6 +11635,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-outer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/stylis": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", @@ -11506,6 +11792,27 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "node_modules/trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/trim-repeated/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -11726,6 +12033,15 @@ "node": ">=4" } }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", diff --git a/package.json b/package.json index ab9d425..366e42b 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "@testing-library/jest-dom": "^6.3.0", "@testing-library/react": "^16.0.0", "@testing-library/user-event": "^14.5.2", - "@types/jsonexport": "^3.0.5", "@types/jest": "^29.5.11", + "@types/jsonexport": "^3.0.5", "@types/lodash": "^4.17.7", "@types/papaparse": "^5.3.14", "@types/pg": "^8.11.0", @@ -47,6 +47,7 @@ "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-testing-library": "^5.11.0", "execa": "git+https://github.com/sindresorhus/execa", + "gh-pages": "^6.1.1", "ink": "^5.0.1", "lint-staged": "^13.0.3", "pg": "^8.11.3", From 56bc8fb6a3569c2959444dc4a11c8edfd239d39a Mon Sep 17 00:00:00 2001 From: Jonathan ARNAULT Date: Fri, 2 Aug 2024 16:59:30 +0200 Subject: [PATCH 4/4] Feat(ops): Improve documentation --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 411ae99..35644f5 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,20 @@ To run this project you will need the following tools installed on your computer - NPM - Docker (required by supabase) -After having cloned the [`atomic-crm` repository](https://github.com/marmelab/atomic-crm), run the following command at the project root: +After having cloned the [`atomic-crm` repository](https://github.com/marmelab/atomic-crm), run the following command at the project root to install dependencies: ```sh -# Install dependencies make install +``` -# Start the stack in development mode +Then you can start the stack in development mode with the following command: +```sh make start ``` +It will start the vite dev server and the local supabase instance. You can then access the app via [`http://localhost:5173/`](http://localhost:5173/). + + ## Remote Instance Setup You can create a remote supabase using the following script: @@ -82,3 +86,5 @@ make prod-start ``` Note: It will apply migrations and deploy edge functions. + +You can then access the app via [`http://localhost:3000/`](http://localhost:3000/). \ No newline at end of file