A modern React blog application with admin interface for content management.
- Frontend: React-based blog with responsive design
- Admin Interface: Full CRUD operations for blog posts
- Authentication: Secure admin login with session management
- Database: SQLite for data persistence
- Network: Accessible from LAN with dynamic API configuration
IMPORTANT: Before running the application, you must configure your environment:
-
Copy Environment Template
cp .env.example .env
-
Edit
.envfile with your settings:- Set
ADMIN_PASSWORDto a secure password - Configure
SERVER_IPfor your network - Generate a secure
SESSION_SECRET
- Set
-
Generate Session Secret (optional):
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" -
Install Dependencies
npm install
-
Start the Application
./start-servers.sh
-
Access the Blog
- Admin Panel:
http://YOUR_SERVER_IP:5000/admin - Credentials: Set via environment variables (
ADMIN_USERNAMEandADMIN_PASSWORDin.env) - Default Username:
admin(configurable in.env)- Website:
http://YOUR_SERVER_IP:5000 - Admin:
http://YOUR_SERVER_IP:5000/admin
- Website:
- Frontend: React app served on port 5000
- Backend: Express.js API server on port 5001
- Database: SQLite (
backend/blog.db) - API Config: Dynamic hostname detection for LAN access
/path/to/your/project/
├── backend/
│ ├── server.js # Express API server
│ └── blog.db # SQLite database
├── src/
│ ├── admin/ # Admin interface components
│ ├── components/ # React components
│ ├── views/ # Page components
│ └── config/
│ └── api.js # API configuration
├── build/ # Production build
└── start-servers.sh # Server startup script
npm run build- Build production versionnpm run serve- Serve production buildnpm start- Development server./start-servers.sh- Start both servers
The SQLite database contains:
admin_users- Admin authenticationblog_posts- Blog content
The application uses dynamic API configuration:
- Detects current hostname automatically
- Works with both localhost and LAN access
- No hardcoded IP addresses
- Password hashing with bcrypt
- Session-based authentication
- CORS protection
- SQL injection prevention
This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details.
- ✅ You can use, modify, and distribute this software
- ✅ You can use it for commercial purposes
- ✅ You can distribute modified versions
⚠️ Any derivative work must also be licensed under GPL v3+⚠️ You must include the original license and copyright notice⚠️ You must document any changes you make
For more information about GPL v3, visit: https://www.gnu.org/licenses/gpl-3.0.html
Copyright (C) 2024 Andrew Hermann
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.