WriteLight is a full-stack app that helps users learn new vocabulary through daily reflection and action. Each day, users receive a new word and are challenged to use it meaningfully in their lives. After using their word, they journal their experience by answering prompts like: How did you use today’s word? What gave you hope? What did you learn? How did you show kindness? The app fosters language growth, self-awareness, and positivity—one word at a time.
Node.js & Node Package Manager (npm)
- Download and install Node.js (LTS v22) from the official website
git clone https://github.com/freeCodeCamp-2025-Summer-Hackathon/purple-array.git
cd purple-arrray
-
Create an account on MongoDB
-
If you are creating an account for the first time, you will be taken to the “Deploy your cluster” page. Select the following options:
- Free
- Uncheck “preload sample data”
- Name your cluster
- Create deployment
-
Create a database user – keep your username/password somewhere, just in case
- Create Database User
-
Click “Choose a connection method”
- Click “Drivers”
- Set “Driver” to “Node.js”
- Copy the “connection string” below. Make sure it includes the password
THIS IS YOUR LAST CHANCE TO GRAB YOUR PASSWORD
- Click “Drivers”
-
Click “Done”
-
Click “Network Access” (left bar) and “+ADD IP ADDRESS” (green button)
- “Allow Access From Anywhere”
- Make sure you have pulled the most recent version of the project’s
main
branch from GitHub.- switch to the main branch if you are not already on it, and then run
git pull
- switch to the main branch if you are not already on it, and then run
git switch main
git pull
- Change directories into the backend folder
cd backend
- Create a “.env” file inside the backend folder (make sure it’s at the top level, and not nested in an additional folder).
- Create the variable
MONGO_URI=
followed by the connection string you copied earlier; your Mongo Uniform Resource Indicator (URI), represented by the placeholder value in the brackets below.
MONGO_URI=<Your_Mongo_URI>
- Please note: you don't include any quotation marks or the angle brackets.
- The string will look something like this:
mongodb+srv://<YOUR_USERNAME>:<YOUR_PASSWORD>@<CLUSTER_NAME>.iva3yfn.mongodb.net/?retryWrites=true&w=majority$appName=<CLUSTER_NAME>
- Additionally, you can add a name for the database by adding it to URI after the
iva3yfn.mongodb.net/
portion of the string, as shown below:
mongodb+srv://<your_username>:<your_password>@<cluster_name>.iva3yfn.mongodb.net/<ADD_DB_NAME_HERE>?retryWrites=true&w=majority$appName=<cluster_name>
-
Now add your PORT variable to the .env file and set it to
PORT=5001
-
Now add the following variables to your .env as well:
NODE_ENV=development
-
Lastly you'll need a JSON Web Token Secret key in your .env file as well. It will be in the following format
JWT_SECRET=<Secret_String>
where<Secret_String>
is the appropriate JWT key. The JWT key just needs to be a unique, randomized alphanumericstring
. We recommend that it be it at lest 64 characters. You can create a unique string here if you don't already have a preferred method.
Please ensure that you now have all of the following environment variables in your .env file, including the Node environment variable with value set to development
as shown below.
MONGO_URI=<Your_Mongo_URI>
PORT=5001
NODE_ENV=development
JWT_SECRET=<Secret_String>
The script to load your database is located directly in the backend directory and must be run from that directory. To run the script please open a terminal window and run the following commands:
cd backend
node seed-database.js
In a terminal window please run the following:
cd backend
npm install
npm run dev
In another terminal window please also run:
cd frontend
npm install
npm run dev