A full-stack blog application built with React, Bootstrap, and a backend API running on Node.js and Express with MongoDB. The project enables users to register, create, edit, delete posts, and recover passwords through email. The frontend fetches data from the backend API to deliver a seamless blogging experience.
-
User Authentication: Register and log in securely. Password recovery is also implemented using email verification.
-
CRUD Operations: Create, read, update, and delete blog posts. Users can manage their own posts.
-
Responsive Design: The React frontend, built with Bootstrap, ensures a responsive and user-friendly experience on various devices.
To install all the dependencies, run:
yarn
Create a .env
file in the backend
folder. Example:
MONGODB_URI=mongodb://127.0.0.1:27017/exampleDB
SECRET_KEY=yoursecretkey
PORT=4000
FROM_ADDRESS=example@email.com
EMAIL_PASSWORD=password
SMTP_HOST=smtp.example.com
FRONTEND_URL=http://localhost:3000/
If you don't set the PORT for the backend in the .env file, it will use port 4000 as the default and the FRONTEND_URL will default to localhost:3000, which is used for creating the password reset link.
yarn start
You can use the backend API with any frontend language. Below are the available endpoints:
Creates a user and returns a token and userId.
Sends a password reset email to the provided address.
Changes the password in the database using the provided token.
Logs in the user and returns a token and userId.
Returns all blog posts in the database.
Returns the post with the given ID.
Returns all posts by the logged-in user.
Creates a new blog post.
Updates the post with the given ID.
Deletes the post with the given ID.