107 lines
3.2 KiB
Markdown
107 lines
3.2 KiB
Markdown
# 🌱 Bank Sampah Digital
|
|
|
|
**Aplikasi ASP.NET Core MVC untuk mengelola bank sampah dengan teknologi modern**
|
|
|
|
## 📋 Deskripsi
|
|
|
|
Bank Sampah Digital adalah aplikasi web yang memungkinkan pengguna untuk mengelola sampah dengan sistem reward yang menarik. Aplikasi ini dibangun menggunakan ASP.NET Core MVC dengan design system DaisyUI dan Tailwind CSS untuk menciptakan pengalaman pengguna yang modern dan responsif.
|
|
|
|
## 📁 Struktur Proyek
|
|
|
|
```
|
|
bank-sampah/
|
|
├── Controllers/ # MVC Controllers
|
|
│ └── HomeController.cs # Controller utama dengan .NET 9 best practices
|
|
├── Services/ # Business Logic Services
|
|
│ ├── IHomeService.cs # Interface untuk home service
|
|
│ ├── HomeService.cs # Implementation home service
|
|
│ ├── IStatisticsService.cs # Interface untuk statistics service
|
|
│ └── StatisticsService.cs # Implementation statistics service
|
|
├── Filters/ # Global Filters
|
|
│ └── GlobalExceptionFilter.cs # Global exception handling
|
|
├── Models/ # Data Models
|
|
│ ├── HomeViewModel.cs # ViewModel untuk halaman utama
|
|
│ ├── FeatureModel.cs # Model untuk fitur aplikasi
|
|
│ ├── StatisticsModel.cs# Model untuk statistik
|
|
│ └── ErrorViewModel.cs # Model untuk halaman error
|
|
├── Views/ # Razor Views
|
|
│ ├── Home/
|
|
│ │ ├── Index.cshtml # Landing page utama
|
|
│ │ └── Privacy.cshtml# Halaman kebijakan privasi
|
|
│ └── Shared/
|
|
│ ├── _Layout.cshtml # Layout template utama
|
|
│ └── Error.cshtml # Halaman error
|
|
├── wwwroot/ # Static Files
|
|
│ ├── css/
|
|
│ │ └── input.css # Tailwind CSS input file
|
|
│ └── js/
|
|
│ └── site.js # JavaScript utilities
|
|
├── Program.cs # .NET 9 minimal hosting konfigurasi
|
|
├── appsettings.json # Configuration utama
|
|
├── appsettings.Development.json # Development configuration
|
|
├── BankSampahApp.csproj # .NET 9 project file
|
|
├── package.json # Dependencies untuk Node.js
|
|
└── tailwind.config.js # Konfigurasi Tailwind & DaisyUI
|
|
```
|
|
|
|
## 🚀 Instalasi & Setup
|
|
|
|
### Prerequisites
|
|
- .NET 9.0 SDK atau lebih baru
|
|
- Node.js 18+ dan pnpm (untuk Tailwind CSS)
|
|
- Visual Studio 2022 17.8+ atau VS Code dengan C# extension
|
|
|
|
### Langkah Instalasi
|
|
|
|
1. **Clone repository**
|
|
```bash
|
|
git clone [repository-url]
|
|
cd bank-sampah
|
|
```
|
|
|
|
2. **Install dependencies Node.js**
|
|
```bash
|
|
pnpm install
|
|
```
|
|
|
|
3. **Build CSS dengan Tailwind**
|
|
```bash
|
|
pnpm run build-css
|
|
```
|
|
|
|
4. **Restore .NET packages**
|
|
```bash
|
|
dotnet restore
|
|
```
|
|
|
|
5. **Jalankan aplikasi**
|
|
```bash
|
|
dotnet run
|
|
```
|
|
|
|
6. **Akses aplikasi**
|
|
- Buka browser dan kunjungi: `https://localhost:5001` atau `http://localhost:5000`
|
|
|
|
## 💻 Development
|
|
|
|
### Menjalankan dalam Mode Development
|
|
|
|
```bash
|
|
# Terminal 1: Watch CSS changes
|
|
pnpm run build-css
|
|
|
|
# Terminal 2: Run aplikasi dengan hot reload
|
|
dotnet watch run
|
|
```
|
|
|
|
## 🚀 Production Deployment
|
|
|
|
### Build untuk Production
|
|
|
|
```bash
|
|
# Build optimized CSS
|
|
pnpm run build
|
|
|
|
# Publish aplikasi .NET
|
|
dotnet publish -c Release -o ./publish
|
|
``` |