GithubHelp home page GithubHelp logo

amirkangarloo / simple-blog-with-expresss Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 649 KB

Create simple blog with node, express and mySQL

License: MIT License

Shell 0.10% JavaScript 24.04% Handlebars 46.68% CSS 29.18%
blog express expressjs handlebars javascript mysql mysql-database mysql2 nodejs simple-blog

simple-blog-with-expresss's Introduction

Simple blog with expresss

Simple blog with NodeJs, Express, MySQL, Handlebars, HTML, CSS, JS and Bootstrap.

In this project, use MVC architectural pattern.

Database

  • Use MySQL database in this project with structure below.

  1. Table name : posts
# Name Type Default Extra
1 id int(11) None AUTO_INCREMENT
2 author_id int(11) None
3 title varchar(100) None
4 slug varchar(100) None
5 content longtext None
6 status tinyint(1) None
7 views int(11) 0
8 comments int(11) 0
9 thumbnail text NULL
10 created_at datetime current_timestamp()

  1. Table name : comments
# Name Type Default Extra
1 id int(11) None AUTO_INCREMENT
2 author_id int(11) NULL
3 post_id int(11) None
4 user_name varchar(100) None
5 user_email varchar(100) None
6 comment text None
7 status tinyint(4) 0
8 parent int(11) 0
9 created_at datetime current_timestamp()

  1. Table name : users
# Name Type Default Extra
1 id int(11) None AUTO_INCREMENT
2 full_name varchar(100) None
3 email varchar(100) None
4 password varchar(100) None
5 description text NULL
6 role tinyint(2) 0
7 created_at datetime current_timestamp()

  1. Table name : settings
# Name Type Default Extra
1 id int(11) None AUTO_INCREMENT
2 setting_name varchar(100) None
3 setting_value text None

  • Note: for saving session in database used express-mysql-session package. This package automatically create a sessions table for saving sessions.

.env file

create .env file like below structure.

#app
APP_PORT=5000
APP_NAME=express_blog
APP_ENV=local

#mysql
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=
MYSQL_DATABASE=express_blog

Installation

After make database & create .env file, write commands below into command line in your machine.

first step

git clone https://github.com/amirkangarloo/simple-blog-with-expresss.git

second step

npm install

third step

npm start

License

MIT

simple-blog-with-expresss's People

Contributors

amirkangarloo avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

amzamani

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.