A modern, full-stack article publishing platform built with React, Node.js, and MongoDB. Share your thoughts, connect with writers, and discover inspiring content.
- Rich markdown editor with live preview
- Article drafts and publishing workflow
- Featured image uploads with Cloudinary integration
- SEO-optimized article pages with meta tags
- Article preview functionality before publishing
- Tag and category organization
- User profiles with bio and social links
- Follow/unfollow system
- View followers and following lists
- User discovery through profiles
- Google OAuth authentication
- Traditional email/password auth
- Responsive design for all devices
- Modern, minimalist UI
- Dark/light theme support
- Real-time connection status
- Error boundaries and graceful error handling
- Loading states and skeleton screens
- JWT authentication with secure token management
- File upload with Cloudinary integration
- MongoDB with Mongoose ODM
- RESTful API architecture
- Rate limiting and security middleware
- Environment-based configuration
- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- Cloudinary account (for image uploads)
- Firebase project (for Google OAuth)
-
Clone the repository
git clone https://github.com/yourusername/article-app.git cd article-app -
Backend Setup
cd Backend npm install -
Frontend Setup
cd ../Frontend npm install
# Database
MONGODB_URI=mongodb://localhost:27017/article-app
# JWT
JWT_SECRET=your-super-secret-jwt-key
# Cloudinary
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# Firebase Admin
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY=your-private-key
FIREBASE_CLIENT_EMAIL=your-client-email
# Server
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173# API Configuration
VITE_API_URL=http://localhost:5000/api
VITE_APP_ENV=development
# Firebase Client
VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-auth-domain
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-storage-bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
VITE_FIREBASE_APP_ID=your-app-id-
Start the Backend
cd Backend npm start -
Start the Frontend
cd Frontend npm run dev -
Access the App
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000/api
Article-App/
βββ Backend/
β βββ config/
β β βββ firebase.js # Firebase Admin setup
β βββ middleware/
β β βββ auth.js # JWT authentication
β β βββ upload.js # Cloudinary uploads
β β βββ validation.js # Request validation
β βββ models/
β β βββ Article.js # Article schema
β β βββ User.js # User schema
β βββ routes/
β β βββ articles.js # Article CRUD
β β βββ auth.js # Authentication
β β βββ users.js # User management & follow system
β βββ utils/
β β βββ helpers.js # Utility functions
β βββ server.js # Express server
βββ Frontend/
β βββ public/
β β βββ _redirects # Netlify redirects
β β βββ vercel.json # Vercel config
β βββ src/
β β βββ components/
β β β βββ ErrorBoundary.jsx
β β β βββ FollowButton.jsx
β β β βββ FollowList.jsx
β β β βββ FollowModal.jsx
β β β βββ Navigation.jsx
β β β βββ ProtectedRoute.jsx
β β β βββ SEOHead.jsx
β β βββ context/
β β β βββ AuthContext.jsx # Authentication state
β β βββ pages/
β β β βββ ArticleView.jsx # Article reading page
β β β βββ Dashboard.jsx # User dashboard
β β β βββ Home.jsx # Homepage with articles
β β β βββ Login.jsx # Login page
β β β βββ NotFound.jsx # 404 page
β β β βββ Preview.jsx # Article preview
β β β βββ Profile.jsx # User profile editor
β β β βββ PublicProfile.jsx # Public user profiles
β β β βββ Register.jsx # Registration page
β β β βββ Write.jsx # Article editor
β β βββ services/
β β β βββ firebaseAuth.js # Firebase client
β β βββ utils/
β β β βββ api.js # API client
β β β βββ config.js # App configuration
β β β βββ helpers.js # Utility functions
β β βββ App.jsx # Main app component
β βββ package.json
βββ README.md
The app supports two authentication methods:
- User registration with email verification
- Secure password hashing with bcrypt
- JWT token-based authentication
- Firebase Google Sign-In integration
- Seamless account creation and login
- Secure token verification on backend
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/google- Google OAuth
GET /api/articles- Get published articlesGET /api/articles/:slug- Get article by slugPOST /api/articles- Create new articlePUT /api/articles/:id- Update articleDELETE /api/articles/:id- Delete articlePOST /api/articles/:id/like- Like/unlike article
GET /api/users/username/:username- Get user by usernamePOST /api/users/:id/follow- Follow/unfollow userGET /api/users/:id/followers- Get user followersGET /api/users/:id/following- Get user followingGET /api/users/:id/follow-status- Check follow status
- Set up environment variables on your hosting platform
- Configure MongoDB Atlas connection
- Set up Cloudinary and Firebase credentials
- Deploy to platforms like Railway, Render, or Heroku
- Build the project:
npm run build - Deploy to Netlify, Vercel, or any static hosting
- Configure environment variables
- Set up redirects for client-side routing
Ensure all sensitive keys are properly configured in your hosting platform's environment settings.
- All environment variables are set on hosting platform (not in code)
- Debug logging is disabled in production builds
- API keys and tokens are never logged or exposed
- CORS origins are properly configured for production domains
- Rate limiting is enabled
- HTTPS is enforced on both frontend and backend
- Never commit
.envfiles to version control - Use your hosting platform's environment variable settings
- Rotate API keys and secrets regularly
- Use different Firebase projects for development and production
npm start- Start production servernpm run dev- Start development server with nodemon
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production build
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
If you have any questions or need help, please:
- Check the documentation
- Search existing issues
- Create a new issue with detailed information
Built with β€οΈ using React, Node.js, and MongoDB