From 383fc14bf8d2a66f14cdee9f388ea38a2c0800bb Mon Sep 17 00:00:00 2001 From: bwnyasse <5323628+bwnyasse@users.noreply.github.com> Date: Sat, 15 Nov 2025 17:38:58 -0500 Subject: [PATCH] feat(Makefile): add admin console commands to Makefile feat(README.md): update README to reflect monorepo structure and admin console feat: remove setup_admin_console.sh script The setup_admin_console.sh script is removed because the admin console setup is now integrated into the Makefile. The README is updated to reflect the new monorepo structure and the admin console. The Makefile is updated to include commands for installing, developing, and building the admin console. --- Makefile | 13 ++ README.md | 87 +++++++++----- setup_admin_console.sh | 262 ----------------------------------------- 3 files changed, 70 insertions(+), 292 deletions(-) delete mode 100644 setup_admin_console.sh diff --git a/Makefile b/Makefile index 2352a912..10e74629 100644 --- a/Makefile +++ b/Makefile @@ -122,3 +122,16 @@ install-git-hooks: @ln -sf ../../scripts/git-hooks/pre-push .git/hooks/pre-push @echo "✅ pre-push hook installed successfully. Direct pushes to 'main' and 'dev' are now blocked." + +# --- Admin Console --- +admin-install: + @echo "--> Installing admin console dependencies..." + @cd admin-web && npm install + +admin-dev: + @echo "--> Starting admin console development server on http://localhost:5174 ..." + @cd admin-web && npm run dev -- --port 5174 + +admin-build: + @echo "--> Building admin console for production..." + @cd admin-web && VITE_APP_ENV=$(ENV) npm run build diff --git a/README.md b/README.md index 00206d4c..d2a3b958 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,38 @@ -# KROW Workforce Platform +# Krow Workforce Management Platform -This monorepo contains the complete source code for the KROW Workforce platform, including the web frontend, mobile applications, and backend services. +Krow is a comprehensive monorepo platform designed to streamline workforce management for events, hospitality, and large-scale enterprise operations. It connects clients, operators, vendors, and staff in a unified ecosystem, leveraging modern technology to optimize every step from procurement to payroll. ## 🚀 What's in this Monorepo? -- **/firebase/**: Contains the Firebase Data Connect configuration (GraphQL schema, queries, mutations) and Firebase Hosting configuration. -- **/frontend-web/**: The React/Vite web application used by administrators and managers. -- **/mobile-apps/**: Contains the two Flutter-based mobile applications: - - `client-app`: For clients managing events. - - `staff-app`: For staff members managing their shifts and profile. -- **/docs/**: All project documentation (vision, roadmaps, architecture, guides). -- **/scripts/**: Automation scripts used by the `Makefile`. -- **/secrets/**: Contains sensitive credentials (ignored by Git). +- **/firebase/**: This directory is the backbone of our backend infrastructure. It contains: + - **Firestore Rules (`firestore.rules`):** Defines the security and access control logic for our NoSQL database, ensuring that users can only read and write data they are authorized to access. + - **Cloud Storage Rules (`storage.rules`):** Secures file uploads and downloads (like compliance documents and user avatars). + - **Data Connect (`dataconnect/`):** Houses the configuration for Firebase Data Connect, including the GraphQL schema, connectors, queries, and mutations that define our API layer. -## ▶️ Getting Started +- **/admin-web/**: The central "mission control" for platform administrators. This React/Vite web application provides a secure interface for: + - **User Management:** Inviting new users (the very first client or operator) and managing roles/permissions across the entire ecosystem. + - **Platform Analytics:** Monitoring application usage, top pages, and user activity. + - **System Logs:** A log explorer for diagnosing issues and monitoring the platform's health. -This project uses a central `Makefile` to orchestrate all common tasks. +- **/frontend-web/**: The primary web application for core business operations, used by procurement managers, operators, and clients. This React/Vite application includes modules for: + - **Vendor Management:** Onboarding, compliance tracking, and performance scorecards. + - **Event & Order Management:** Creating and managing staffing orders. + - **Invoicing & Payroll:** Financial workflows for clients and staff. + - **Dashboards:** Role-specific dashboards for different user types. -1. **Install Dependencies:** - ```bash - make install - ``` - *(This will install dependencies for the web frontend. Mobile dependency installation is handled within their respective directories.)* +- **/mobile-apps/**: This directory is planned for our future mobile applications. It is structured to contain two distinct apps: + - `client-app`: A dedicated application for clients to create orders, track events, and manage billing on the go. + - `staff-app`: An essential tool for workforce members to view schedules, clock in/out, manage their profiles, and track earnings. -2. **Run a Service:** - - To run the web frontend: `make dev` - - *(Additional commands for mobile and backend will be added as development progresses.)* +- **/docs/**: The single source of truth for all project documentation. This includes: + - **Vision & Roadmaps:** High-level strategy, product goals, and technical direction. + - **Architecture:** Detailed diagrams and explanations of the system architecture. + - **API Specifications:** Documentation for our GraphQL API. + - **Development Guides:** Conventions, setup instructions, and maintenance procedures. -3. **See All Commands:** - For a full list of available commands, run: - ```bash - make help - ``` +- **/scripts/**: A collection of automation scripts to streamline development and operational tasks. These scripts are primarily executed via the `Makefile` and handle tasks like database patching, environment setup, and code generation. -## 🤝 Contributing - -New to the KROW team? Start here to set up your environment and understand our development practices: **[CONTRIBUTING.md](./CONTRIBUTING.md)** - ---- +- **/secrets/**: A Git-ignored directory for storing sensitive credentials, API keys, and environment-specific configuration files. This ensures that no confidential information is ever committed to the repository. ## 📚 Documentation Overview @@ -52,3 +47,35 @@ This section provides a quick guide to the most important documentation files in - **[06-maintenance-guide.md](./docs/06-maintenance-guide.md)**: The operational manual for integrating updates from the Base44 visual builder. - **[07-reference-base44-api-export.md](./docs/07-reference-base44-api-export.md)**: The raw API documentation exported from Base44, used as a reference. - **[08-reference-base44-prompts.md](./docs/08-reference-base44-prompts.md)**: A collection of standardized prompts for interacting with the Base44 AI. + +## 🤝 Contributing + +New to the KROW team? Start here to set up your environment and understand our development practices: **[CONTRIBUTING.md](./CONTRIBUTING.md)** + +## 🛠️ Tech Stack + +- **Frontend:** React with Vite (JavaScript) +- **Styling:** Tailwind CSS +- **Backend:** Firebase (Firestore, Cloud Storage, Authentication, Data Connect) +- **Mobile:** Flutter (planned) + +## 📦 Getting Started + +1. **Clone the repository:** + ```bash + git clone https://github.com/Oloodi/krow.git + cd krow + ``` + +2. **Install dependencies for the main web app:** + ```bash + cd frontend-web + npm install + ``` + +3. **Run the development server:** + ```bash + npm run dev + ``` + +The main application will be available at `http://localhost:5173`. For other packages, refer to their respective `README.md` files. \ No newline at end of file diff --git a/setup_admin_console.sh b/setup_admin_console.sh deleted file mode 100644 index f6142c8a..00000000 --- a/setup_admin_console.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/bin/bash - -# Script pour initialiser l'application Admin Console en 4 étapes. -# Exécutez ce script depuis la racine du projet. -# Assurez-vous d'avoir les permissions d'exécution : chmod +x setup_admin_console.sh - -# --- CONFIGURATION --- -# Arrête le script si une commande échoue -set -e - -# --- SCRIPT --- - -echo "🚀 Démarrage de la configuration de l'Admin Console..." - -# --- ÉTAPE 1: SCAFFOLDING DE L'APPLICATION --- -echo "" -echo "--- Étape 1: Scaffolding de l'application admin-web ---" - -if [ -d "admin-web" ]; then - echo "⚠️ Le répertoire admin-web/ existe déjà. Le script va s'arrêter pour éviter d'écraser des données." - exit 1 -fi - -echo "==> Création d'un nouveau projet React + Vite dans admin-web/..." -npm create vite@latest admin-web -- --template react - -echo "==> Installation des dépendances initiales..." -cd admin-web -npm install -cd .. -echo "✅ Étape 1 terminée." - -# --- ÉTAPE 2: CONFIGURATION DU STYLE ET DES DÉPENDANCES --- -echo "" -echo "--- Étape 2: Configuration du style et des dépendances ---" - -echo "==> Installation des dépendances pour Tailwind CSS..." -cd admin-web -npm install -D tailwindcss postcss autoprefixer -npx tailwindcss init -p - -echo "==> Copie des fichiers de configuration depuis frontend-web/..." -# Le -f force l'écrasement des fichiers générés par `tailwindcss init` -cp -f ../frontend-web/tailwind.config.js ./tailwind.config.js -cp -f ../frontend-web/postcss.config.js ./postcss.config.js -cp ../frontend-web/components.json ./components.json -cp ../frontend-web/jsconfig.json ./jsconfig.json - -echo "==> Configuration de Vite pour les alias de chemin..." -# Crée un nouveau vite.config.js avec la configuration d'alias -cat < ./vite.config.js -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' -import path from 'path' - -// https://vite.dev/config/ -export default defineConfig({ - plugins: [react()], - resolve: { - alias: { - '@': path.resolve(__dirname, './src'), - }, - }, -}) -EOF - -echo "==> Copie du fichier CSS de base..." -cp ../frontend-web/src/index.css ./src/index.css - -echo "==> Installation des dépendances pour shadcn/ui..." -npm install class-variance-authority clsx tailwind-merge tailwindcss-animate lucide-react - -cd .. -echo "✅ Étape 2 terminée." - -# --- ÉTAPE 3: CRÉATION DE LA COQUILLE VISUELLE --- -echo "" -echo "--- Étape 3: Création de la coquille visuelle de l'application ---" - -echo "==> Création des répertoires de base (pages, components)..." -mkdir -p admin-web/src/pages -mkdir -p admin-web/src/components/ui -mkdir -p admin-web/src/lib - -echo "==> Copie de l'utilitaire shadcn/ui..." -cp frontend-web/src/lib/utils.js admin-web/src/lib/utils.js - -echo "==> Création du fichier App.jsx avec le routing..." -cat < admin-web/src/App.jsx -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; -import Layout from '@/pages/Layout'; -import Dashboard from '@/pages/Dashboard'; -import UserManagement from '@/pages/UserManagement'; - -function App() { - return ( - - - - } /> - } /> - - - - ); -} - -export default App; -EOF - -echo "==> Création du fichier de Layout (Layout.jsx)..." -cat < admin-web/src/pages/Layout.jsx -import React from 'react'; -import { Link, useLocation } from 'react-router-dom'; -import { LayoutDashboard, Users, Settings } from 'lucide-react'; - -const navigation = [ - { name: 'Dashboard', href: '/', icon: LayoutDashboard }, - { name: 'User Management', href: '/users', icon: Users }, -]; - -export default function Layout({ children }) { - const location = useLocation(); - - return ( -
- -
- {children} -
-
- ); -} -EOF - -echo "==> Création de la page Dashboard (Dashboard.jsx)..." -cat < admin-web/src/pages/Dashboard.jsx -import React from 'react'; - -export default function Dashboard() { - return ( -
-

Admin Dashboard

-

Welcome to the Krow Admin Console.

-
- ); -} -EOF - -echo "==> Création de la page de gestion des utilisateurs (UserManagement.jsx)..." -cat < admin-web/src/pages/UserManagement.jsx -import React from 'react'; -// Note: Les composants Button, Card, etc. devront être ajoutés via shadcn-ui - -export default function UserManagement() { - return ( -
-
-

