3.7 KiB
3.7 KiB
Backend Setup Complete! 🎉
✅ What's Working
Services Running
- PostgreSQL Database: localhost:5432
- Directus API/Admin: http://localhost:8055
- Redis Cache: localhost:6379
- Frontend: http://localhost:5173 (your dev server)
Database & Collections
- ✅ Database schema imported from
schema/init.sql - ✅ All tables created successfully
- ✅ Directus collections configured
- ✅ Sample data loaded:
- 1 Organization (Demo Organization)
- 4 Asset Categories (IT Equipment, Office Furniture, etc.)
- 4 Locations (Main Office, IT Department, etc.)
- 3 Vendors (Dell Technologies, Office Solutions, etc.)
Authentication
- Admin Email:
admin@assetmanagement.com - Admin Password:
AssetAdmin2024!
🧪 Testing the Connection
Option 1: Frontend Testing
- Open your frontend at http://localhost:5173
- Try logging in with the admin credentials above
- Navigate to "Add Asset" and create a test asset
- Check if the asset appears in the Assets list
Option 2: Directus Admin Testing
- Visit http://localhost:8055/admin
- Login with admin credentials
- Browse the collections (Organizations, Assets, etc.)
- Create test data directly in Directus
- Check if it appears in your frontend
Option 3: API Testing
# Run our test script
./scripts/test-frontend-connection.sh
🔧 Available Commands
# Start all services
make up
# Check service status
make status
# View logs
make logs
# Stop services
make down
# Reset database (if needed)
make db-reset
# Setup collections (already done)
./scripts/setup-directus-collections.sh
📊 Database Schema Highlights
Main Tables
- organizations: SaaS tenant management
- assets: Core asset registry
- asset_categories: Asset classification
- locations: Physical asset locations
- vendors: Supplier management
- work_orders: Maintenance requests
- asset_reminders: Maintenance scheduling
Key Features
- Multi-tenant (organization-based)
- Full asset lifecycle tracking
- QR code generation
- Work order management
- Financial tracking (depreciation, costs)
- Component-level tracking
🐛 Troubleshooting
Frontend Can't Connect
- Check if Directus is running:
curl http://localhost:8055/server/health - Verify .env file has correct API URL
- Check browser network tab for CORS errors
Authentication Issues
- Verify admin credentials in docker-compose.yml
- Check Directus logs:
docker-compose logs directus - Reset admin user if needed
Missing Collections
- Run:
./scripts/setup-directus-collections.sh - Check Directus admin panel for collections
- Verify database tables exist
No Sample Data
- Run:
make db-reset(will recreate everything) - Check init.sql execution in container logs
🚀 Next Steps
- Test Asset Creation: Use the frontend Add Asset form
- Configure Permissions: Set up user roles in Directus admin
- Customize Fields: Add custom fields via Directus admin
- Setup Relations: Configure foreign key relationships
- Deploy: Configure for production environment
📁 Project Structure
enterprise-asset-management/
├── frontend/ # Vue.js application
│ ├── src/
│ │ ├── repositories/ # API communication
│ │ ├── stores/ # State management
│ │ └── views/ # Pages (Dashboard, AddAsset, etc.)
│ └── .env # Frontend configuration
├── schema/
│ └── init.sql # Database schema & sample data
├── scripts/ # Setup and utility scripts
└── docker-compose.yml # Service orchestration
Your enterprise asset management system is now fully operational! 🎯