-
This project is for managing for
thefire project
But it can be used for serving the clients(members) of the app by customizing(designing) the front. -
Cloud functions in fireflutter-firebase should be deployed to manage user accounts. Managing user accounts like creating/deleting is not allowed directly from frontend.
git clone https://github.com/thruthesky/fireflutter-admin
cd fireflutter-admin
npm i
npm run serve
git clone https://github.com/thruthesky/fireflutter-firebase
cd fireflutter-firebase
npm i
cd functions
npm i
firebase deploy --only functions
npm install
npm run serve
npm run build
npm run test:unit
npm run test:e2e
npm run lint
- You can build and deploy anywhere you want.
npm run build
- Copy public folder to web server home folder.
To deploy fireflutter-admin to firebase, follow the instructions below.
- Edit firebase project id
{
"projects": {
"default": "... Input your project id here ..."
}
}
- And run the following
firebase use [project-id]
- Then run
firebase deploy --only hosting
- This explains how to create a user account and delete it.
/// Login as admin
try {
const userCreate = await firebase
.app()
.functions("asia-northeast3")
.httpsCallable("userCreate");
const re = await userCreate({
email: "create1@test.com",
password: "12345a,*",
phoneNumber: "+10123456701",
displayName: "User V",
photoURL: "http://www.example.com/12345678/photo.png",
disabled: false
});
const user = re.data;
console.log(user);
try {
const userDelete = await firebase
.app()
.functions("asia-northeast3")
.httpsCallable("userDelete");
await userDelete(user.uid);
} catch (e) {
const code = e.code;
const message = e.message;
const details = e.details;
console.log(code, message, details);
}
} catch (e) {
const code = e.code;
const message = e.message;
const details = e.details;
console.log(code, message, details);
}
Status Code: 500
Referrer Policy: strict-origin-when-cross-origin