-
Install Node.js
-
Install and enable Prettier in VSCode
-
Install MongoDB Community Server to host a local instance of MongoDB.
-
Download the MongoDB Compass UI to view the state of your database.
Install Docker.
Then, to host the instance, you can use the command:
docker-compose up -d
To stop your Docker containers and remove their processes, run:
docker-compose down
Note: On linux-based operating systems, if you come across an entrypoint permission error (i.e.
process: exec: "./scripts/env-init.sh": permission denied: unknown
orprocess: exec: "./scripts/rs-init.sh": permission denied: unknown
), runchmod +x ./scripts/rs-init.sh
orchmod +x ./web/scripts/env-init.sh
to make the shell files executables.Windows Users: If you come across this error
exec ./scripts/rs-init.sh: no such file or directory
orexec ./scripts/env-init.sh: no such file or directory
when running the docker-compose command, please follow this Stackoverflow thread to fix it. -
Clone the Repository through the HTTPS link into a directory on your local machine
-
In the root directory of the project, run:
npm install
-
In the root directory, run one of these commands based on your OS:
npm run secrets:linux # mac / linux npm run secrets:windows # windows
You should be prompted for a master password. Ask your Engineering leadership to continue. Once the password has been verified, your
.env
file should have been created automatically for you.If you are unable to use the commands to retrieve the
.env
file, you can download or visit Bitwarden and login using[email protected]
and the master password. The.env
file will be available within the vault. -
Get a locally running MongoDB instance by copying the MongoDB URI string value obtained from the bitwarden. Then, click "Add a new collection" and input the link in the URI field.
-
To start the Next.js dev server, run:
npm run dev
-
Navigate to http://localhost:3000/ to view the application.
-
Within your local deployment, you can login with credentials formatted like so:
- Username: [string]@[string].[string]
- Password: [string]
-
For Salesforce authentication, we have a FOCUS account so please reach out to the EM if that is needed
- Next.js (frontend + backend)
- Tailwind CSS (styling)
- MongoDB (database)
- Zod (type validation)
- Salesforce (auth + account integration)
This section is meant for resolving issues that have previously been encountered and fixed. If you encounter an issue that isn't on this list, please inform your EM.
Resolution:
Run the following command in your MongoDB shell:
rs.initiate()
Resolution:
Run the following POST command in Postman after connecting to the database:
http://localhost:3000/api/seeder
NOTE: This can take up to a minute to process since there is a lot of data to be loaded onto the database. If there isn't automatically a 500 server-side error then you can just wait.
Resolution:
Verify your .env file contains the correct MONGO_URI connection string, found in the [email protected] Bitwarden, under the FOCUS tab .env file.
Resolution:
cd
to the the directory where you have cloned the FOCUS repository, and run npm i
. If this does not work, you may have used an Object/function that belongs to a library that you haven't imported or installed yet.
Resolution:
Stop your localhost with Ctrl + C, then rerun npm i
and npm run dev
.