Tech-Blogger-Developer-Blog

TechBlogger

TechBlogger is a modern, full-stack blogging platform designed for tech enthusiasts, writers, and administrators. It provides a seamless experience for both regular users and admins, featuring user authentication, post management, analytics, and a robust API key system for integrations.

🌟 Features

πŸ› οΈ Tech Stack

🧩 Architecture Overview

Front-End (React)

The front-end is built with React.js, providing a dynamic and responsive user interface. It features:

The React app communicates with the backend via RESTful API calls (using fetch).

Back-End (Flask)

The backend is powered by Flask (Python), exposing RESTful API endpoints for all core functionalities:

The backend validates API keys for protected endpoints, ensuring secure access.

Database (SQLite)

The default database is SQLite, a lightweight file-based database ideal for development and small deployments. It stores:

You can easily swap SQLite for MySQL or PostgreSQL by updating the backend configuration and models.

πŸš€ Getting Started

Prerequisites

1. Clone the Repository

git clone <repo-url>
cd react-example

2. Install Frontend Dependencies

npm install

3. Install Backend Dependencies

cd src/components
pip install flask flask-cors
# Or, if requirements.txt is present:
# pip install -r requirements.txt

4. Run the Backend

python app.py
# or the relevant backend file
# Backend runs on http://localhost:5000 by default

5. Run the Frontend

cd ../..
npm start
# Frontend runs on http://localhost:3000 by default

6. Build for Production

npm run build

7. Run Tests

npm test

The app will be available at http://localhost:3000.

🏷️ Pricing & Subscription Tiers

TechBlogger now offers multiple subscription plans:

Compare features and choose a plan in the Services section of the app.

πŸ›‘οΈ Role-Based Access Control

🏠 Enhanced Home & Community Features

πŸ—οΈ Code Structure

react-example/
β”œβ”€β”€ public/                # Static assets (images, icons, etc.)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Admin.js       # Admin dashboard (user/admin management, reports, settings)
β”‚   β”‚   β”œβ”€β”€ User.js        # User dashboard (posts, analytics, settings)
β”‚   β”‚   β”œβ”€β”€ ...            # Other React components & backend scripts
β”‚   β”œβ”€β”€ App.js             # Main React app
β”‚   └── index.js           # React entry point
β”œβ”€β”€ package.json           # Frontend dependencies
└── ...

πŸ”‘ API Key System

Both admins and users have access to a personal API key, which can be used to authenticate requests to protected API endpoints.

Sample usage:

// Node.js (axios)
const axios = require('axios');
axios.get('http://localhost:5000/api/protected', {
  headers: { 'x-api-key': 'YOUR_API_KEY' }
})
.then(res => console.log(res.data));
# Python (requests)
import requests
response = requests.get(
    'http://localhost:5000/api/protected',
    headers={'x-api-key': 'YOUR_API_KEY'}
)
print(response.json())

πŸ‘€ User Experience

πŸ“‚ Backend API Endpoints (Sample)

πŸ“ Customization

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

πŸ“„ License

MIT

🚒 Deployment

You can deploy the frontend and backend separately. For example:

Deploying the Backend (Flask) to Heroku

  1. Add a Procfile:
    web: python src/components/app.py
    
  2. Commit your code and push to Heroku.

Deploying the Frontend (React) to Vercel/Netlify

  1. Push your code to GitHub.
  2. Connect your repo to Vercel or Netlify and follow their deployment steps.

Make sure to update API URLs to use your deployed backend!

πŸ™ Credits