-
Notifications
You must be signed in to change notification settings - Fork 1
6. Settings & Management
You can set a user to admin by updating user document of Firestore directly. Admin property is protected by Firestore security rules and cannot be edited by client app.
-
Do User Email And Password Registration and register with a user as
[email protected]
.- You may add a user manually by entering email and password under Users in Firebase Authentication. But we recommend you to create a user account through the app after coding registration page.
-
Open Firebase => Authentication => Users
- And Copy
User UID
of[email protected]
.
- And Copy
-
Open Firebase => Firestore
- Set
{isAdmin: true}
on user document which is at/users/{uid}
. Follow the steps below to edit the document.- You will see
users
collection under data tab. Clickusers
- Search the
User UID
of[email protected]
- And click the
User UID
.
- And click the
- Click
+ Add field
. - Input
isAdmin
in Field. - Select
boolean
in Type. - Select
true
as Value. - Click Add
- You will see
- If ever, user document does not exist, you can create it.
- If a user is created by firebase console, or if a user registers in admin site, the user document may not exists.
- Set
-
Now the user is an admin.
- The app management here is based on the sample code and app.
- GetxFire is a flutter package to build social apps and is fully customizable. When you may build your own customized app, we recommend to use our sample codes.
- Developers can set default settings on
GetxFire.init()
. - Admin can overwrite all the settings by .updating Firestore
settings
docuemnts.
-
Menus and page contents can be translated depending on user's device. Or developer can put a menu to let users to choose their languages.
-
When admin update the translation text in Firestore
translations
collectin, the will get the update in real time. The app, should update the screen. -
The localization is managed by
GetX
package that is used for routing and state management on the sample code.
Forum category is a list(or a collection) of posts to differentiate from each kind. Category ID is a word(or words with dash separated) like reminder
, qna
, discussion
, public-photos
or whatever you want.
-
Post can be created only under an existing category.
-
You can create forum categories editing
categories
collection in Firestore- Or if there is an admin screen, admin may do so in admin screen.
-
Category can have any number of extra fields and data but
id
is a mandatory. Andtitle
,description
are reserved field name that should hold title and description respectively.
To create a creategory,
- Open
Cloud Firestore
- Create the
categories
collection if it is not present( by clicking+ Start collection
) - Then click
add a document
.- Put category(for instance, qna) id in
Document ID
and this should not be changed after. - And put
id
in Field column and the same category(for instance, qna) id in Value column. - You may optionally add more Field with
title
anddescription
.
- Put category(for instance, qna) id in
- Buy Me a Coffee : https://www.buymeacoffee.com/faisalramdan17
- Contact us on Telegram : https://t.me/faisalramdan17
- Website: https://codingyourlife.id
- GitHub: https://github.com/faisalramdan17
- Facebook : https://www.facebook.com/codingyourlife.id
- Instagram: https://instagram.com/faisalramdan17 & https://instagram.com/codingyourlife.id
- LinkedIn: https://www.linkedin.com/in/faisalramdan17