Skip to content

Commit baa522e

Browse files
docs: add project setup guide
1 parent 2ae10b0 commit baa522e

File tree

3 files changed

+119
-2
lines changed

3 files changed

+119
-2
lines changed

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@
3434
# ones.
3535
extensions = [
3636
'sphinx.ext.autodoc',
37+
'sphinx.ext.autosectionlabel',
3738
'sphinx.ext.intersphinx',
3839
'sphinx.ext.napoleon',
3940
'sphinx.ext.viewcode',
41+
'sphinx_design',
4042
]
4143

44+
# auto section label configuration
45+
autosectionlabel_prefix_document = True
46+
autosectionlabel_maxdepth = 2
47+
4248
# Add any paths that contain templates here, relative to this directory.
4349
templates_path = ['_templates']
4450

@@ -68,5 +74,6 @@
6874

6975
# custom static css files to add
7076
html_css_files = [
77+
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/fontawesome.min.css",
7178
"css/my-styles.css",
7279
]

docs/guide/setup.rst

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
Setup Project
2+
=============
3+
4+
Before you can add Firebase to your Python app, you need to
5+
create a Firebase project and register your app with that
6+
project. When you register your app with Firebase, you'll
7+
get a Firebase configuration object that you'll use to
8+
connect your app with your Firebase project resources.
9+
10+
11+
Create a Firebase project
12+
-------------------------
13+
14+
1. In the `Firebase console`_, click **Add project**.
15+
16+
* To add Firebase resources to an existing Google Cloud project,
17+
enter its project name or select it from the dropdown menu.
18+
19+
* To create a new project, enter the desired project name. You
20+
can also optionally edit the project ID displayed below the
21+
project name.
22+
23+
.. attention::
24+
25+
Firebase generates a unique ID for your Firebase project based
26+
upon the name you give it. If you want to edit this project
27+
ID, you must do it now as it cannot be altered after Firebase
28+
provisions resources for your project. Visit
29+
`Understand Firebase`_ Projects to learn about how Firebase
30+
uses the project ID.
31+
32+
2. If prompted, review and accept the Firebase terms.
33+
34+
3. Click **Continue**.
35+
36+
4. (Optional) Set up Google Analytics for your project.
37+
38+
.. note::
39+
40+
You can always set up Google Analytics later in the
41+
|integrations|_ tab of your :fa:`gear; 2em` Project settings.
42+
43+
5. Click **Create project** (or **Add Firebase**, if you're using
44+
an existing Google Cloud project).
45+
46+
Firebase automatically provisions resources for your Firebase project.
47+
When the process completes, you'll be taken to the overview page for
48+
your Firebase project in the Firebase console.
49+
50+
.. _Firebase Console: https://console.firebase.google.com
51+
.. |integrations| replace:: *integrations*
52+
.. _integrations: https://console.firebase.google.com/u/0/project/_/settings/integrations
53+
.. _Understand Firebase: https://firebase.google.com/docs/projects/learn-more#project-id
54+
55+
56+
Setup Realtime Database
57+
^^^^^^^^^^^^^^^^^^^^^^^
58+
59+
``databaseURL`` key is not present by default in the Firebase
60+
configuration when an app is :ref:`registered<guide/setup:Register your app>`.
61+
It is recommended to setup database before
62+
:ref:`registering an app<guide/setup:Register your app>`.
63+
64+
65+
66+
Register your app
67+
-----------------
68+
69+
After you have a Firebase project, you can register your web app with
70+
that project.
71+
72+
1. In the center of the `Firebase console's project overview page`_,
73+
click the **Web** icon (:fa:`code; fa-solid; 2em`) to launch the
74+
setup workflow.
75+
76+
| If you've already added an app to your Firebase project,
77+
click **Add app** to display the platform options.
78+
79+
2. | Enter your app's nickname.
80+
| This nickname is an internal, convenience identifier
81+
and is only visible to you in the Firebase console.
82+
83+
3. Click **Register app**.
84+
85+
4. | Copy the Firebase configuration dict shown in the screen, and
86+
store it use to connect to your project later in code example
87+
part.
88+
| The dict should be of the architecture shown below:
89+
90+
.. code-block:: python
91+
92+
config = {
93+
"apiKey": "apiKey",
94+
"authDomain": "projectId.firebaseapp.com",
95+
"databaseURL": "https://databaseName.firebaseio.com",
96+
"projectId": "projectId",
97+
"storageBucket": "projectId.appspot.com",
98+
"messagingSenderId": "messagingSenderId",
99+
"appId": "appId"
100+
}
101+
..
102+
103+
5. Click **Continue to console**.
104+
105+
.. _Firebase console's project overview page: https://console.firebase.google.com

docs/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ In order to use this library, you first need to go through the
2727
following steps:
2828

2929
1. Select or create a Firebase project from `Firebase Console`_.
30-
:ref:`(guide)<guide/project-setup:Create a Firebase project>`
30+
:ref:`(guide)<guide/setup:Create a Firebase project>`
3131

3232
2. Register an Web App.
33-
:ref:`(guide)<guide/project-setup:Register your app>`
33+
:ref:`(guide)<guide/setup:Register your app>`
3434

3535
.. _Firebase Console: https://console.firebase.google.com
3636

@@ -96,6 +96,11 @@ Example Usage
9696
Documentation contents
9797
######################
9898

99+
.. toctree::
100+
:maxdepth: 1
101+
102+
guide/setup
103+
99104
.. toctree::
100105
:maxdepth: 2
101106

0 commit comments

Comments
 (0)