A modern, full-stack blog platform built with React, Express.js, and MongoDB. InkWell provides a complete blogging solution with user authentication, rich text editing, comment system, and responsive design.
- 🔐 User Authentication - Secure JWT-based authentication system
- 📝 Rich Text Editor - Create beautiful blog posts with React Quill
- 💬 Comment System - Interactive commenting with real-time updates
- 🔍 Search Functionality - Advanced search across posts and content
- 📱 Responsive Design - Mobile-first approach with Tailwind CSS
- 🎨 Modern UI/UX - Clean, intuitive interface with dark/light themes
- 🔒 Security First - Comprehensive security measures and best practices
- ⚡ Performance Optimized - Fast loading times and efficient data handling
- 👥 User Profiles - Personalized user dashboards and profiles
- 📊 Admin Dashboard - Content management and user administration
InkWell follows a modern monorepo architecture with clear separation of concerns:
Blog Website/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React contexts
│ │ ├── hooks/ # Custom React hooks
│ │ └── utils/ # Utility functions
│ └── public/ # Static assets
├── backend/ # Express.js backend API
│ ├── controllers/ # Route controllers
│ ├── models/ # MongoDB schemas
│ ├── routes/ # API routes
│ ├── middleware/ # Custom middleware
│ └── utils/ # Backend utilities
└── package.json # Root monorepo configuration
- Node.js (v18 or higher)
- npm or yarn
- MongoDB database
- Git
-
Clone the repository
git clone https://github.com/yourusername/inkwell-blog.git cd inkwell-blog -
Install dependencies
npm run install:all
-
Environment Setup
Create
.envfiles in both frontend and backend directories:Backend (.env)
NODE_ENV=development PORT=7777 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key JWT_EXPIRE=7d COOKIE_EXPIRE=7 CLOUDINARY_API_KEY=your_cloudinary_key CLOUDINARY_API_SECRET=your_cloudinary_secret
Frontend (.env)
REACT_APP_API_URL=http://localhost:7777/api
-
Start development servers
# Start both frontend and backend concurrently npm run dev # Or start them separately npm run dev:backend # Backend on http://localhost:7777 npm run dev:frontend # Frontend on http://localhost:3000
-
Connect Repository
- Link your GitHub repository to Render
- Create a new Web Service
-
Environment Variables Set the following environment variables in Render dashboard:
NODE_ENV=production PORT=10000 MONGODB_URI=your_production_mongodb_uri JWT_SECRET=your_production_jwt_secret JWT_EXPIRE=7d COOKIE_EXPIRE=7 CLOUDINARY_API_KEY=your_cloudinary_key CLOUDINARY_API_SECRET=your_cloudinary_secret REACT_APP_API_URL=your_render_backend_url GENERATE_SOURCEMAP=false
-
Build Configuration
- Build Command:
chmod +x render-build.sh && ./render-build.sh - Start Command:
cd backend && npm start - Root Directory: Leave empty
- Build Command:
- React 18 - Modern React with hooks and functional components
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Axios - HTTP client for API calls
- React Hook Form - Form handling and validation
- React Quill - Rich text editor
- React Context - State management
- Express.js - Fast, unopinionated web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Token authentication
- bcrypt - Password hashing
- Multer - File upload handling
- Helmet - Security middleware
- CORS - Cross-origin resource sharing
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current user
GET /api/posts- Get all posts (with pagination)POST /api/posts- Create new postGET /api/posts/:id- Get specific postPUT /api/posts/:id- Update postDELETE /api/posts/:id- Delete post
GET /api/posts/:id/comments- Get post commentsPOST /api/comments- Add commentPUT /api/comments/:id- Update commentDELETE /api/comments/:id- Delete comment
GET /api/users- Get all users (admin only)GET /api/users/:id- Get user profilePUT /api/users/:id- Update user profileDELETE /api/users/:id- Delete user (admin only)
GET /api/search- Search posts and usersGET /api/health- Health check endpoint
- JWT Authentication - Secure token-based authentication
- Password Hashing - bcrypt for password security
- CORS Protection - Cross-origin request handling
- Rate Limiting - API request throttling
- XSS Protection - Cross-site scripting prevention
- MongoDB Injection Protection - Query sanitization
- Helmet Security Headers - Additional security headers
- Input Validation - Comprehensive input sanitization
[Add screenshots of your application here]
# Run frontend tests
cd frontend && npm test
# Run backend tests
cd backend && npm testnpm run install:all # Install all dependencies
npm run build # Build both frontend and backend
npm run dev # Start both development servers
npm start # Start production servernpm start # Start development server
npm run build # Build for production
npm test # Run tests
npm run eject # Eject from Create React Appnpm start # Start production server
npm run dev # Start development server with nodemon
npm test # Run testsWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Test thoroughly
- Commit your changes
git commit -m 'Add amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
Build fails on Render
- Verify all environment variables are set correctly
- Check MongoDB connection string format
- Ensure Node.js version compatibility
Frontend can't connect to backend
- Verify CORS configuration
- Check API URL in environment variables
- Ensure backend server is running
Static files not serving
- Confirm frontend build exists in
frontend/build/ - Check static file path in
backend/app.js
This project is licensed under the MIT License - see the LICENSE file for details.
Your Name
- GitHub: @Om-Shree-0709
- LinkedIn: Om Shree
- Portfolio: My Portfolio
- React team for the amazing framework
- Express.js community for the robust backend framework
- Tailwind CSS for the utility-first styling approach
- MongoDB for the flexible database solution
⭐ Star this repository if you found it helpful!
Note: This is a monorepo setup where the backend serves the frontend build files in production. The frontend build is placed inside the backend folder during deployment for optimal performance.