No description
- Vue 89.7%
- TypeScript 10.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
INFRA-3303 - fix bug and add features Salin Semula See merge request shukry-datakraf/myinfra-frontend!428 |
||
| app-layouts | ||
| app-routes | ||
| assets | ||
| components | ||
| composables | ||
| config | ||
| constants | ||
| docs | ||
| e2e | ||
| examples | ||
| k8s | ||
| layouts | ||
| middleware | ||
| pages | ||
| plugins | ||
| public | ||
| scripts | ||
| server | ||
| services | ||
| stores | ||
| tests | ||
| themes | ||
| types | ||
| utils | ||
| .dockerignore | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .nuxtrc | ||
| .prettierrc | ||
| app.vue | ||
| docker-compose.dev.yml | ||
| docker-compose.prod.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.ci | ||
| Dockerfile.dev | ||
| eslint copy.config.mjs | ||
| eslint.config.mjs | ||
| nuxt.config.ts | ||
| package-lock.json | ||
| package.json | ||
| PENGURUSAN_PELANGGAN_COMPLETE_GUIDE.md | ||
| PENGURUSAN_PELANGGAN_FRONTEND_REFERENCE.md | ||
| Perlembagaan NuxtJS.pdf | ||
| README.md | ||
| tailwind.config.js | ||
| test-custom-items.js | ||
| theme-preset.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||
MyInfra Frontend
MyInfra system.
Prerequisites
- Node.js 20 or higher
- Docker and Docker Compose (for containerized development)
Getting Started
Local Development
- Clone the repository
git clone <repository-url>
cd myinfra-frontend
- Install dependencies
npm install
- Copy environment variables
cp .env.example .env
- Run development server
npm run dev
The application will be available at http://localhost:3000
Docker Development
- Copy environment variables
cp .env.example .env
- Start development with Docker Compose
docker-compose up
The application will be available at http://localhost:3000 with hot-reload enabled.
To rebuild the containers:
docker-compose up --build
Production Build
Local Build
npm run build
npm run preview
Docker Production
docker-compose -f docker-compose.prod.yml up -d
To rebuild for production:
docker-compose -f docker-compose.prod.yml up -d --build
Available Scripts
Development
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run generate- Generate static sitenpm run lint- Run ESLint
Testing
npm run test- Run tests in watch modenpm run test:ci- Run tests once (CI mode)npm run test:coverage- Run tests with coverage reportnpm run test:ui- Open Vitest UI
Test Coverage: 614 tests (98.2% passing) across services, composables, middleware, stores, and components
Docker Commands
Development
docker-compose up- Start development environmentdocker-compose down- Stop development environmentdocker-compose logs -f- View logsdocker-compose exec nuxt-dev sh- Access container shell
Production
docker-compose -f docker-compose.prod.yml up -d- Start productiondocker-compose -f docker-compose.prod.yml down- Stop productiondocker-compose -f docker-compose.prod.yml logs -f- View logsdocker-compose -f docker-compose.prod.yml ps- Check container status
Environment Variables
See .env.example for required environment variables:
NODE_ENV- Application environment (development/production)NUXT_HOST- Host to bind (default: 0.0.0.0)NUXT_PORT- Port to bind (default: 3000)NUXT_PUBLIC_API_BASE- API base URLNUXT_AUTH_SECRET- Authentication secretNUXT_PUBLIC_MAPBOX_TOKEN- Mapbox API token (if using maps)NUXT_PUBLIC_MAPS_API_KEY- Google Maps API key
Project Structure
myinfra-frontend/
├── components/ # Vue components
├── pages/ # Nuxt pages
├── public/ # Static assets
├── server/ # Server middleware
├── Dockerfile # Multi-stage Docker configuration
├── docker-compose.yml # Development Docker Compose
└── docker-compose.prod.yml # Production Docker Compose
Troubleshooting
Port Already in Use
If port 3000 is already in use, you can change it in:
.envfile: UpdateNUXT_PORTdocker-compose.yml: Update the ports mapping
Docker Build Issues
- Clear Docker cache:
docker system prune -a - Rebuild without cache:
docker-compose build --no-cache
Permission Issues in Docker
If you encounter permission issues, ensure the node user has proper permissions:
docker-compose exec nuxt-dev chown -R node:node /app
... ... ...