Skip to content

danhbuidcn/fcj_management

Repository files navigation

AWS-FCJ-Management - Nodejs, Express, MySQL & Handlebars

Demo

  1. Homepage

Homepage

  1. View User

Viewuser

  1. Add User

Add user

  1. Edit User

Edituser

  1. Delete User

Deleteuser

How to usage

  1. Git clone repository
https://github.com/Van-Hoang-Kha/AWS-FCJ-Management
  1. Go to folder project
  2. Dependencies Installation
  3. Configuration Server
  4. Restarting Express server
  5. Start our local server

Dependencies Installation

npm install express dotenv express-handlebars body-parser mysql

Configuration Server

Create a .env file and add your database credentials like this:

DB_HOST = 'localhost'
DB_NAME = 'DB_NAME'
DB_USER = 'root'
DB_PASS = 'password'

Restarting Express server

npm install --save-dev nodemon

Start our local server

npm start

Install mysql

sudo apt install mysql-server
sudo systemctl start mysql.service
sudo mysql
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

SQL Schema

mysql> CREATE DATABASE fcj_management;
MYSQL> USE fcj_management;
MYSQL> CREATE TABLE user (id INT NOT NULL AUTO_INCREMENT ,first_name VARCHAR(45) NOT NULL ,last_name VARCHAR(45) NOT NULL ,email VARCHAR(45) NOT NULL ,phone VARCHAR(45) NOT NULL ,comments TEXT NOT NULL ,status VARCHAR(10) NOT NULL DEFAULT 'active' , PRIMARY KEY (id));

SQL Dummy Data

INSERT INTO user(id, first_name, last_name, email, phone, comments, status) VALUES
(NULL, 'Amanda',      'Nunes',        '[email protected]',        '012345 678910', '',          'active'),
(NULL, 'Alexander',   'Volkanovski',  '[email protected]',  '012345 678910', '',          'active'),
(NULL, 'Khabib',      'Nurmagomedov', '[email protected]', '012345 678910', '',          'active'),
(NULL, 'Kamaru',      'Usman',        '[email protected]',        '012345 678910', '',          'active'),
(NULL, 'Israel',      'Adesanya',     '[email protected]',     '012345 678910', '',          'active'),
(NULL, 'Henry',       'Cejudo',       '[email protected]',       '012345 678910', '',          'active'),
(NULL, 'Valentina',   'Shevchenko',   '[email protected]',   '012345 678910', '',          'active'),
(NULL, 'Tyron',       'Woodley',      '[email protected]',      '012345 678910', '',          'active'),
(NULL, 'Rose',        'Namajunas ',   '[email protected]',    '012345 678910', '',          'active'),
(NULL, 'Tony',        'Ferguson ',    '[email protected]',     '012345 678910', '',          'active'),
(NULL, 'Jorge',       'Masvidal ',    '[email protected]',     '012345 678910', '',          'active'),
(NULL, 'Nate',        'Diaz ',        '[email protected]',         '012345 678910', '',          'active'),
(NULL, 'Conor',       'McGregor ',    '[email protected]',     '012345 678910', '',          'active'),
(NULL, 'Cris',        'Cyborg ',      '[email protected]',       '012345 678910', '',          'active'),
(NULL, 'Tecia',       'Torres ',      '[email protected]',       '012345 678910', '',          'active'),
(NULL, 'Ronda',       'Rousey ',      '[email protected]',       '012345 678910', '',          'active'),
(NULL, 'Holly',       'Holm ',        '[email protected]',         '012345 678910', '',          'active'),
(NULL, 'Joanna',      'Jedrzejczyk ', '[email protected]',  '012345 678910', '',          'active');

Reference

Nodejs Documents

MySQL Documents

Simple User Management System – Nodejs, Express, MySQL & Handlebars

About

NodeJS application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published