# PVL Assessment Demo
As part of the PVL hiring assessment, I've developed this MERN stack application, showcasing my skills in building a full-stack web application using the MERN (MongoDB, Express, React, Node.js) stack. It has been a valuable learning experience, and I'm excited to present my work.
## Getting Started
To run this project locally for development and testing, follow these steps:
### Prerequisites
Make sure your computer has the following software installed:
- [Node.js](https://nodejs.org/): JavaScript runtime environment
- [npm](https://www.npmjs.com/): Node Package Manager
### Installation
1. Clone this repository to your local machine:
```bash
git clone https://github.com/yourusername/PVL_Assessment_Demo.git
```-
Navigate to the project's root folder:
cd PVL_Assessment_Demo -
Install the server dependencies:
npm install
-
Navigate to the client folder:
cd client -
Install the client dependencies:
npm install
Before running the application, you need to configure your MongoDB connection settings as I have not allowed external IP's for database acsess. For the sake of the assessment, I will keep the port open as I do not know the IP that will be accessing the DB. It is not recommended usually as it is a major security concern.
-
Start the backend server from the project's root folder:
node app.js
-
Run the frontend development server from inside the client folder:
cd client npm start
You can access the application at http://localhost:3000/.
- The backend code is located in the root folder and is built with Express.js. It connects to a MongoDB database hosted on MongoDB Atlas.
- The frontend code resides in the client folder and is developed using React.
This project is ready for deployment on cloud platforms or web hosting services. Don't forget to update your MongoDB connection string for the production environment.
To run test cases for the Node.js application using Mocha, follow these steps:
-
Open a terminal.
-
Navigate to the root folder of your project using the
cdcommand:cd /path/to/your/project -
Run the Mocha tests using the following command:
.\node_modules\.bin\mocha .\test\app.test.js
This command runs the Mocha tests located in the
app.test.jsfile within thetestfolder of the project. -
You can modify the
formDataobject in theapp.test.jsfile to test different data scenarios. Update the data as needed for your test cases.
Testing is essential for ensuring the reliability of your code.
- MongoDB Atlas: Cloud-hosted MongoDB database
- Express.js: Web application framework for Node.js
- React: JavaScript library for building user interfaces
- Node.js: JavaScript runtime environment
I would like to express my gratitude to [PVL] for offering me this assessment opportunity.