A full-stack personal blog platform built with the MERN stack (MongoDB, Express, React, Node.js), featuring modern deployment and DevOps practices.
- User authentication (register, login, profile management)
- Create, edit, publish, and delete blog posts
- Tag posts and filter by tags
- Responsive design with Tailwind CSS
- Comprehensive monitoring and error tracking
- Secure configuration with environment variables
- CI/CD pipeline with GitHub Actions
- Node.js (v16+)
- MongoDB database (local or Atlas)
- Git
- Express.js
- MongoDB with Mongoose
- JWT Authentication
- Winston (logging)
- PM2 (process management)
- React with Vite
- React Router
- Tailwind CSS
- Axios
- Sentry (error tracking)
- GitHub Actions (CI/CD)
- Render (hosting)
- PM2 (process management)
git clone https://github.com/Derrick-Ryan-Giggs/mern-blog-platform.git
cd mern-blog-platform# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create a .env file with the following variables
# NODE_ENV=development
# PORT=5000
# MONGO_URI=your_mongodb_connection_string
# JWT_SECRET=your_jwt_secret
# Run development server
npm run dev# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Create a .env file with the following variables
# VITE_API_URL=http://localhost:5000
# VITE_SENTRY_DSN=your_sentry_dsn (optional for development)
# Run development server
npm run dev- Create a new Web Service on Render
- Connect your GitHub repository
- Configure the service:
- Build Command:
cd backend && npm install - Start Command:
cd backend && npm start - Add environment variables in Render dashboard
- Build Command:
- Connect your GitHub repository to Vercel
- Configure the build settings:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory: dist
- Add environment variables in Vercel dashboard
You can access the live version of the blog here: Live Blog Platform
The project uses GitHub Actions for continuous integration and deployment:
-
On every push to main branch:
- Backend tests are run
- Frontend is built and tested
- If all tests pass, deployment is triggered
-
On pull requests:
- All tests are run
- Build verification is performed
- Status checks must pass before merging
- Winston for structured logging
- Log files stored in
/logsdirectory - Render dashboard provides resource usage metrics
- Sentry for error tracking and performance monitoring
- React DevTools for component debugging
- Lighthouse for performance analysis
- JWT authentication with secure cookie storage
- HTTPS enforcement in production
- Environment variables for sensitive credentials
- API rate limiting to prevent abuse
- Data sanitization against XSS and NoSQL injection
- Security headers with Helmet.js
# Run backend tests
cd backend
npm test
# Run frontend tests
cd frontend
npm test- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add an amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.