This is the backend part of the Blink blogging platform built using Node.js (Express) and MSSQL.
Follow these steps to run the backend part of the project.
Make sure you have Node.js and npm installed on your machine.
-
Clone the repository:
git clone https://github.com/arshadakl/Blink-Blog.git cd Blink-Blog/backend
-
Create a Cloudinary account:
Blink uses Cloudinary to store blog images and user profile images. You need to create an account on Cloudinary.
-
Create a
.env
file:In the
backend
directory, create a.env
file and add the following lines:DB_USER=USER DB_PASSWORD=YOUR_PASSWORD DB_SERVER=YOUR.database.windows.net DB_DATABASE=blog JWT_SECRET=your_SECRET PORT=5000 CLOUDINARY_NAME=CLOUDINARY CLOUDINARY_API_KEY=YOUR_CLOUDINARY_API_KEY CLOUDINARY_API_SECRET=YOUR_CLOUDINARY_API_SECRET
Replace
USER
,YOUR_PASSWORD
,YOUR.database.windows.net
,your_SECRET
,CLOUDINARY
,YOUR_CLOUDINARY_API_KEY
, andYOUR_CLOUDINARY_API_SECRET
with your actual credentials and information. -
Install dependencies:
npm install
-
Run the project:
npm start
The server should now be running on port 5000.
routes
: Contains the route definitions for the API.controllers
: Contains the logic for handling requests.models
: Contains the database models.middleware
: Contains the middleware functions.