A postboard website with a client/server model which supports CRUD operations by using HTTP GET, POST, PUT, DELETE requests. It's mobile compatible too.
- Now deployable on Heroku:
- Deployment on Heroku - see it working here! 😀
- Branch for Heroku deployment - because the master branch uses MySQL and a free MySQL database on Heroku requires credit card info.
- TODO: Support for emoji posts.
- TOOD: Post using AJAX instead of traditional forms for better script control?
- TOOD: Make a preview picture.
In project directory, call the following node command to install the necessary dependencies:
node install
Create config.js
in the project directory with the following content:
module.exports = {
host: 'localhost',
user: 'USERNAME HERE', // put your username here
password: 'PASSWORD HERE', // put your password here
database: 'my-simple-postboard'
};
Run the setup.sql
in MySQL to prepare the necessary tables.
In project directory, call the following node command to start the server:
node index.js
# Output:
# My Simple Postboard listening on port 3000! (or another port if specified)
# Connected to database!
Navigate to localhost:3000
(or a corresponding port) to visit the postboard.
There are imported in head.pug
and scripts.pug
from their official CDNs.
- Boostrap 4 - a easily reusable CSS stylesheet sheet with optionally Javascript interactivity.
- jQuery - a JavaScript library for DOM manipulation.
- SweetAlert 2 - a beautiful JavaScript replacement for vanilla popup boxes.
- Express - a Node framework for setting up the web server.
- body-parser - a Express.js middleware for interpreting HTTP request bodies.
- mysqljs - a Node module for connecting to the MySQL database.
- Pug - a template engine and language to dynamically generate HTML web pages.