Skip to content

michael-lfc/Tech-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Tech-blog

A full-stack blogging platform built with React and Node.js + Express, allowing users to create posts, react with emojis, comment, and manage profiles. Fully deployed with Vercel (frontend) and Render (backend).

🌟 Live Demo

GitHub Repo: https://github.com/michael-lfc/Tech-blog

Frontend (Vercel): https://tech-blog-qz17.vercel.app

Backend API (Render): https://tech-blog-5-28i4.onrender.com

🎨 Features

βœ… User authentication (login/register)

βœ… Create, edit, and delete posts

βœ… React to posts with emojis

βœ… Comment on posts

βœ… View public profiles

βœ… Responsive design for mobile & desktop

πŸ“ Project Structure Tech-blog/ β”œβ”€ client/ # React frontend β”‚ β”œβ”€ public/ β”‚ β”œβ”€ src/ β”‚ └─ package.json └─ server/ # Node.js backend β”œβ”€ controllers/ β”œβ”€ middlewares/ β”œβ”€ models/ β”œβ”€ db.js └─ package.json

⚑ Screenshots

πŸ› οΈ Tech Stack Frontend Backend Database Deployment React Node.js MongoDB Vercel (frontend), Render (backend) CSS Express πŸ’» Getting Started (Local) Backend Setup

Navigate to the server folder:

cd server

Install dependencies:

npm install

Create a .env file with placeholder values:

PORT=5000 MONGO_URI=your_mongo_connection_string_here JWT_SECRET=your_jwt_secret_here FRONTEND_URL=http://localhost:3000

Replace these with your real secrets locally. Never commit your real .env to GitHub.

Start the backend server:

npm start

Backend runs at http://localhost:5000.

Frontend Setup

Navigate to the client folder:

cd client

Install dependencies:

npm install

Create a .env file:

REACT_APP_API_BASE=http://localhost:5000/api

Start the frontend:

npm start

Frontend runs at http://localhost:3000.

πŸš€ Deployment Backend (Render)

Root Directory: server/

Environment Variables (set in Render dashboard):

FRONTEND_URL=https://tech-blog-qz17.vercel.app PORT=5000 MONGO_URI=your_mongo_connection_string_here JWT_SECRET=your_jwt_secret_here

Use your real secrets here, not the placeholders.

Frontend (Vercel)

Root Directory: client/

Build Command: npm run build

Output Directory: build

Environment Variable:

REACT_APP_API_BASE=https://tech-blog-5-28i4.onrender.com/api

πŸ”— API Endpoints Users

POST /api/users/register β†’ Register new user

POST /api/users/login β†’ Login

GET /api/users/profile β†’ Get your profile

PUT /api/users/me β†’ Update your profile

GET /api/users/public/:id β†’ View public profile

Posts

GET /api/posts β†’ Fetch posts

POST /api/posts β†’ Create post

POST /api/posts/:postId/react β†’ React with emoji

POST /api/posts/:postId/comments β†’ Add comment

Most post routes require a JWT token in Authorization headers.

🀝 Contributing

Fork the repository

Create a branch: git checkout -b feature-name

Make your changes

Commit: git commit -m "Add feature"

Push: git push origin feature-name

Open a Pull Request

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors