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
Open the [repository on the `java-server` branch](https://github.com/mongodb-developer/library-management-system/tree/java-server).
29
-
30
-
To start the Java application in a codespace, check that you are in the `java-server` branch and then click "Code." Then, look for the *Codespaces* tab. Click "Create Codespace on java-server." This will create a new codespace for you and start the application.
Let it run for a few seconds as it prepares your environment. It will clone the repository, prepare the containers, and run the installation scripts. Once it's ready, you'll see an IDE, with a preview window that shows the running application.
40
25
41
26
:::note
@@ -58,9 +43,6 @@ Right now, you should see a big error message in the console, as we haven't conf
58
43
```
59
44
:::
60
45
61
-
<TabsgroupId="server">
62
-
<TabItemvalue="node"label="🚀 NodeJS/Express">
63
-
64
46
### Expose the server port
65
47
66
48
To get the application working in that environment, there is one small change you need to make to the codespace. You need to expose the port where the server is running.
@@ -77,8 +59,30 @@ You'll see the text in the *Visibility* column change to `Public`.
77
59
78
60
That's it! You're now ready to move to the next section.
79
61
62
+
80
63
</TabItem>
64
+
81
65
<TabItemvalue="java"label="☕️ Java Spring Boot">
66
+
67
+
Open the [repository on the `java-server` branch](https://github.com/mongodb-developer/library-management-system/tree/java-server).
68
+
69
+
To start the Java application in a codespace, check that you are in the `java-server` branch and then click "Code." Then, look for the *Codespaces* tab. Click "Create Codespace on java-server." This will create a new codespace for you and start the application.
Let it run for a few seconds as it prepares your environment. It will clone the repository, prepare the containers, and run the installation scripts. Once it's ready, you'll see an IDE, with a preview window that shows the running application.
75
+
76
+
:::note
77
+
Again, this might take a few minutes. It's a great time to grab a coffee. ☕️
Right now, you should see an error message in the console, as we haven't configured the app yet. Don't worry, you'll get it up and running in a few minutes.
84
+
:::
85
+
82
86
### Set the MongoDB connection
83
87
To run the application in GitHub Codespaces, you now need to set the MongoDB connection string before starting the server.
84
88
In the terminal of your Codespace, run:
@@ -89,12 +93,32 @@ After setting the environment variable, start the application again with:
89
93
```Java
90
94
mvn spring-boot:run
91
95
```
92
-
<Screenshoturl="https://github.com/mongodb-developer/library-management-system"src="img/screenshots/50-demo-app/2-start-app/5-set-environments.png"alt="The Port Visibility menu" />
Once the command finishes, the application will be up and running on port 5000.
94
-
<Screenshoturl="https://github.com/mongodb-developer/library-management-system"src="img/screenshots/50-demo-app/2-start-app/6-app-started.png"alt="The Port Visibility menu" />
99
+
100
+
<Screenshoturl="https://github.com/mongodb-developer/library-management-system"src="img/screenshots/50-demo-app/2-start-app/6-app-started.png"alt="App is started on port 5000" />
101
+
102
+
### Expose the server port
103
+
104
+
To get the application working in that environment, there is one small change you need to make to the codespace. You need to expose the port where the server is running.
105
+
106
+
Look for the *Ports* tab at the bottom of the IDE.
Once you click on the tab, you'll see a list of ports. Right-click on the port `Server (5000)` row. Then, select "Port Visibility" and "Public."
111
+
112
+
<Screenshoturl="https://github.com/mongodb-developer/library-management-system"src="img/screenshots/50-demo-app/2-start-app/4-port-visibility.png"alt="The Port Visibility menu" />
113
+
114
+
You'll see the text in the *Visibility* column change to `Public`.
115
+
116
+
That's it! You're now ready to move to the next section.
117
+
95
118
96
119
</TabItem>
97
120
</Tabs>
121
+
98
122
## 🦸 Option 2: Run locally
99
123
100
124
If you prefer to run the application locally, you can do so by following these steps. Keep in mind that the following steps of this lab will be using the codespace, so you might need to adapt some of the commands.
Copy file name to clipboardExpand all lines: docs/50-demo-app/3-configure.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ import TabItem from '@theme/TabItem';
4
4
5
5
# 👐 Configure the Application
6
6
7
-
Now that your environment is set up, you can configure the application.
8
-
There should already be a file open in the IDE. If not, look in the file explorer on the left, and open the file below. This file contains the configuration for the application.
9
-
10
7
<TabsgroupId="server">
11
8
<TabItemvalue="node"label="🚀 NodeJS/Express">
12
9
10
+
Now that your environment is set up, you can configure the application.
11
+
There should already be a file open in the IDE. If not, look in the file explorer on the left, and open the file below. This file contains the configuration for the application.
12
+
13
13
File: `server/.env`
14
14
15
15
```
@@ -39,7 +39,7 @@ In the *Terminal* tab at the bottom, look for the `Server is running on port: 50
39
39
</TabItem>
40
40
41
41
<TabItemvalue="java"label="☕️ Java Spring Boot">
42
-
Everything is set up correctly. You can proceed to the next step.
42
+
Verify that your server application is running and the server port is set to "Public".
Copy file name to clipboardExpand all lines: docs/70-indexing/1-create-compound-index.mdx
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ In this exercise, you will build a compound index following the ESR rule, compar
11
11
<TabsgroupId="server">
12
12
<TabItemvalue="node"label="🚀 NodeJS/Express">
13
13
14
-
1. Open the file `server/src/indexing/borrowed-books-index.ts`[file](https://github.com/mongodb-developer/library-management-system/blob/main/server/src/indexing/borrowed-books-index.ts) in your GitHub Codespace.
14
+
1. Open the file `server/src/indexing/borrowed-books-index.ts` file in your GitHub Codespace.
15
15
16
16
2. Examine the code to build a compound index on the `issueDetails` collection.
17
17
@@ -81,7 +81,7 @@ In this exercise, you will build a compound index following the ESR rule, compar
81
81
82
82
<TabItemvalue="java"label="☕️ Java Spring Boot">
83
83
84
-
1. Let’s start with our [`IssueDetail`](https://github.com/mongodb-developer/library-management-system/blob/java-server/java-server/src/main/java/com/mongodb/devrel/library/domain/model/IssueDetail.java) record. Right now, it looks like this:
84
+
1. Let’s start with our `IssueDetail` record. Right now, it looks like this:
1. Open the **VS Code extension** from the sidebar on the left.
149
+
1. Click **Add Connection**.
150
+
1. In the welcome screen, click **Connect** under the **Connect with Connection String** section.
151
+
1. Enter the MongoDB connection string from your Atlas cluster, making sure to replace the **password placeholder**.
152
+
1. Press **Enter**.
153
+
1. In the sidebar, you should now see your database. Expand the **library** database, then the **issueDetails** collection, and finally select **Indexes**.
0 commit comments