Step 7: Create Admin User

Granting Admin Access in Firebase Firestore

Create Your First User

Now that the necessary environment variables are set and the SaaSavant dependencies are installed, you can create your first user. This can either be a temporary test user or a real user that you can set as an Admin. Setting a user as Admin will allow you to access the SaaSavant Admin dashboard and manage your SaaS product as mentioned earlier.

Once this is done the first time and you have access to the Admin Dashboard, you can grant or remove Admin access for any user. The following setup process is only required to grant Admin access to the first Admin user.

  1. Open a terminal and navigate to your project directory.
cd /path/to/your/project
  1. Run the following command:
npm run dev
  1. Open your browser and navigate to the Signup page or click here: Signup (opens in a new tab)

  2. Enter your credentials (email and password) then submit the form.

Check your email for a welcome email. (This may take a few minutes and we don't need it for setup, but it's good to check and make sure the sign up flow is working properly. If you have set up the project correctly, you should receive an email shortly.)

To grant admin access, follow these steps:

  1. Navigate to the Firebase Console:

  2. Access the Firestore Dashboard:

    • In the left-hand menu, click on Firestore Database.
  3. Locate the Users Collection:

    • In the Firestore Database pane, find and click on the Users collection to expand it.
  4. Find the User Document:

    • Look for the user document you recently created, it should be theonly one in the collection. Click on the document to open it.
  5. Change isAdmin Field:

  • By default, all users are set to false. To grant admin access, set the isAdmin field to true.

Demo 13

  1. Save and Confirm Changes:

    • Ensure that the isAdmin field is set to true.
    • Click the Save button.

Note: You can set as many users as you want to be Admins. However, be cautious when assigning Admin rights, as granting these privileges to the wrong person can have significant security implications.

The Admin Dashboard in SaaSavant provides a comprehensive interface for managing your application.

Demo 13

Key features include:

Paginated User List

  • User Management: View and manage all registered users.
  • Pagination: Display users in pages, with a default limit set to 50 users per page and scrolling enabled after the first 10 for ease of navigation.

Announcements

  • Create Announcements: Admins can create and publish announcements to be displayed to all users.

Support Tickets

  • Support Tickets: Admins can manage support tickets and mark them open or resolved. Users can submit support tickets from their dashboard.
  • Pagination: Display support tickets in pages, for ease of navigation.