TechBlog is a blog website developed using Node.js, Express.js, HTML, CSS, HBS, and MySQL. The website allows an admin to upload blogs after registering using JWT authentication, while users can read blogs without registration.
- Admin registration using JWT authentication.
- Admin can upload blogs.
- Users can read blogs without creating an account.
Before running the project, ensure you have the following installed:
- Node.js
- XAMPP (to run MySQL and phpMyAdmin)
Follow these steps to set up and run the project:
- Open phpMyAdmin and create a database named
blogsDB. - Open the provided SQL file, copy the queries, and execute them in the SQL query interface.
- Open a terminal in the project folder.
- Run the following command to install dependencies:
npm install npm start-
Open your browser and go to: http://localhost:3000/
-
To access the Admin Panel, enter: http://localhost:3000/admin
To log in as an author, follow these steps: Ensure you have created an author
Open the browser and visit: http://localhost:3000/admin You will be redirected to the Login Page. Enter your credentials to log in. Once logged in, you will be redirected to the Admin Panel. From the Admin Panel, you can insert blogs.
To insert authors, you need to hit the corresponding API endpoint using tools like Postman, Thunder Client, or any similar software.