revert a2f36b6fac
revert Fixed the READMEs and small fix around the project
This commit is contained in:
@@ -1,144 +1,163 @@
|
||||
# 📝 sld-blocknotes - Modern Block-based Notes & Command Management System
|
||||
# SLD PHP Template
|
||||
|
||||
> **🌐 Languages**: [🇬🇧 English](README.md) | [🇮🇹 Italiano](README.it.md) | [🇪🇸 Español](README.es.md) | [🇫🇷 Français](README.fr.md)
|
||||
A lightweight and modular PHP starter framework for building plain PHP websites without heavy dependencies.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
A powerful, modern, zero-dependency Web application for organizing structured block notes, technical commands, code snippets, and instructions. Built with **Pure PHP**, **Vanilla CSS**, **Vanilla JS**, and **MySQL/MariaDB**.
|
||||
|
||||
Repository URL: [https://gitea.sld-server.org/sld-admin/sld-blocknotes](https://gitea.sld-server.org/sld-admin/sld-blocknotes)
|
||||
This project is designed to provide a clean structure, reusable components, and a simple initialization system to speed up development while keeping full control over the codebase.
|
||||
|
||||
---
|
||||
|
||||
## ✨ Key Features
|
||||
## 🚀 Features
|
||||
|
||||
- 📑 **Structured Block Notes & Subnotes**:
|
||||
- Organize notes into customizable blocknotes.
|
||||
- Notes contain titles, descriptions, and multiple subnotes.
|
||||
- **Collapsible Notes**: Collapsed by default to maximize vertical screen space, with global **Expand All / Collapse All** buttons.
|
||||
|
||||
- ⚡ **Terminal Command Subnotes**:
|
||||
- Separate rendering for generic text subnotes vs terminal command subnotes.
|
||||
- **1-Click Clipboard Copy**: Copy command snippets instantly with visual feedback (`✓ Copied!`).
|
||||
- High-contrast dark IDE code box with max-height vertical scrolling.
|
||||
|
||||
- 🔍 **Real-Time Live Search**:
|
||||
- Filter note titles, descriptions, subnote titles, and terminal command contents instantly inside the active blocknote view.
|
||||
- Automatically expands matched note blocks during search.
|
||||
|
||||
- 📥 / 💾 **JSON Import & Export**:
|
||||
- Download blocknote JSON files with one click (`export_blocknote.php`).
|
||||
- Interactive JSON importer supporting both standard and legacy JSON formats.
|
||||
|
||||
- 🌐 **Multilingual Interface (IT, EN, ES, FR)**:
|
||||
- Full interface localization in **Italian 🇮🇹, English 🇬🇧, Spanish 🇪🇸, and French 🇫🇷**.
|
||||
- Quick navbar language selector for guests and logged-in users.
|
||||
- Each user's language choice is saved to their database profile for future logins.
|
||||
|
||||
- 🏠 **Customizable User Landing Page**:
|
||||
- Choose between launching directly into the **Main Dashboard (All Blocknotes)** or opening a **Specific Default Blocknote** upon login.
|
||||
|
||||
- 👑 **Single Owner Role & Advanced Hierarchy (`owner` > `admin` > `user`)**:
|
||||
- **Immune Owner Account**: The initial Owner account (`owner`) cannot be deleted by any admin or by themselves.
|
||||
- Owners cannot be demoted or altered by standard administrators.
|
||||
|
||||
- ⚙️ **Site Customization (Owner Exclusive)**:
|
||||
- Change the **Global Application / Site Title**.
|
||||
- Upload & validate a **High-Resolution Favicon** (min 64x64px) with real-time preview.
|
||||
|
||||
- 🚀 **First Start Setup Installer Wizard (`first_start.php`)**:
|
||||
- Automated first-time setup wizard for configuring MySQL database credentials, creating database tables, and setting up the initial `owner` and `admin` accounts.
|
||||
- Fully localized in all 4 languages.
|
||||
- ⚡ Lightweight and fast (no external frameworks required)
|
||||
- 📁 Clean and scalable folder structure
|
||||
- 🔧 Centralized configuration system
|
||||
- 🧩 Modular templates (header, footer, includes)
|
||||
- 🎨 Basic frontend setup (CSS variables, animations, JS helpers)
|
||||
- 🛠 Ready-to-use initialization system
|
||||
- ❌ Built-in error pages (environment & database)
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Quickstart & Installation
|
||||
## 📂 Project Structure
|
||||
|
||||
### Requirements
|
||||
- Web Server (Apache, Nginx, or PHP built-in CLI server)
|
||||
- PHP 7.4 or 8.x (with `mysqli` extension enabled)
|
||||
- MySQL 5.7+ or MariaDB 10.x+
|
||||
|
||||
### Step-by-Step Installation
|
||||
|
||||
1. **Clone the Repository**:
|
||||
```bash
|
||||
git clone https://gitea.sld-server.org/sld-admin/sld-blocknotes.git
|
||||
cd sld-blocknotes
|
||||
```
|
||||
|
||||
2. **Start Web Server**:
|
||||
You can serve the directory with your local Web server or use PHP's built-in server:
|
||||
```bash
|
||||
php -S localhost:8000
|
||||
```
|
||||
|
||||
3. **Run Automated Setup Wizard**:
|
||||
Navigate to `http://localhost:8000/` in your browser.
|
||||
The system will automatically detect first-time run and launch `first_start.php`:
|
||||
- Enter your **MySQL Database Credentials** (Host, Database Name, User, Password).
|
||||
- Configure credentials for the **Owner Account**.
|
||||
- Configure credentials for the **First Admin Account**.
|
||||
- Click **⚡ Complete Installation & Configure System**.
|
||||
|
||||
4. **Login & Enjoy**:
|
||||
After setup completes, you will be redirected to `index.php?page=login` to sign in.
|
||||
|
||||
---
|
||||
|
||||
## 📁 Directory Structure
|
||||
|
||||
```text
|
||||
sld-blocknotes/
|
||||
```
|
||||
.
|
||||
├── admin/
|
||||
├── assets/
|
||||
│ ├── css/
|
||||
│ │ └── style.css # Vanilla CSS design system & HSL variables
|
||||
│ ├── img/
|
||||
│ └── js/
|
||||
│ └── main.js # Vanilla JS modals, collapsible notes, search & copy
|
||||
├── blocknotes/ # Blocknotes JSON storage directory
|
||||
│ └── .gitkeep
|
||||
├── config/
|
||||
│ ├── constants.php # Path constants definition
|
||||
│ ├── db.php # MySQL connection, auto-migration & installer redirect
|
||||
│ ├── functions_init.php # Router & page sanitization
|
||||
│ ├── init.php # System initialization
|
||||
│ └── settings.php # Database credentials configuration template
|
||||
├── functions/
|
||||
│ ├── auth.php # Authentication, role permissions & owner protections
|
||||
│ ├── blocknotes.php # Blocknote JSON CRUD engine & JSON importer
|
||||
│ ├── functions.php # Function module autoloader
|
||||
│ ├── lang.php # Multilingual translation dictionary (IT, EN, ES, FR)
|
||||
│ └── site_settings.php # Site title & high-resolution favicon manager
|
||||
├── includes/
|
||||
│ ├── head_links.php # Global CSS & favicon head includes
|
||||
│ └── js_footer.php # Global footer script includes
|
||||
├── pages/
|
||||
│ ├── 404.php # Not found page
|
||||
│ ├── admin_users.php # Admin user management & Owner site settings
|
||||
│ ├── db-error.php # Database error template
|
||||
│ ├── export_blocknote.php # Blocknote JSON download endpoint
|
||||
│ ├── home.php # Main blocknotes dashboard
|
||||
│ ├── login.php # Multilingual login page
|
||||
│ ├── logout.php # Session logout
|
||||
│ ├── profile.php # User profile, password, theme colors, language & landing page
|
||||
│ └── view_blocknote.php # Detail view for blocknotes, collapsible notes & search
|
||||
├── templates/
|
||||
│ ├── footer.php # Page footer template
|
||||
│ └── header.php # Navbar header, logo, user badges & quick language selector
|
||||
├── .gitignore
|
||||
├── first_start.php # Automated First Start Installation Wizard
|
||||
├── index.php # Application entry point & router
|
||||
├── README.md # Main English Documentation
|
||||
├── README.it.md # Italian Documentation
|
||||
├── README.es.md # Spanish Documentation
|
||||
└── README.fr.md # French Documentation
|
||||
├── themes/
|
||||
├── public/
|
||||
├── index.php
|
||||
└── README.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
## ⚙️ Configuration
|
||||
|
||||
This project is open-source software available under the [MIT License](LICENSE).
|
||||
All core configuration is located inside the `config/` directory:
|
||||
|
||||
- `init.php` → Application bootstrap
|
||||
- `constants.php` → Global constants
|
||||
- `settings.php` → App settings
|
||||
- `db.php` → Database connection
|
||||
- `functions_init.php` → Function loader
|
||||
|
||||
---
|
||||
|
||||
## 🧠 How It Works
|
||||
|
||||
1. The application starts from `index.php`
|
||||
2. Core initialization is handled by the config system
|
||||
3. Templates are loaded dynamically (`header.php`, `footer.php`)
|
||||
4. Pages are rendered from the `pages/` directory
|
||||
5. Custom logic can be added via the `functions/` folder
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Frontend
|
||||
|
||||
The project includes a minimal frontend setup:
|
||||
|
||||
### CSS System
|
||||
- Variables-based color system with multiple shades
|
||||
- Basic layout styles
|
||||
- Animation utilities
|
||||
|
||||
### JavaScript
|
||||
- Simple helper functions like dynamic year rendering
|
||||
|
||||
---
|
||||
|
||||
## 🛠 Usage
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://github.com/your-username/sld-php-template.git
|
||||
```
|
||||
|
||||
2. Move it into your web server directory
|
||||
|
||||
3. Configure:
|
||||
- Database (`config/db.php`)
|
||||
- Environment settings (`config/settings.php`)
|
||||
|
||||
4. Open in browser:
|
||||
```
|
||||
http://localhost/your-project
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📄 Pages
|
||||
|
||||
- `home.php` → Main homepage
|
||||
- `db-error.php` → Database error page
|
||||
- `env-error.php` → Environment error page
|
||||
|
||||
---
|
||||
|
||||
## 🧩 Templates
|
||||
|
||||
Reusable layout components:
|
||||
|
||||
- `templates/header.php`
|
||||
- `templates/footer.php`
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Status
|
||||
|
||||
🚧 This project is currently in development.
|
||||
New features and improvements will be added progressively.
|
||||
|
||||
---
|
||||
|
||||
## 📌 Roadmap (Planned)
|
||||
|
||||
- [ ] Routing system
|
||||
- [ ] Theme engine
|
||||
- [ ] Admin panel structure
|
||||
- [ ] CLI tools
|
||||
- [ ] Environment (.env) support
|
||||
- [ ] Basic authentication system
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
Contributions, ideas, and feedback are welcome.
|
||||
Feel free to open issues or pull requests.
|
||||
|
||||
---
|
||||
|
||||
## 📜 License
|
||||
|
||||
This project is licensed under the MIT License.
|
||||
See the `LICENSE` file for details.
|
||||
|
||||
---
|
||||
|
||||
## 👤 Author
|
||||
|
||||
Created by Simone (SLD)
|
||||
|
||||
---
|
||||
|
||||
## 💡 Philosophy
|
||||
|
||||
This project aims to stay:
|
||||
|
||||
- Simple
|
||||
- Transparent
|
||||
- Framework-free
|
||||
- Easy to extend
|
||||
|
||||
No magic, just clean PHP.
|
||||
Reference in New Issue
Block a user