- Node.js is essential for the project. Download it here: https://nodejs.org/en/. Download the LTS version.
- Install ‘n’. It maintains the version of node.js from time to time.
- In your terminal install “Nodemon”. Nodemon is an npm package.
- Run the command:
npm install nodemon –g
Above command installs the nodemon globally.
- VS Code is the preferred code editor. Download it here: https://code.visualstudio.com/
- Install Prettier extension in VS code: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
- Install ESLint extension in VS code: https://github.com/Microsoft/vscode-eslint
- Install the optional extensions 'Visual Studio Intellicode', 'Path IntelliSense', 'Formatting toggle' for the ease of development. These extensions are really useful for the project.
- Request access to bitbucket by sending mail to: [email protected]. The client will provide you access via your mail id that you had sent to them with required credentials for bitbucket.
- Once the access is granted(client will send an email for you to join their bitbucket repo), login to your bitbucket account. you will see your account with the details of cloning the project, it would start with git clone https://<your_bitbucket_username>@bitbucket.org/curbhunger/ch_smarthub.git
- Open VS Code Editor and Run the following command on your terminal:
git clone https://<your_bitbucket_username>@bitbucket.org/curbhunger/ch_smarthub.git
The above command will clone the project repo in your local machine.
- Install mySQL database locally. The version to be installed is mySQL 8.0. Pick the installer from here based on your operating system and architecture - https://dev.mysql.com/downloads/mysql/
- Optionally install mySQL workbench or some sort of database access tool. https://dev.mysql.com/downloads/workbench/
- Remember the password you set to the DB server while installing the database.
- Log in to the database using mySQL workbench, create a database called “curbhunger”.
CREATE DATABASE curbhunger;
USE curbhunger;
CREATE USER 'root'@'localhost' IDENTIFIED BY 'curbhunger';
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('curbhunger');
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'curbhunger' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'curbhunger'@'%' IDENTIFIED BY 'curbhunger' WITH GRANT OPTION;
GRANT RELOAD,PROCESS ON *.* TO 'root'@'localhost';
GRANT USAGE ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
- The Database would be empty. To create tables within the database we will have to configure few files with some parameters in the project in VS Code(discussed ahead).
Once the database is created in your local machine, configuration within the project is required.
- Open your smarthub project in VS code, under config folder, go to config.js file.
- Under the development section, change the username, password to the ones that your mysql root@localhost has. Define the database ‘curbhunger’ in the "database" key, thus establishing the connection.
development: {
username: 'root', // required params for establishing connection with database.
password: 'root', // required params for establishing connection with database.
database: 'curbhunger', // required params for establishing connection with database.
host: '127.0.0.1',
dialect: 'mysql',
enableHooks: process.env.HOOKS_ENABLED || false,
}
- Run "npm install" in the root folder of the codebase [i.e., ch_smarthub folder]
ch_smarthub> npm install
- After successful installation of the packages, run "nodemon" command from the same folder to create the initial schema and the tables
\ch_smarthub> nodemon
. Check your database "curbhunger". If the nodemon command went smoothly, you will be able to see new tables created under your database. - Open a new terminal window/command prompt and go to smarthub root folder, Run following command to seed all the data:
npm run seed
If the above command gets executed successfully, head back to your database "curbhunger". You will see that all the data has been seeded into their respective tables. - Open your browser and head to http://localhost:3000
- If everything went well, you should see the login screen.
- Login into the smarthub dashboard with the following credentials:
Email: [email protected]
Password: DummyPassword
- If the above step is successful, you would be able to access the dashboard of SmartHub Application. You can start your work accordingly then.