A modern blog platform where developers can share their coding journey and experiences.
DOM NEWS is a complete blogging website built with:
- Frontend: React.js with modern responsive design
- Backend: Node.js API with MySQL database
- Features: User accounts, article writing, comments, mobile-friendly
✅ User System
- Sign up and log in
- Write and manage your articles
- Comment on other posts
- Personal dashboard
✅ Mobile-First Design
- Works perfectly on phones, tablets, and computers
- Modern glass-style interface
- Hamburger menu for mobile
✅ Article Management
- Create articles with images
- Edit and delete your posts
- View all published articles
- Comment system
- Node.js (version 18 or newer)
- MySQL database
- Code editor (like VS Code)
git clone [your-repo-url]
cd MY-FINAL-blog- Install MySQL on your computer
- Create a new database called
blog_db - Run the SQL file to create tables:
mysql -u root -p blog_db < API/sql/init.sql# Go to backend folder
cd API
# Install packages
npm install
# Create environment file
touch .envAdd this to your .env file:
# Database Connection
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=blog_db
# Security
JWT_SECRET=your_secret_key_here_make_it_long_and_random
JWT_EXPIRES_IN=24h
# Server
PORT=3000
# Email (Optional - for password reset)
RESEND_API_KEY=your_resend_key_if_you_want_emailsStart the backend:
npm startBackend runs on: http://localhost:3000
# Go to frontend folder (open new terminal)
cd Frontend/blog
# Install packages
npm install
# Start the website
npm run devFrontend runs on: http://localhost:5173
- Open http://localhost:5173 in your browser
- Create an account
- Write your first article
- Test on mobile by making browser window small
MY-FINAL-blog/
├── Frontend/blog/ # Website (React)
│ ├── src/
│ │ ├── component/ # All the website parts
│ │ ├── assets/css/ # Styling files
│ │ └── utils/ # Helper functions
│ └── package.json
│
├── API/ # Server (Node.js)
│ ├── src/
│ │ ├── controller/ # Business logic
│ │ ├── model/ # Database operations
│ │ ├── router/ # API routes
│ │ └── config/ # Settings
│ ├── .env # Your secret settings
│ └── package.json
│
└── README.md # This file
The project creates these tables automatically:
- users: People who sign up
- articles: Blog posts
- comments: Comments on articles
- admins: Admin permissions
Create a .env file in the API folder with these settings:
# Your MySQL database info
DB_HOST=localhost # Where your database is (usually localhost)
DB_USER=root # Your MySQL username
DB_PASSWORD=yourpassword # Your MySQL password
DB_NAME=blog_db # Name of the database
# Security for login tokens
JWT_SECRET=make_this_very_long_and_random_123456
JWT_EXPIRES_IN=24h # How long users stay logged in
# Server settings
PORT=3000 # Which port the server uses
# Email service (optional)
RESEND_API_KEY=your_key # Only if you want password reset emails🎯 Project Duration: 2 months (May 2024 - July 2024)
- ✅ Project planning and design
- ✅ Database design and setup
- ✅ Basic backend API structure
- ✅ React frontend initialization
- ✅ User authentication (sign up, login)
- ✅ Article creation and management
- ✅ Basic UI components
- ✅ Database connections
- ✅ Comment system
- ✅ User dashboard
- ✅ Image upload functionality
- ✅ API security and validation
- ✅ Mobile-first responsive design
- ✅ Glass morphism UI styling
- ✅ Password management
- ✅ Final testing and bug fixes
Final Result: Complete, production-ready blog platform
- Create Account: Sign up as a new user
- Write Articles: Share your coding experiences
- Upload Images: Add pictures to your articles
- Comment: Engage with other developers
- Manage Content: Edit or delete your posts
- Mobile Use: Access everything from your phone
- Glass Effect: Modern transparent design
- Mobile-First: Perfect on all devices
- Fast Loading: Optimized for speed
- User-Friendly: Easy navigation and use
Backend won't start?
- Check if MySQL is running
- Verify .env file has correct database password
- Make sure port 3000 isn't being used
Frontend won't start?
- Run
npm installagain - Check if port 5173 is available
- Try
npm run buildthennpm run preview
Can't create articles?
- Make sure both frontend and backend are running
- Check browser console for errors
- Verify you're logged in
If you have issues:
- Check the browser console for error messages
- Look at the terminal where servers are running
- Make sure .env file is configured correctly
- Verify MySQL database is running
DOM NEWS - Document your development journey! 🚀
A complete blog platform built with modern web technologies for developers by developers.