🚨 WARNING: Repository ini sudah TIDAK AKTIF dan tidak dilanjutkan lagi!
Project Grafikarsa telah dipindahkan ke arsitektur monorepo.
📦 Repository Baru: https://github.com/grafikarsa/grafikarsa
Repository polyrepo ini (backend & web terpisah) sudah deprecated dan tidak akan menerima update lagi. Semua development sekarang dilakukan di monorepo baru yang menggabungkan backend, web, dan dokumentasi dalam satu repository.
Jangan gunakan repository ini untuk development baru!
REST API Backend untuk Platform Katalog Portofolio & Social Network Warga SMKN 4 Malang.
- Language: Go 1.21+
- Framework: GoFiber v2
- Database: PostgreSQL 15+
- Object Storage: MinIO
- Authentication: JWT (Access + Refresh Token)
- User authentication dengan dual-token JWT
- Portfolio management dengan modular content blocks
- Social features (follow/unfollow, like)
- Admin panel untuk moderasi
- File upload via MinIO presigned URLs
- Full-text search
- Go 1.21+
- Docker & Docker Compose
- PostgreSQL 15+ (atau via Docker)
- MinIO (atau via Docker)
- Clone repository:
git clone https://github.com/grafikarsa/backend.git
cd backend- Copy environment file:
cp .env.example .env- Start dependencies via Docker:
docker-compose up -d postgres minio createbuckets- Setup database:
go run ./cmd/dbcli
# Pilih 1: Buat Database + Migrasi Schema
# Pilih 5: Seed Data (opsional)- Run API server:
go run ./cmd/apiServer akan berjalan di http://localhost:8080
docker-compose up -dbackend/
├── cmd/
│ ├── api/ # Main API server
│ └── dbcli/ # Database CLI tool
├── internal/
│ ├── auth/ # JWT service
│ ├── config/ # Configuration
│ ├── database/ # Database connection
│ ├── domain/ # Domain models
│ ├── dto/ # Data transfer objects
│ ├── handler/ # HTTP handlers
│ ├── middleware/ # Middleware (auth, etc)
│ ├── repository/ # Data access layer
│ └── storage/ # MinIO client
├── docs/ # Documentation
├── scripts/ # Test & utility scripts
├── Dockerfile
├── docker-compose.yml
└── go.mod
Lihat docs/api.md untuk dokumentasi lengkap API.
# Windows PowerShell
.\scripts\api_test.ps1# Lihat raw JSON request/response
.\scripts\api_inspect.ps1Tool untuk mengelola database:
go run ./cmd/dbcliMenu:
- Buat Database + Migrasi Schema
- Migrasi Schema (tanpa buat database)
- Migrate Fresh (drop semua + migrasi ulang)
- Truncate Tables (kecuali reference data)
- Seed Data (generate dummy data)
- Hapus Database
| Variable | Description | Default |
|---|---|---|
| APP_ENV | Environment (development/production) | development |
| APP_PORT | Server port | 8080 |
| DB_HOST | PostgreSQL host | localhost |
| DB_PORT | PostgreSQL port | 5432 |
| DB_USER | PostgreSQL user | postgres |
| DB_PASSWORD | PostgreSQL password | - |
| DB_NAME | Database name | grafikarsa |
| MINIO_ENDPOINT | MinIO endpoint | localhost:9000 |
| MINIO_ACCESS_KEY | MinIO access key | - |
| MINIO_SECRET_KEY | MinIO secret key | - |
| MINIO_BUCKET | MinIO bucket name | grafikarsa |
| JWT_ACCESS_SECRET | JWT access token secret | - |
| JWT_REFRESH_SECRET | JWT refresh token secret | - |
| JWT_ACCESS_EXPIRY | Access token expiry | 15m |
| JWT_REFRESH_EXPIRY | Refresh token expiry | 168h |
docker build -t grafikarsa-backend .
docker run -p 8080:8080 --env-file .env grafikarsa-backendgo build -o grafikarsa-api ./cmd/api
./grafikarsa-apiProject ini bersifat proprietary. Untuk kontribusi, hubungi maintainer.
All Rights Reserved. Lihat LICENSE untuk detail.
Maintainer: rafapradana.com@gmail.com