Powering MPH recycling and composting facilities in Bali.
Access the current deployed app at FirebaseApp
Wireframes - backend super admin
Wireframes - public facing web
Zeplin desings Make sure you are registered and added to the project to view those. If you need adding to the project contact Andrea (sovesove) or Daria (piggydoughnut) or Nick Sarafa (nicksarafa)
If you would like to become a part of our team and be added to the repository, please contact Daria (piggydoughnut) or Nick Sarafa (nicksarafa).
The frontend can be found in the public directory and was initialised using Vue-CLI and the vuetify/webpack template.
The store is implemented using a single Vue instance that is made globably available through $firestore.
We're using firestore realtime data. Therefore all collections will be synced all the time and can be accessed from any component like this: $firestore.COLLECTION_NAME.
The following CRUD actions are available:
The app is designed to only look at a given day for all the forms and tables. The day can be changed using $firestore.changeDate(DATE).
To use in-app toasts just $emit toast message to the manager component
each user will have a corresponding user in Firebase
OTP using SMS, Firebase phone auth
State management: Vuex
UI Components Framework: Vueifiy
Routing: Vue-router
Internalization: Vue-i18n
Form validation: Vuelidate
Firebase integration: Vuefire
Initial build setup: Vue-CLI
Cloud Firestore Security rules structure allow you to control access to documents and collections in your database.
// All collections and are stored in the firestore
const settingsCollection = {
name: 'Facility 1',
village: 'Pererenan',
importantVillageGuy: {
id: 'Tu4SFfDhBUgAwGsvfopc', // person id
name: 'Michael'
},
materialTypes: [
{
name: 'Plastic',
pricePerKilo: 2000
},
{
name: 'Metal',
pricePerKilo: 2000
}
],
expenseType: [
'maintenance',
'other'
],
houseTypes: [
'villa',
'household',
'business',
'public facilities'
]
// + other information about the facility that we might need
}
const personCollection = [
{
login: firebaseUserId, // Only for people with a login
name: 'Test User',
phone: '+62 123 123 123',
whatsapp: '+62 123 123 123',
address: 'Jalan Batu Mejan No. 88, Canggu, Kuta Utara, Kabupaten Badung, Bali 80361',
email: 'some@address.com',
geolocation: {
latitude: '8.39111',
longitude: '115.07361'
},
type: {
employee: false,
client: false,
buyer: true
},
role: {
communityManager: false,
facilityManager: false,
superAdmin: true
},
houseType: 'villa',
approved: false,
lastFeePaid: [Object fee]
}
]
const deliveryCollection = [
{
timestamp: '2018-03-15T09:55:48.942Z',
driver: {
id: 'Tu4SFfDhBUgAwGsvfopc', // person id
name: 'Michael'
},
banjar: {
id: 'Tu4SFfDhBUgAwGsvfopc',
name: 'Michael'
}
}
]
const workerHoursCollection = [
{
employee: {
id: 'Tu4SFfDhBUgAwGsvfopc', // person id
name: 'Michael'
},
in: '2018-03-15T09:55:48.942Z',
out: null
}
]
const stockCollection = [
{
timestamp: '2018-03-15T09:55:48.942Z',
materialType: 'plastic',
amount: 200
}
]
const expenseCollection = [
{
description: 'Limited Furby Collection',
amount: 20000000,
person: {
id: 'Tu4SFfDhBUgAwGsvfopc',
name: 'Michael'
}
}
]
const saleCollection = [
{
buyer: {
id: 'Tu4SFfDhBUgAwGsvfopc',
name: 'Michael'
},
materials: [
{
materialType: 'plastic',
kilo: 200,
pricePerKilo: 20000
}
]
}
]
const feeCollection = [
{
timestamp: '2018-03-15T09:55:48.942Z',
monthly_fee: 50,
total_paid: 200,
paid_until: '2018-07-15T09:55:48.942Z'
}
]
const banjarCollection = [
{
name: 'Banjar Name',
pickupTimes: [
{
day: 'Monday',
time: '6am-2pm'
},
{
day: 'Tuesday',
time: '6am-2pm'
}
]
}
];
const materialCollection = [
{
worker: {
id: 'Tu4SFfDhBUgAwGsvfopc',
name: 'Worker name'
},
banjar: {
id: 'Tu4SFfDhBUgAwGsvfopc',
name: 'Banjar name'
},
organic: 10,
inorganic: 10,
timestamp: '2018-03-15T09:55:48.942Z'
}
]
There are more people in the system but they are not system users (have no login in the system) -
Registration
System users (community manager and facility manager) register using their mobile phone and an OTP sent to them via SMS.
Application to register
Customers apply to be added to the system, however they do not become system users.
Authentication
Phone numbers that end users provide for authentication will be sent and stored by Google to improve our spam and abuse prevention across Google services, including but not limited to Firebase. Developers should ensure they have appropriate end-user consent prior to using the Firebase Authentication phone number sign-in service.
Users login through OTP. Users will only need to login if they change the device they are using.
Add/edit delivery
Add/edit material
Add/edit stock
Add/edit worker hours
Add/edit a new buyer
Add/edit a sale
Add/edit an expense
Add/edit a customer - automatically prefilled from a customer application
Approve customer application (community manager)
add "approved" flag to the customer detail
Collect the fee from a customer (community manager)
Add a fee collection record
Send a confirmation email to the customer
Add/edit daily note
User actions log