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.
This commit is contained in:
bwnyasse
2025-11-15 17:38:58 -05:00
parent 9db589d43f
commit 383fc14bf8
3 changed files with 70 additions and 292 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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 <<EOF > ./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 <<EOF > 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 (
<Router>
<Layout>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/users" element={<UserManagement />} />
</Routes>
</Layout>
</Router>
);
}
export default App;
EOF
echo "==> Création du fichier de Layout (Layout.jsx)..."
cat <<EOF > 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 (
<div className="min-h-screen flex">
<aside className="w-64 bg-slate-800 text-white flex flex-col">
<div className="p-4 border-b border-slate-700">
<h1 className="text-xl font-bold text-center">KROW ADMIN</h1>
</div>
<nav className="flex-1 p-4 space-y-2">
{navigation.map((item) => (
<Link
key={item.name}
to={item.href}
className={`flex items-center gap-3 px-3 py-2 rounded-md text-sm font-medium transition-colors ${
location.pathname === item.href
? 'bg-slate-900 text-white'
: 'text-slate-300 hover:bg-slate-700 hover:text-white'
}`}
>
<item.icon className="w-5 h-5" />
{item.name}
</Link>
))}
</nav>
</aside>
<main className="flex-1 bg-slate-100 p-8 overflow-auto">
{children}
</main>
</div>
);
}
EOF
echo "==> Création de la page Dashboard (Dashboard.jsx)..."
cat <<EOF > admin-web/src/pages/Dashboard.jsx
import React from 'react';
export default function Dashboard() {
return (
<div>
<h1 className="text-3xl font-bold text-slate-800">Admin Dashboard</h1>
<p className="text-slate-600 mt-2">Welcome to the Krow Admin Console.</p>
</div>
);
}
EOF
echo "==> Création de la page de gestion des utilisateurs (UserManagement.jsx)..."
cat <<EOF > 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 (
<div>
<div className="flex items-center justify-between mb-6">
<h1 className="text-3xl font-bold text-slate-800">User Management</h1>
{/*
<Button>
<UserPlus className="w-4 h-4 mr-2" />
Invite User
</Button>
*/}
</div>
<div className="bg-white p-6 rounded-lg shadow-md">
<p>La table des utilisateurs apparaîtra ici.</p>
<p className="text-sm text-slate-500 mt-4">
Pour continuer, ajoutez les composants shadcn/ui nécessaires (table, button, etc.)
</p>
</div>
</div>
);
}
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 <<EOF > 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(
<React.StrictMode>
<App />
</React.StrictMode>,
)
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 <<EOF >> 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 ""