commit 1a65e69d25023ec35b7d50b080fa08d24aa879be Author: LouisWhit Date: Sat May 10 17:12:58 2025 -0500 Initial Commit with ENVs, directory structures, cursor rules, etc diff --git a/.cursor/rules/naming-conventions.mdc b/.cursor/rules/naming-conventions.mdc new file mode 100644 index 0000000..8ba9b47 --- /dev/null +++ b/.cursor/rules/naming-conventions.mdc @@ -0,0 +1,22 @@ +--- +description: +globs: *.php,*.js,*.css +alwaysApply: false +--- +.php files should use the following naming conventions: +"classes": "PascalCase", +"functions": "camelCase", +"variables": "camelCase", +"constants": "UPPER_SNAKE_CASE" + +.js files should use the following naming conventions: +"functions": "camelCase", +"variables": "camelCase", +"constants": "UPPER_SNAKE_CASE" + + +.css files should us the following naming conventions: + +"ids": "camelCase", + +"classes": "kebab-case" \ No newline at end of file diff --git a/.cursor/rules/project-guidelines.mdc b/.cursor/rules/project-guidelines.mdc new file mode 100644 index 0000000..d56b321 --- /dev/null +++ b/.cursor/rules/project-guidelines.mdc @@ -0,0 +1,8 @@ +--- +description: +globs: +alwaysApply: true +--- +This is a zero build project. We are not allowing packages to be installed or suggested for this project. No dependendcies on the backend/server side. On the front-end we will only allow CDN js and css files or libraries. + +The following are allowed on the front-end: bootstrap|fontawesome|jquery \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a08eb43 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# Data directory +/data/ +/data/*.json + +# Exports directory +/exports/ +/exports/*.json +/exports/export_log.txt + +# Environment files +.env +.env.* +!.env.example + +# IDE files +.idea/ +.vscode/ +*.sublime-* + +# OS files +.DS_Store +Thumbs.db \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..d435896 --- /dev/null +++ b/.htaccess @@ -0,0 +1,15 @@ +# Protect data directory + + RewriteEngine On + RewriteRule ^data/.* - [F,L] + RewriteRule ^exports/.* - [F,L] + + +# Disable directory browsing +Options -Indexes + +# Deny access to hidden files and directories + + Order allow,deny + Deny from all + \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 0000000..588c095 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,59 @@ +/* Main Styles */ +:root { + --primary-color: #4a90e2; + --secondary-color: #f5f5f5; + --text-color: #333; + --border-color: #ddd; +} + +body { + font-family: Arial, sans-serif; + line-height: 1.6; + margin: 0; + padding: 0; + color: var(--text-color); +} + +.container { + max-width: 1200px; + margin: 0 auto; + padding: 20px; +} + +/* Tab Styles */ +.tabs { + display: flex; + border-bottom: 1px solid var(--border-color); + margin-bottom: 20px; +} + +.tab { + padding: 10px 20px; + cursor: pointer; + border: 1px solid transparent; + border-bottom: none; + margin-right: 5px; +} + +.tab.active { + background: white; + border-color: var(--border-color); + border-bottom: 1px solid white; + margin-bottom: -1px; +} + +/* Mobile Responsive */ +@media (max-width: 768px) { + .container { + padding: 10px; + } + + .tabs { + flex-direction: column; + } + + .tab { + margin-right: 0; + margin-bottom: 5px; + } +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..f97ac9d --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,25 @@ +document.addEventListener('DOMContentLoaded', function() { + // Tab functionality + const tabs = document.querySelectorAll('.tab'); + const tabContents = document.querySelectorAll('.tab-content'); + + tabs.forEach(tab => { + tab.addEventListener('click', () => { + // Remove active class from all tabs + tabs.forEach(t => t.classList.remove('active')); + tabContents.forEach(content => content.style.display = 'none'); + + // Add active class to clicked tab + tab.classList.add('active'); + + // Show corresponding content + const targetId = tab.getAttribute('data-target'); + document.getElementById(targetId).style.display = 'block'; + }); + }); + + // Initialize first tab as active + if (tabs.length > 0) { + tabs[0].click(); + } +}); \ No newline at end of file diff --git a/config/config.php b/config/config.php new file mode 100644 index 0000000..6d3cd42 --- /dev/null +++ b/config/config.php @@ -0,0 +1,41 @@ + ['title' => 'Chores', 'icon' => 'tasks'], + 'groceries' => ['title' => 'Grocery List', 'icon' => 'shopping-cart'], + 'meals' => ['title' => 'Meal Plan', 'icon' => 'utensils'] +]; + +// Load local configuration if exists +if (file_exists(__DIR__ . '/local.php')) { + include __DIR__ . '/local.php'; +} +?> \ No newline at end of file diff --git a/config/env.php b/config/env.php new file mode 100644 index 0000000..d937892 --- /dev/null +++ b/config/env.php @@ -0,0 +1,41 @@ + true, 'message' => 'Export successful']); + } else { + echo json_encode(['success' => false, 'message' => 'Export failed']); + } + } else { + echo json_encode(['success' => false, 'message' => 'Invalid export type']); + } +} else { + echo json_encode(['success' => false, 'message' => 'No export type specified']); +} \ No newline at end of file diff --git a/gitignore b/gitignore new file mode 100644 index 0000000..d1e5592 --- /dev/null +++ b/gitignore @@ -0,0 +1,29 @@ +# Data files (contain user data) +/data/*.json + +# Export directory +/exports/ + +# Environment-specific configurations +/config/local.php + +# System files +.DS_Store +Thumbs.db + +# Editor files +.vscode/ +*.swp +*.swo + +# Temporary files +*.tmp +*.tmp.* +*.tmp/* +*.tmp/*.* + +# Cache files +*.cache +*.cache.* +*.cache/* +*.cache/*.* \ No newline at end of file diff --git a/includes/db.php b/includes/db.php new file mode 100644 index 0000000..823a257 --- /dev/null +++ b/includes/db.php @@ -0,0 +1,23 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..df098cc --- /dev/null +++ b/includes/header.php @@ -0,0 +1,23 @@ + + + + + + Family Hub + + + + + + + + + + + +
+
+

