In the website development timeline, we are currently evaluating the folllowing software stack: Next.js website (this repository) and the MongoDB database. The easiest way to evaluate these potential solutions for our purposes is in sailbot_workspace.
MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era. If you want to learn more about MongoDB, visit their docs site: MongoDB Documentation.
This project uses environment variables to manage configuration-specific information. Please look at the file
.env.local and ensure the variables are defined below:
MONGODB_URI: Your MongoDB connection string. Usemongodb://localhost:27017/<DB_NAME>to establish a connection with the local database.NEXT_PUBLIC_SERVER_HOST: The host URL of the website.NEXT_PUBLIC_SERVER_PORT: The port number of the website.NEXT_PUBLIC_POLLING_TIME_MS: The time interval for polling the database in milliseconds.
The following command installs all required dependencies listed in the package.json file:
npm install
Once the installation is complete, you should see a node_modules directory in the project's root.
This directory contains all installed packages.
When installing a new package to the website, please follow the steps below:
-
Access the terminal of the website container on Docker.
-
Run the command
npm install <package-name>. Replace<package-name>with the actual name of the package you want to add.- Should you encounter errors related to resolving peer dependencies, please re-run the command with
the header
--legacy-peer-deps. Do not to use--forceunless you're well aware of the potential consequences.
- Should you encounter errors related to resolving peer dependencies, please re-run the command with
the header
-
Review the
package.jsonfile to ensure the new package and its version have been added to the dependencies section.- Confirm that
package-lock.jsonhas also been updated. This file holds specific version information to ensure consistent installations across different environments.
- Confirm that
-
Once the installation process is finished, please make sure to commit the files
package.jsonandpackage-lock.json. These files are essential for version controlling the dependencies that have been added.
Using Sailbot Workspace, the website should be up and running on http://localhost:3005.
Otherwise, you execute the following commands to run it in development mode:
npm run devBefore merging in new changes to the repository, please execute the following commands in order:
npm run formatThis command runs Prettier to automatically format the code according to
the rules defined in the configuration file .prettierrc.
npm run lintThis command runs ESLint to analyze the code for potential errors
and enforce coding style based on the rules defined in the configuration file .eslintrc.