/node-crud

This is a very basic example of CRUD in Node.js n mySQL.

Primary LanguageJavaScript

node-crud

This is a very basic example of CRUD in Node.js n mySQL.

Installation

Clone or download zip to your machine.

	git clone https://github.com/knojiyak/node-crud
	cd node-crud
	npm install
	npm start
	Now open url in your browser: http://localhost:4300/
		

Configuration (database)

config/connection.js

    host: 'localhost',
    user: 'root',
    password : 'root',
    port : 3306, //port mysql
    database:'sampledb'	

You're gonna need to create a DB named 'sampledb' and import sampledb.sql

Login Details

Username: admin
Password: 123456

Directory Structure

.
|-- app.js
|-- config
|   |-- connection.js
|   |-- index.js
|   `-- route.js
|-- customer
|   |-- customerController.js
|   `-- customerModel.js
|-- Images
|   |-- imgUploader_1513148531557_ultra_dm_1495373946.jpg
|   |-- imgUploader_1513148616018_240_F_78735333_o3qJe4bT5ciwldLIjVDulFKrDAV3jGYO.jpg
|   |-- imgUploader_1513148758490_person-flat.png
|   `-- imgUploader_1513148819457_240_F_78735333_o3qJe4bT5ciwldLIjVDulFKrDAV3jGYO.jpg
|-- login
|   |-- loginController.js
|   `-- loginModel.js
|-- package.json
|-- public
|   |-- css
|   |   `-- style.css
|   `-- js
|       `-- all.js
|-- README.md
|-- sampledb.sql
`-- views
    |-- add_customer.ejs
    |-- customers.ejs
    |-- edit_customer.ejs
    |-- index.ejs
    |-- layouts
    |   |-- footer.ejs
    |   `-- header.ejs
    `-- login.ejs

Alt text Alt text Alt text Alt text