BlogIt is a web application that allows users to create, read, and manage blog posts.
- User authentication (registration and login)
- Create, edit, and delete blog posts
- Markdown support for writing posts
- Intuitive design with a clean UI
- Protected routes for creating and managing content
- Frontend: React, Toast-UI Editor, Toastify.js, Validator.js, React Query, Nodemailer, Googleapis
- Backend: Node.js, Express, Passport.js, JsonWebToken, Bcrypt.js
- Database: MongoDB (using Mongoose)
- Styling: SCSS (custom styles and transitions)
- Development Tools: VS Code, Postman (for API testing)
To set up BlogIt locally, follow these steps:
-
Clone the repository:
git clone https://github.com/JuhilSavani/BlogIt.git cd BlogIt
-
Install dependencies for the backend:
cd server npm install --force
-
Set up the environment variables. Create a .env file in the server directory with the following variables:
- Copy the .env.example file to .env in the server directory:
cp .env.example .env
- Update the values in the .env file as needed (e.g.,
DB_URI
,ACCESS_TOKEN_SECRET
,REFRESH_TOKEN_SECRET
).
- Copy the .env.example file to .env in the server directory:
-
Install dependencies for the frontend:
cd ../client npm install --force
-
Start the backend:
cd server npm run dev
-
In another terminal, start the frontend:
cd client npm run dev
-
Open your browser and access the application at http://localhost:3000.
- Registration: New users can create an account to access all features.
- Login: Registered users can log in to create and manage their blog posts.
- Create Post: Authenticated users can create new blog posts using rich text editor.
- Update Post: Authenticated users can update their existing blog post using rich text editor.
- Read Posts: All users can view blog posts created by others.
-
Authentication
/authorize
- POST
/register
- Register a new user - POST
/login
- Log in a user - POST
/logout
- Log out a user - GET
/refresh
- Refresh the authentication token
- POST
-
Verification
/verify
- GET
/:email
- Verify if the email is legit - POST
/account
- Check if the username or email already exists
- GET
-
Blog Posts
/protected
- GET
/retreive/blogs
- Retrieve all blog posts (protected) - GET
/retreive/blog/:id
- Retrieve single blog post (protected) - POST
/publish/blog
- Create a new blog post (protected) - PUT
/edit/blog/:id
- Update a blog post (protected) - DELETE
/delete/blog/:id
- Delete a blog post (protected)
- GET
Contributions are welcome! If you have suggestions or improvements, please fork the repository and create a pull request.
Happy coding! 🚀