This is a Node.js project with a focus on building a blogging platform. The project includes a server, client-side rendering, and database integration. The server is built using Express.js and the client-side is built using Handlebars.js. The project also includes a database schema for storing user data, posts, and comments.
Node.js, Express.js, Handlebars.js, Blogging platform, User data, Posts, Comments, Database integration
\controllers
| File | Summary |
|---|---|
| api-routes.js | The code defines a router for an Express.js application that handles various HTTP requests and interacts with the Sequelize ORM to perform CRUD (create, read, update, delete) operations on models. |
| html-routes.js | The code defines an Express.js router that handles requests for a social media platform, including rendering homepage, dashboard, individual post pages, and login/logout functionality. |
| index.js | The code defines an Express.js router and imports two sets of routes, then uses them in the order they were imported, exporting the router for use in the application. |
To run this application locally, you'll need Node.js and a MySQL database set up on your machine.
-
Clone the repository:
git clone -
Install the dependencies:
npm i -
Create a
.envfile in the root directory with the following contents:
DB_NAME='your_database_name'
DB_USER='your_username'
DB_PASSWORD='your_password'-
Run the
schema.sqlin your MySQL database to create the necessary database. -
Start the server:
node server.js -
Visit
http://localhost:3000in your local browser.