A modern, full-stack developer blog platform focused on sharing real-world coding errors and their solutions. Dev-Bug-Coder-Blog empowers developers to post, discuss, and resolve bugs, fostering a collaborative learning environment.
- Oline-Live: https://dev-bug-coder-blog.vercel.app/
- User Authentication: Register, login, logout, JWT-based authentication, password reset via email.
- Post Management: Create, edit, delete, and view posts with code snippets, screenshots, and tags.
- Comment System: Nested comments with image uploads, edit/delete, like/helpful toggles, and reply functionality.
- Like & Helpful: Mark posts and comments as liked or helpful.
- Save Posts: Save/unsave posts for quick access.
- Report Posts: Report inappropriate posts (admin review).
- Notifications: Real-time notifications for likes, comments, helpful marks, and reports.
- Admin Panel: View and manage reported posts.
- Responsive UI: Mobile-friendly, clean, and modern design.
- Tag System: Tag posts, filter/search by tags, and view popular topics.
- Profile Management: Edit profile, upload avatar, change password.
- Security: Secure password hashing, JWT, CORS, and input validation.
- API: RESTful API built with Express and Prisma.
- Frontend: React, TypeScript, Vite, Tailwind CSS, Axios, React Router
- Backend: Node.js, Express, Prisma (MongoDB), Multer, JWT, Nodemailer
- Database: MongoDB (Atlas)
- Deployment: Vercel (frontend), Render (backend)
- Other: ESLint, Prettier, SVGR, dotenv
dev-bug-blog/
βββ prisma/ # Prisma schema and migrations
βββ public/ # Static assets (e.g., vite.svg)
βββ src/ # Frontend source code
β βββ api.ts # Axios API client
β βββ components/ # Reusable React components
β βββ pages/ # Page-level React components
β βββ types/ # TypeScript types and custom.d.ts
β βββ assets/ # Images and icons
βββ routes/ # Express route handlers (backend)
βββ middleware/ # Express middleware (e.g., authentication)
βββ uploads/ # Uploaded images (avatars, screenshots)
βββ .env # Environment variables (not committed)
βββ server.js # Express server entry point
βββ package.json # Project scripts and dependencies
βββ vite.config.ts # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ README.md # Project documentation
Please Look Above
git clone https://github.com/arnobt78/Dev-Bug-Coder-Blog--ReactVite.git
cd Dev-Bug-Coder-Blog--ReactVite
npm install
- Copy
.env.example
to.env
(or use the providedsetup-env.sh
script). - Fill in your MongoDB URI, JWT secret, email credentials, and URLs.
Example .env
(do not commit secrets):
DATABASE_URL="your-mongodb-uri"
JWT_SECRET="your-jwt-secret"
EMAIL_USER="your-email"
EMAIL_PASS="your-app-password"
FRONTEND_URL=http://localhost:5173
BACKEND_URL=http://localhost:5000
VITE_FRONTEND_URL=http://localhost:5173
VITE_BACKEND_URL=http://localhost:5000
NODE_ENV=development
PORT=5000
npx prisma generate
npm run dev
- Frontend: http://localhost:5173
- Backend/API: http://localhost:5000
- Build Command:
npm run build
- Output Directory:
dist
- Install Command:
npm install
- Environment Variables:
VITE_FRONTEND_URL=https://your-frontend-url
VITE_BACKEND_URL=https://your-backend-url
VITE_ADMIN_EMAIL=your-admin-email
- Use
npm start
as the start command. - Set all backend-related environment variables (see
.env
). - Make sure
FRONTEND_URL
andBACKEND_URL
are set to your deployed URLs (no trailing slash).
Name | Description | Frontend (Vercel) | Backend (Render) |
---|---|---|---|
DATABASE_URL | MongoDB connection string | β | β |
JWT_SECRET | JWT secret key | β | β |
EMAIL_USER | Email for SMTP | β | β |
EMAIL_PASS | Email password/app password | β | β |
FRONTEND_URL | Frontend URL (no trailing slash) | β | β |
BACKEND_URL | Backend URL (no trailing slash) | β | β |
VITE_FRONTEND_URL | Frontend URL (for Vite) | β | β |
VITE_BACKEND_URL | Backend URL (for Vite) | β | β |
VITE_ADMIN_EMAIL | Admin email (for admin features) | β | β |
NODE_ENV | Environment (development/production) | β | β |
PORT | Backend port | β | β |
- Authentication: Secure JWT-based login/register, password reset.
- Posts: Create, edit, delete, like, mark helpful, save, report.
- Comments: Nested, like/helpful, edit/delete, reply, image upload.
- Notifications: For likes, helpful, comments, reports.
- Admin: Manage reported posts.
- Profile: Edit profile, avatar upload, change password.
- Tagging: Tag posts, filter/search by tag.
- Search: Search posts by title, description, content, or tag.
- Responsive Design: Works on all devices.
POST /api/auth/register
- Register userPOST /api/auth/login
- Login userPOST /api/auth/forgot-password
- Send password reset emailPOST /api/auth/reset-password
- Reset passwordGET /api/posts
- Get all postsPOST /api/posts
- Create postGET /api/posts/:id
- Get post detailsPUT /api/posts/:id
- Edit postDELETE /api/posts/:id
- Delete postPOST /api/posts/:id/like
- Like/unlike postPOST /api/posts/:id/helpful
- Mark/unmark post as helpfulPOST /api/posts/:id/save
- Save postPOST /api/posts/:id/unsave
- Unsave postPOST /api/reports
- Report postGET /api/comments/post/:postId
- Get comments for postPOST /api/comments/post/:postId
- Add commentPUT /api/comments/:id
- Edit commentDELETE /api/comments/:id
- Delete commentPOST /api/comments/:id/like
- Like/unlike commentPOST /api/comments/:id/helpful
- Mark/unmark comment as helpfulGET /api/users/me/saved-posts
- Get user's saved postsGET /api/notifications
- Get notificationsPOST /api/notifications/mark-all-read
- Mark all notifications as read
developer blog
, coding errors
, bug fixes
, React
, Node.js
, MongoDB
, Prisma
, Express
, Vite
, Tailwind CSS
, JWT
, REST API
, full stack
, community
, notifications
, admin
, report
, save post
, comment
, like
, helpful
, tag
, search
, responsive
, modern
, open source
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
Happy coding! π