A Blogspot-inspired blogging platform built with React and Node.js. This application allows users to create, read, update, and delete blog posts, as well as interact with other users through comments.
- User authentication (register, login, logout)
- Create, edit, and delete blog posts
- Comment on posts
- Categorize posts with categories and tags
- Search functionality
- User profiles
- Responsive design
- React.js
- React Router for navigation
- CSS for styling
- Node.js
- Express.js
- In-memory data store (can be replaced with a database)
- JWT for authentication
blog-platform/
├── client/ # React frontend
│ ├── public/ # Static files
│ └── src/
│ ├── components/ # UI components
│ ├── pages/ # Page components
│ ├── context/ # React context for state
│ ├── utils/ # Utility functions
│ └── styles/ # CSS styles
├── server/ # Node.js backend
│ ├── controllers/ # Request handlers
│ ├── models/ # Data models
│ ├── routes/ # API routes
│ ├── middleware/ # Express middleware
│ └── data/ # In-memory data storage
└── shared/ # Shared code between client/server
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository
git clone <repository-url>
cd blog-platform
- Install dependencies for the server
cd server
npm install
- Install dependencies for the client
cd ../client
npm install
- Start the server (from the server directory)
npm run dev
- Start the client (from the client directory)
npm start
- Open your browser and navigate to
http://localhost:3000
GET /api/posts- Get all postsGET /api/posts/:id- Get a single postPOST /api/posts- Create a new postPUT /api/posts/:id- Update a postDELETE /api/posts/:id- Delete a postGET /api/posts/search/:query- Search posts
GET /api/users- Get all usersGET /api/users/:id- Get a single userPOST /api/users/register- Register a new userPOST /api/users/login- Login user
GET /api/comments/post/:postId- Get all comments for a postPOST /api/comments- Create a new commentPUT /api/comments/:id- Update a commentDELETE /api/comments/:id- Delete a comment
GET /api/categories- Get all categoriesPOST /api/categories- Create a new category
GET /api/tags- Get all tagsPOST /api/tags- Create a new tag
- Add a real database (MongoDB, PostgreSQL, etc.)
- Implement image upload functionality
- Add rich text editor for post creation
- Implement social sharing
- Add analytics dashboard
- Implement email notifications
- Add pagination for posts and comments
The application is configured for deployment to Microsoft Azure. For detailed deployment instructions, see:
- Azure Deployment Guide - Step-by-step instructions for deploying to Azure App Service
- GitHub Actions Workflow - Automated deployment using GitHub Actions
-
Manual Deployment:
- Use the
deploy.jsscript to build and package the application - Deploy the package to Azure App Service manually
- Use the
-
Continuous Deployment with GitHub Actions:
- Set up GitHub Actions to automatically deploy to Azure on code push
- Configure the necessary secrets in your GitHub repository
For production deployment, the following environment variables should be set:
NODE_ENV: Set toproductionPORT: The port on which the server will run (default: 8080)REACT_APP_API_URL: The URL of the API (for the frontend)