With database config and authentication using passport.js
- Ensure you have node and npm installed on your machine. To install, please refer to this link.
- Clone this repo to your local machine using
$ git clone https://github.com/EbubeUd/node-js-boilerplate.git
- In the project root folder, install all the npm dependencies.
$ npm install
- To enable the app to run locally, you need to generate an SSL certificate and a key. You can do this by using mkcert. It is a simple tool for making locally-trusted development certificates. Install mkcert from powershell
$ mkcert -install
- After installing mkcert, create a certificate for the localhost, using the mkcert command
$ mkcert localhost 127.0.0.1
- This will create a certificate for the localhost. Save the generated files in the project's root folder as "cert.pem" for the certificate and "key.pem" for the key
- You can set up the database using Xampp and PhpmyAdmin. Create a Database named "db_name". The tables will be created when the app is started. The database credentials are pre-configured in config/development.json
"database": {
"username": "root",
"password": null,
"database": "db_name",
"host": "127.0.0.1",
"dialect": "mysql",
"operatorsAliases": false
},
// ...
};
- Run the app using npm.
$ npm run server