This project is a full-stack web application that uses AI to generate blog posts. It's built with the MERN stack (MongoDB, Express.js, React, Node.js) and integrates with the Anthropic API for content generation.
- Generate blog posts using AI
- View a list of generated blog posts
- Read individual blog posts
- Delete blog posts
- Responsive design for various screen sizes
Before you begin, ensure you have met the following requirements:
- Node.js (v14 or later)
- npm (usually comes with Node.js)
- MongoDB (local installation or a MongoDB Atlas account)
- Anthropic API key
-
Clone the repository:
git clone https://github.com/dc5212/AI-Blog-Generator.git cd ai-blog-generator -
Install backend dependencies:
cd backend npm install -
Install frontend dependencies:
cd ../frontend npm install -
In the
.envfile in thebackenddirectory replace the ANTHROPIC_API_KEY with your own key:ANTHROPIC_API_KEY=your_anthropic_api_key
-
Start the backend server:
cd backend npm startThe server should start running on
http://localhost:5000. -
In a new terminal, start the frontend development server:
cd frontend/blog-generator npm install react-scripts npm startThe React app should open in your default browser at
http://localhost:3000.
- On the home page, you'll see a list of existing blog posts (if any).
- Click on "Generate New Blog" to create a new blog post.
- Enter a prompt for the AI to generate content based on.
- Click "Generate Post" and wait for the AI to create the content.
- The new post will open in a new tab and be added to the list on the home page.
- Click on a blog post title to read its full content.
- Use the "Delete" button to remove a blog post.