Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #13 from uasoft-indonesia/develop
Browse files Browse the repository at this point in the history
Merge develop to master
  • Loading branch information
rizkiheryandi authored May 14, 2021
2 parents 92cd417 + 67936fc commit dd24d0f
Show file tree
Hide file tree
Showing 23 changed files with 831 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

open_collective: badaso
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
5 changes: 5 additions & 0 deletions .github/autolabeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
frontend: ["*.js", "*.css", "*.html", "*.vue"]
backend: ["/app", "*.php"]
legal: ["LICENSE*", "NOTICES*"]
config: .github
dependencies: ["composer.json"]
4 changes: 4 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
feature: feature/*
enhancement: enhancement/*
bugfix: bugfix/*
hotfix: hotfix/*
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: 'Features'
label: 'feature'
- title: 'Enhancement'
label: 'engancement'
- title: 'Bug Fixes'
labels:
- 'bugfix'
- 'hotfix'
- title: 'Frontend'
label: 'frontend'
- title: 'Backend'
label: 'backend'
- title: 'Dependency Updates'
label: 'dependencies'
- title: 'Configs'
label: 'config'
- title: 'Legals'
label: 'legal'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
14 changes: 14 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR Labeler
on:
pull_request:
types: [opened]

jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
with:
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions docs/core-concept/analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: analytics
title: Analytics
sidebar_label: Analytics
---

Analytics is useful for getting site visitor information such as the number of visitors to a page, the average length of time visitors have accessed the site, etc. To use analytics on badaso, you must create [Google Analytics](https://analytics.google.com/analytics/web) account first. After that, get the View ID and Tracking ID from your analytics.

Insert the View ID and Tracking ID from your analytics to .env variable `ANALYTICS_VIEW_ID` and `MIX_ANALYTICS_TRACKING_ID`.

To retrieve the site visitor information, you must create a service account for your analytics and download the service-account.json file. After that, you can store it in storage directory like below.

```
📦 Your Project
┣ 📂 storage
┃ ┣ 📂 app
┃ ┃ ┣ 📂 analytics
┃ ┃ ┃ ┗ 📜 service-account-crendetial.js /** Store the .json file here. **/
```

:::important
You can adjust the service account credential store directory in `analytics.php` config file.
:::

:::important
Analytics will only detect visitor from accessing generated CRUD only.
:::

After that you can perform queries using classes provided by spatie/laravel-analytics. If you want to know more about the queries, visit [spatie/laravel-analytics](https://github.com/spatie/laravel-analytics).
119 changes: 119 additions & 0 deletions docs/core-concept/plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
id: plugins
title: Plugins
sidebar_label: Plugins
---

To create a badaso plugin, you must understand how to create a laravel packages first. You can learn about it [here](https://laravelpackage.com/).

## Naming

Badaso plugin uses slug for naming, for example: **badaso-blog-module**. The plugin itself must be in-line with badaso core directory in order detect the plugin by badaso core, for example:

```
📦 uasoft-indonesia
┣ 📂 badaso
┣ 📂 badaso-example-plugin /** Your plugins here **/
```

## Registering the Plugin

To detect the plugin, you must include it in .env file on **MIX_BADASO_PLUGINS** variable with delimiter of comma (,) without whitespace. For example:

```
MIX_BADASO_PLUGINS=badaso-blog-module,badaso-content-module
```

:::important
If the plugin using the menu in sidebar, you must include it in **MIX_BADASO_MENU** in order to display it with delimiter of comma (,) without whitespace. For example:

```
MIX_BADASO_MENU=badaso-blog-module,badaso-content-module
```
:::

## Resources Directory Structure

Below is the resources directory structure for plugins from badaso.

```
📦 uasoft-indonesia
┣ 📂 badaso
┣ 📂 badaso-example-plugin
┃ ┣ 📂 src
┃ ┃ ┣ 📂 resources
┃ ┃ ┃ ┣ 📂 js
┃ ┃ ┃ ┃ ┣ 📂 api
┃ ┃ ┃ ┃ ┃ ┣ 📂 modules /** Register your api helper here. **/
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📜 badaso-example.js /** Example of api helper. **/
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js * /** This file is required. **/
┃ ┃ ┃ ┃ ┣ 📂 components
┃ ┃ ┃ ┃ ┃ ┣ 📜 example-component.vue /** Example of components. **/
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js * /** Export the components here. This file is required. **/
┃ ┃ ┃ ┃ ┣ 📂 lang
┃ ┃ ┃ ┃ ┃ ┣ 📂 modules
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📜 en.js /** Example of internationalization **/
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js * /** Export the language here. This file is required. **/
┃ ┃ ┃ ┃ ┣ 📂 pages
┃ ┃ ┃ ┃ ┃ ┣ 📂 example
┃ ┃ ┃ ┃ ┃ ┗ 📜 index.js /** Export the pages here. This file is required. **/
┃ ┃ ┃ ┃ ┣ 📂 router
┃ ┃ ┃ ┃ ┃ ┗ 📜 routes.js * /** Export the router here. This file is required. **/
┃ ┃ ┃ ┃ ┣ 📂 store
┃ ┃ ┃ ┃ ┃ ┗ 📜 badaso.js * /** Export the store here. This file is required. **/
┃ ┃ ┃ ┃ ┣ 📂 utils
┃ ┃ ┃ ┃ ┃ ┗ 📜 example.js * /** Export the utils here. **/
```

:::warning
Router file naming must use routes.js and file store must use badaso.js.
:::

:::important
`*` is auto-detect by badaso core.

If you want to use assets and utils, you can create assets and utils folder, but the folder only affect in your plugin scope, not badaso core scope.
:::

### `src\resources\js\pages\index.vue`

Here is the content of index.vue in pages directory.

<!--DOCUSAURUS_CODE_TABS-->
<!--Vue-->
```vue
<template>
<component
v-if="globalComponentList[defaultComponent]"
v-bind:is="globalComponentList[defaultComponent]"
></component>
<component v-else v-bind:is="defaultComponent"></component>
</template>
<script>
import Example from "./example/index.vue";
export default {
components: {
// Register the pages here
Example
},
name: "ExamplePlugin",
data: () => ({
globalComponentList: {},
defaultComponent: null,
}),
mounted() {
const routeName = this.$route.name;
const componentName = this.$caseConvert.kebab(routeName);
const slug = this.$route.params ? this.$route.params.slug : "";
this.globalComponentList = this.constructor.superOptions.components;
this.defaultComponent = componentName;
},
methods: {},
};
</script>
```
<!--END_DOCUSAURUS_CODE_TABS-->
16 changes: 16 additions & 0 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"previous": "Previous",
"tagline": "The First Open-Source Laravel Vue headless PWA CMS.",
"docs": {
"core-concept/analytics": {
"title": "Analytics",
"sidebar_label": "Analytics"
},
"core-concept/auto-backup": {
"title": "Auto Backup",
"sidebar_label": "Auto Backup"
Expand Down Expand Up @@ -33,6 +37,10 @@
"title": "Multilanguage",
"sidebar_label": "Multilanguage"
},
"core-concept/plugins": {
"title": "Plugins",
"sidebar_label": "Plugins"
},
"core-concept/role-and-permissions": {
"title": "Role and Permissions",
"sidebar_label": "Role and Permissions"
Expand Down Expand Up @@ -221,6 +229,10 @@
"title": "What is Badaso",
"sidebar_label": "What is Badaso"
},
"version-1.0.0/core-concept/version-1.0.0-analytics": {
"title": "Analytics",
"sidebar_label": "Analytics"
},
"version-1.0.0/core-concept/version-1.0.0-auto-backup": {
"title": "Auto Backup",
"sidebar_label": "Auto Backup"
Expand Down Expand Up @@ -249,6 +261,10 @@
"title": "Multilanguage",
"sidebar_label": "Multilanguage"
},
"version-1.0.0/core-concept/version-1.0.0-plugins": {
"title": "Plugins",
"sidebar_label": "Plugins"
},
"version-1.0.0/core-concept/version-1.0.0-push-notification": {
"title": "Push Notification",
"sidebar_label": "Push Notification"
Expand Down
2 changes: 2 additions & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"core-concept/database-management",
"core-concept/auto-backup",
"core-concept/format-datetime",
"core-concept/plugins",
"core-concept/analytics",
"core-concept/push-notification"
],
"Customization": [
Expand Down
30 changes: 30 additions & 0 deletions website/translated_docs/id-ID/core-concept/analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: version-1.0.0-analytics
title: Analytics
sidebar_label: Analytics
original_id: analytics
---

Analytics berguna untuk mendapatkan informasi pengunjung seperti jumlah pengunjung di suatu halaman, rata-rata lama pengunjung mengakses situs, dll. Untuk menggunakan analytics di badaso, Anda harus membuat akun [Google Analytics](https://analytics.google.com/analytics/web) terlebih dahulu. Setelah itu, dapatkan View ID dan Tracking ID dari analytics Anda.

Masukkan View ID dan Tracking ID dari analytics Anda ke variabel .env `ANALYTICS_VIEW_ID` dan` MIX_ANALYTICS_TRACKING_ID`.

Untuk mengambil informasi pengunjung situs, Anda harus membuat akun layanan untuk analytics Anda dan mengunduh file service-account.json. Setelah itu, Anda dapat menyimpannya di direktori penyimpanan seperti di bawah ini.

```
📦 Your Project
┣ 📂 storage
┃ ┣ 📂 app
┃ ┃ ┣ 📂 analytics
┃ ┃ ┃ ┗ 📜 service-account-crendetial.js /** Simpan file .json disini. **/
```

:::important
Anda dapat menyesuaikan direktori penyimpanan kredensial akun layanan di file konfigurasi `analytics.php`.
:::

:::important
Analytics hanya akan mendeteksi pengunjung dari mengakses generated CRUD saja.
:::

Setelah itu Anda dapat melakukan query menggunakan class yang disediakan oleh spatie/laravel-analytics. Jika Anda ingin tahu lebih banyak tentang query tersebut, kunjungi [spatie/laravel-analytics](https://github.com/spatie/laravel-analytics).
17 changes: 16 additions & 1 deletion website/translated_docs/id-ID/core-concept/format-datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,19 @@ sidebar_label: Format Datetime
original_id: format-datetime
---

## Format Datetime
Badaso menyediakan beberapa konfigurasi untuk memformat tampilan waktu. Anda dapat menambahkan key di bawah ini ke .env Anda dan mengisinya dengan format yang Anda inginkan.

:::important
Badaso menggunakan <a href="https://momentjs.com/docs/#/displaying/format/" target="_blank">MomentJS</a> untuk memformat waktu tampilan
:::

```
#OPTIONAL. Format untuk menampilkan tanggal di UI
MIX_DATE_FORMAT=
#OPTIONAL. Format untuk menampilkan waktu di UI
MIX_TIME_FORMAT=
#OPTIONAL. Format untuk menampilkan tanggal waktu di UI
MIX_DATETIME_FORMAT=
```
Loading

0 comments on commit dd24d0f

Please sign in to comment.