Family Hub

+
+
+
\ No newline at end of file diff --git a/includes/utils.php b/includes/utils.php new file mode 100644 index 0000000..512fee0 --- /dev/null +++ b/includes/utils.php @@ -0,0 +1,23 @@ + + +
+
+ $tab): ?> + + + + +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..f9e55da --- /dev/null +++ b/readme.md @@ -0,0 +1,47 @@ +# Family Hub + +A centralized family organization system with tabs for chores, grocery lists, and meal planning. + +## Features +- Tabbed interface for different family needs +- JSON-based data storage +- Daily automated exports +- Mobile-friendly interface + +## Setup +1. Clone this repository to your web server +2. Ensure proper permissions on data directory +3. Set up the daily cron job for exports +4. Access the hub at http://your-local-ip/familyHub/ + +## Directory Structure +familyHub/ +├── assets/ # Static assets +│ ├── css/ # CSS files +│ │ └── style.css +│ ├── js/ # JavaScript files +│ │ └── main.js +│ └── img/ # Images +├── config/ # Configuration files +│ └── config.php +├── data/ # JSON data storage (not tracked in git) +│ ├── chores.json +│ ├── groceries.json +│ └── meals.json +├── includes/ # PHP includes/components +│ ├── header.php +│ ├── footer.php +│ ├── db.php # JSON file handling functions +│ └── utils.php # Utility functions +├── exports/ # Temporary location for exports (not tracked in git) +├── scripts/ # Scripts for cron jobs +│ └── daily_export.php +├── tabs/ # Tab-specific functionality +│ ├── chores.php +│ ├── groceries.php +│ └── meals.php +├── .gitignore +├── .cursor.json # Cursor editor configuration +├── README.md +├── index.php # Main entry point +└── export.php # Export functionality \ No newline at end of file diff --git a/scripts/daily_export.php b/scripts/daily_export.php new file mode 100644 index 0000000..cdceef2 --- /dev/null +++ b/scripts/daily_export.php @@ -0,0 +1,26 @@ + + +
+

Chores

+
+ +

No chores added yet.

+ +
    + +
  • + + + +
  • + +
+ +
+
\ No newline at end of file diff --git a/tabs/groceries.php b/tabs/groceries.php new file mode 100644 index 0000000..266637f --- /dev/null +++ b/tabs/groceries.php @@ -0,0 +1,25 @@ + + +
+

Grocery List

+
+ +

No items in the grocery list yet.

+ +
    + +
  • + + + +
  • + +
+ +
+
\ No newline at end of file diff --git a/tabs/meals.php b/tabs/meals.php new file mode 100644 index 0000000..4c5ba48 --- /dev/null +++ b/tabs/meals.php @@ -0,0 +1,25 @@ + + +
+

Meal Planning

+
+ +

No meals planned yet.

+ +
    + +
  • + + + +
  • + +
+ +
+
\ No newline at end of file