Skip to content

Commit

Permalink
Merge pull request #80 from ciatph/dev
Browse files Browse the repository at this point in the history
v1.1.5
  • Loading branch information
ciatph authored Sep 29, 2024
2 parents 359c748 + 9e3c74c commit c47d7ec
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
runs-on: ubuntu-latest
env:
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
REACT_APP_FIREBASE_API_KEY: ${{ secrets.REACT_APP_FIREBASE_API_KEY }}
REACT_APP_FIREBASE_AUTHDOMAIN: ${{ secrets.REACT_APP_FIREBASE_AUTHDOMAIN }}
REACT_APP_FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_PROJECT_ID }}
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.REACT_APP_FIREBASE_STORAGE_BUCKET }}
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.REACT_APP_FIREBASE_MESSAGING_SENDER_ID }}
REACT_APP_FIREBASE_APP_ID: ${{ secrets.REACT_APP_FIREBASE_APP_ID }}
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.REACT_APP_FIREBASE_MEASUREMENT_ID }}
strategy:
matrix:
node-version: [14.x]
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ The server also serves the pre-built `client` website from a static directory us
1. Pull the (production) **/server** [Docker image](https://hub.docker.com/repository/docker/ciatphdev/firebase-users-app) from Docker Hub.
- Find the latest version tag from https://hub.docker.com/r/ciatphdev/firebase-users-app, i.e., `v1.1.5`
- `docker pull ciatphdev/firebase-users-app:v1.1.5`
- **NOTE:**
2. Create a `.env` file.
- Read [**Installation - server #3**](#server) for more information.
- Replace the variables accordingly in the `.env` file. Set `ALLOW_CORS=0` to allow `Same Origin` requests. Read [**Option #2 - Client and Server Bundled in (1) Image and Service**](#option-2---client-and-server-bundled-in-1-image-and-service) for more information.
Expand All @@ -245,15 +244,15 @@ The server also serves the pre-built `client` website from a static directory us
FIREBASE_SERVICE_ACC=YOUR-FIREBASE-PROJ-SERVICE-ACCOUNT-JSON-CREDENTIALS-ONE-LINER-NO-SPACES
FIREBASE_PRIVATE_KEY=PRIVATE-KEY-FROM-FIREBASE-SERVICE-ACCOUNT-JSON-WITH-DOUBLE-QUOTES
EMAIL_WHITELIST=superadmin@gmail.com
ALLOW_CORS=0
ALLOW_AUTH=1
ALLOW_CORS=0
ALLOW_AUTH=1
```
3. Run the image.
```
docker run -it --rm \
--env-file .env \
-p 3001:3001 \
ciatphdev/firebase-users-admin-app:v1.1.2
ciatphdev/firebase-users-admin-app:v1.1.5
```
4. Run a script in the container to create the default `superadmin@gmail.com` account, if it does not yet exist in the Firestore database.
`docker exec -it firebase-users-admin-app npm run seed`
Expand All @@ -280,15 +279,15 @@ https://hub.docker.com/r/ciatphdev/firebase-users-server/tags
### Usage Options
- Use with the docker-compose.dev.yml file (requires a `.env` file inside the client and server folders):<br>
- Use with the docker-compose.dev.yml file (requires a `.env` file input parameter):<br>
`docker compose -f docker-compose.dev.yml pull`
- Docker pull<br>
```
docker pull ciatphdev/firebase-users-client:dev
docker pull ciatphdev/firebase-users-server:dev
```
- Docker run (requires a `.env` file inside the client and server folders):<br>
- Docker run (requires a `.env` file input parameter):<br>
```
docker run -it --rm --env-file .env -p 3000:3000 ciatphdev/firebase-users-client:dev
docker run -it --rm --env-file .env -p 3001:3001 ciatphdev/firebase-users-server:dev
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ services:
networks:
- firebase-users-dev
volumes:
- ./server/src:/opt/server/src
- ./server:/opt/server
- /opt/server/node_modules
ports:
- "3001:3001"

Expand Down
45 changes: 36 additions & 9 deletions server/src/utils/templates/header.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ username: superadmin@gmail.com
password: 123456789
```

- **live client app:** [https://fire-auth-users.web.app/](https://fire-auth-users.web.app/)
- **live client app:** [https://adminusers-dev.web.app/](https://adminusers-dev.web.app/)
- **localhost app:** [http://localhost:3000](http://localhost:3000)
- Read more about the localhost environment set-up instructions on [firebase-auth-users](https://github.com/ciatph/firebase-users-admin)
- Read more about the localhost environment set-up instructions on [firebase-admin-users](https://github.com/ciatph/firebase-users-admin)

### Docker

firebase-users-admin's server component, hosting all the listed endpoints below is available as a stand-alone [docker image](https://hub.docker.com/r/ciatphdev/firebase-users-admin-server) on Docker Hub with customizable environment variables (.env file).

The server also serves a pre-built [`client`](https://github.com/ciatph/firebase-users-admin/tree/dev/client) website from a static directory using the `express.static()` middleware, following the build instructions from [**Option #2 - Client and Server Bundled in (1) Image and Service**](https://github.com/ciatph/firebase-users-admin#option-2---client-and-server-bundled-in-1-image-and-service).

1. Pull the (production) **/server** [docker image](https://hub.docker.com/repository/docker/ciatphdev/firebase-users-admin-server) from Docker Hub.
`docker pull ciatphdev/firebase-users-admin-app:v1.1.2`
2. Create a `.env` file.
1. Pull the (production) **/server** [Docker image](https://hub.docker.com/repository/docker/ciatphdev/firebase-users-app) from Docker Hub.
- Find the latest version tag from https://hub.docker.com/r/ciatphdev/firebase-users-app, i.e., `v1.1.5`
- `docker pull ciatphdev/firebase-users-app:v1.1.5`
2. Create a `.env` file.
- Read [**Installation - server #3**](https://github.com/ciatph/firebase-users-admin#server) for more information.
- Replace the variables accordingly in the `.env` file. Set `ALLOW_CORS=0` to allow `Same Origin` requests. Read [**Option #2 - Client and Server Bundled in (1) Image and Service**](https://github.com/ciatph/firebase-users-admin#option-2---client-and-server-bundled-in-1-image-and-service) for more information.
```
Expand All @@ -39,21 +40,47 @@ The server also serves a pre-built [`client`](https://github.com/ciatph/firebase
docker run -it --rm \
--env-file .env
-p 3001:3001 \
ciatphdev/firebase-users-admin-app:v1.1.2
ciatphdev/firebase-users-admin-app:v1.1.5
```
4. Run a script in the container to create the default `superadmin@gmail.com` account, if it does not yet exist in the Firestore database.
4. Run a script in the container to create the default `superadmin@gmail.com` account, if it does not yet exist in the Firestore database.
`docker exec -it firebase-users-admin-app npm run seed`
5. Launch the server API documentation on
5. Launch the server API documentation on
`http://localhost:3001/docs`
6. Launch the client website on `http://localhost:3001`.
- Login using the superadmin account create on step # 4.
- Login using the superadmin account create on step # 4.
```
username: superadmin@gmail.com
password: 123456789
```
- Test the API routes by creating new accounts, editing or deleting existing accounts.
- The signed-in user's Firebase Auth token is available on the **Home** page (http://localhost:3001/)
### Pre-built Server Docker Image (Client + Server) Development
Pre-built Docker images of the **server** and **client** for local development are also available on Docker Hub at:
- **client**<br>
https://hub.docker.com/r/ciatphdev/firebase-users-client/tags
- **server**<br>
https://hub.docker.com/r/ciatphdev/firebase-users-server/tags
### Usage Options
- Use with the docker-compose.dev.yml file (requires a `.env` file input parameter):<br>
`docker compose -f docker-compose.dev.yml pull`
- Docker pull<br>
```
docker pull ciatphdev/firebase-users-client:dev
docker pull ciatphdev/firebase-users-server:dev
```
- Docker run (requires a `.env` file input parameter):<br>
```
docker run -it --rm --env-file .env -p 3000:3000 ciatphdev/firebase-users-client:dev
docker run -it --rm --env-file .env -p 3001:3001 ciatphdev/firebase-users-server:dev
```
### References
- [firebase-users-admin](https://github.com/ciatph/firebase-users-admin) (GitHub repository)
Expand Down

0 comments on commit c47d7ec

Please sign in to comment.