User Management

- {/* - - */} -
-
-

La table des utilisateurs apparaîtra ici.

-

- Pour continuer, ajoutez les composants shadcn/ui nécessaires (table, button, etc.) -

-
-
- ); -} -EOF - -echo "==> Mise à jour de main.jsx pour inclure le Router..." -# Le App.jsx contient maintenant le Router, donc on met à jour main.jsx -cd admin-web -npm install react-router-dom -cat < src/main.jsx -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App.jsx' -import './index.css' - -ReactDOM.createRoot(document.getElementById('root')).render( - - - , -) -EOF -cd .. - -echo "✅ Étape 3 terminée." - -# --- ÉTAPE 4: MISE À JOUR DU MAKEFILE --- -echo "" -echo "--- Étape 4: Mise à jour du Makefile racine ---" - -echo "==> Ajout des nouvelles cibles au Makefile..." -cat <> Makefile - -# --- Admin Console --- -admin-install: - @echo "--> Installing admin console dependencies..." - @cd admin-web && npm install - -admin-dev: - @echo "--> Starting admin console development server on http://localhost:5174 ..." - @cd admin-web && npm run dev -- --port 5174 - -admin-build: - @echo "--> Building admin console for production..." - @cd admin-web && VITE_APP_ENV=\$(ENV) npm run build -EOF - -echo "✅ Étape 4 terminée." - -# --- INSTRUCTIONS FINALES --- -echo "" -echo "🎉 --- Configuration terminée avec succès! --- 🎉" -echo "" -echo "Voici les prochaines étapes manuelles :" -echo "" -echo "1. Ajoutez les composants UI de base à votre nouvelle application :" -echo " cd admin-web" -echo " npx shadcn-ui@latest add button card table input label dialog select" -echo " cd .." -echo "" -echo "2. Mettez à jour la cible 'help' dans le Makefile pour inclure les nouvelles commandes :" -echo " - make admin-install" -echo " - make admin-dev" -echo " - make admin-build" -echo "" -echo "3. Lancez le serveur de développement de l'admin console avec :" -echo " make admin-dev" -echo "" -echo "L'application sera disponible sur http://localhost:5174" -echo "" -