You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: templates/mantis-todo/README.md
+31-11Lines changed: 31 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,24 +8,44 @@
8
8
9
9
- Run `npm install` to install all dependencies
10
10
11
-
2.(Optional) Create a remote mongo instance
11
+
2.Choose your mongo instance
12
12
13
-
- You will need a remote mongo instance set up to deploy this project, but a local instance will be created for you for development if you set `MONGODB_URI='local'` in the `.env.local` file mentioned below.
14
-
- If you don't already have a Mongo db instance you can use, follow the steps to [set up an instance with MongoDB Atlas (it's free)](https://www.mongodb.com/docs/atlas/getting-started/).
13
+
- Option 1: Use a local instance
15
14
16
-
1. Create a config file in `apps/web-client` called `.env.local` i.e. `apps/web-client/.env.local`.
17
-
2. Place your mongo connection string in that file as the following environment variable
15
+
- A local instance can be created for you if you run `npx nx run web-client:start-local-db` and will remain running for as long as that command hasn't exited.
1. Create a config file in `apps/web-client` called `.env.local` i.e. `apps/web-client/.env.local`.
19
+
2. Place your mongo connection string in that file as the following environment variable.
20
+
21
+
```shell
22
+
MONGODB_URI='mongodb://127.0.0.1:27017'
23
+
```
24
+
25
+
3. Whenever you start the `web-client` ensure you run `npx nx run web-client:start-local-db` also (example in [Start the apps](#start-the-apps)).
26
+
27
+
- Option 2: Use a remote instance
28
+
29
+
- You will need a remote mongo instance set up to deploy this project so this will need to be considered regardless.
30
+
- If you don't already have a Mongo db instance you can use, follow the steps to [set up an instance with MongoDB Atlas (it's free)](https://www.mongodb.com/docs/atlas/getting-started/).
31
+
- Once you have a connection string, follow these steps.
32
+
33
+
1. Create a config file in`apps/web-client` called `.env.local` i.e. `apps/web-client/.env.local`.
34
+
2. Place your mongo connection string in that file as the following environment variable.
35
+
36
+
```shell
37
+
MONGODB_URI='<the connection string>'
38
+
```
23
39
24
40
> To learn more about how Nx loads environment variables, see [Definte Environment Variables](https://nx.dev/recipes/tips-n-tricks/define-environment-variables#define-environment-variables)
25
41
26
-
## Start the web app
42
+
## Start the apps
43
+
44
+
To start the full stack locally with a local db, run `npx nx run-many --targets=serve,start-local-db --projects=web-client,mobile-client`.
45
+
46
+
To start the full stack locally without a local db, run `npx nx run-many --targets=serve --projects=web-client,mobile-client`.
27
47
28
-
To start the development servers run `npx nx run-many --target=serve --projects=web-client,mobile-client`. Open your browser and navigate to `http://localhost:4200/` to see the web app and `http://localhost:4300/`for the mobile app. Happy coding!
48
+
Open your browser and navigate to `http://localhost:4200/` to see the web app and `http://localhost:4300/`for the mobile app. Happy coding!
0 commit comments