From 6c30f2ec99348314665554ede994e33f4ec156bc Mon Sep 17 00:00:00 2001 From: Nitwel Date: Thu, 8 Apr 2021 22:07:58 +0200 Subject: [PATCH] Simplify dev env setup (#4845) * simplify dev env setup * Recommend bootstrap instead of updating init for prod Co-authored-by: rijkvanzanten --- docs/contributing/running-locally.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/contributing/running-locally.md b/docs/contributing/running-locally.md index 32770285a5..b02876e990 100644 --- a/docs/contributing/running-locally.md +++ b/docs/contributing/running-locally.md @@ -1,10 +1,13 @@ # Running Locally -> This guide explains how to install the _Development_ version of Directus locally so that you can work on the platform's source code. To install the _Production_ version locally, please follow to our [standard installation guides](/getting-started/installation/). +> This guide explains how to install the _Development_ version of Directus locally so that you can work on the +> platform's source code. To install the _Production_ version locally, please follow to our +> [standard installation guides](/getting-started/installation/). ::: tip Minimum Requirements -You will need to have [the latest version of Node](https://nodejs.org/en/download/current/) to _build_ a Development version of Directus. +You will need to have [the latest version of Node](https://nodejs.org/en/download/current/) to _build_ a Development +version of Directus. ::: @@ -32,16 +35,23 @@ git checkout -b YOUR-BRANCH-NAME npm install ``` -## 5. Setup the Database & Env File +## 5. Create a `.env` file + +Create a `.env` file under the `api` folder the API to use. You can use the `example.env` file provided under `api` as a +starting point. + +## 6. Setup the Database For this step, you'll need to already have a SQL database up-and-running, otherwise you can only use the SQLite driver, which will create the database for you. Run the following command from within root of the project: ```bash -npm run cli -- init +npm run cli bootstrap ``` -## 6. Start the development server +This will install Directus, and make sure all the migrations have run. + +## 7. Start the development server Run the following command from the root directory. @@ -49,7 +59,8 @@ Run the following command from the root directory. npm run dev ``` -If you are only looking to work on the Documentation (public website version), you can navigate to the `docs` directory and run the following command: +If you are only looking to work on the Documentation (public website version), you can navigate to the `docs` directory +and run the following command: ```bash npm run dev:site @@ -62,7 +73,7 @@ If you encounter errors during this installation process, make sure your node ve ::: -## 7. Make your fixes/changes +## 8. Make your fixes/changes At this point you are ready to start working on Directus! Before diving in however, it's worth reading through our docs on [submitting a pull-request](#Submitting-a-Pull-Request).