@@ -36,31 +36,49 @@ This directory contains all installed packages.
36
36
37
37
When installing a new package to the website, please follow the steps below:
38
38
39
- 1 . Access the terminal of the website container on Docker.
40
-
41
- 2 . Run the command ` npm install <package-name> ` .
39
+ 1 . Run the command ` npm install <package-name> ` .
42
40
Replace ` <package-name> ` with the actual name of the package you want to add.
43
41
44
42
- Should you encounter errors related to resolving peer dependencies, please re-run the command with
45
43
the header ` --legacy-peer-deps ` . Do not to use ` --force ` unless you're well aware of the potential consequences.
46
44
47
- 3 . Review the ` package.json ` file to ensure the new package and its version have been added to the dependencies section.
45
+ 2 . Review the ` package.json ` file to ensure the new package and its version have been added to the dependencies section.
48
46
- Confirm that ` package-lock.json ` has also been updated.
49
47
This file holds specific version information to ensure consistent installations across different environments.
50
- 4 . Once the installation process is finished, please make sure to commit the files ` package.json ` and ` package-lock.json ` .
48
+ 3 . Once the installation process is finished, please make sure to commit the files ` package.json ` and ` package-lock.json ` .
51
49
These files are essential for version controlling the dependencies that have been added.
52
50
53
51
## Run
54
52
55
- Using [ Sailbot Workspace] ( https://github.com/UBCSailbot/sailbot_workspace ) ,
56
- the website should be up and running on [ http://localhost:3005 ] ( http://localhost:3005 ) .
57
-
58
- Otherwise, you execute the following commands to run it in development mode:
53
+ You can run the website in development mode by executing the following command:
59
54
60
55
``` bash
61
56
npm run dev
62
57
```
63
58
59
+ This will start the website in development mode and spin up a Docker container for our MongoDB database.
60
+ Make sure you have Docker installed!
61
+
62
+ Once you have run the website in development mode, you can access it at [ http://localhost:3005 ] ( http://localhost:3005 ) .
63
+
64
+ After spinning up the database, it will keep running in the background until Docker is stopped. You can just manually stop the database by running:
65
+
66
+ ``` bash
67
+ npm run db:stop
68
+ ```
69
+
70
+ Otherwise, here are some useful commands:
71
+
72
+ | Command | Description |
73
+ | -------------------- | -------------------------------------------------------- |
74
+ | ` npm run db:start ` | Starts the MongoDB database container |
75
+ | ` npm run db:stop ` | Stops the MongoDB database container |
76
+ | ` npm run web:dev ` | Runs the website in development mode on port 3005 |
77
+ | ` npm run dev ` | Starts both the database and website in development mode |
78
+ | ` npm run web:build ` | Builds the website for production |
79
+ | ` npm run web:start ` | Starts the production website on port 3005 |
80
+ | ` npm run simulation ` | Runs the simulation script |
81
+
64
82
## Linters
65
83
66
84
Before merging in new changes to the repository, please execute the following commands in order:
0 commit comments