-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding firebase and stencil boilerplate
- Loading branch information
Ranjeet Singh
committed
Aug 29, 2020
0 parents
commit 356c761
Showing
47 changed files
with
4,883 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"extends": [ | ||
"plugin:@stencil/recommended" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dist/ | ||
!www/favicon.ico | ||
www/ | ||
|
||
*~ | ||
*.sw[mnpcod] | ||
*.log | ||
*.lock | ||
*.tmp | ||
*.tmp.* | ||
log.txt | ||
*.sublime-project | ||
*.sublime-workspace | ||
|
||
.stencil/ | ||
.idea/ | ||
.vscode/ | ||
.sass-cache/ | ||
.versions/ | ||
node_modules/ | ||
$RECYCLE.BIN/ | ||
|
||
.DS_Store | ||
Thumbs.db | ||
UserInterfaceState.xcuserstate | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": false, | ||
"jsxSingleQuote": false, | ||
"quoteProps": "consistent", | ||
"printWidth": 180, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Stencil + Firebase 👋 | ||
This is a boilerplate for creating a webapp using [Stencil](https://github.com/ionic-team/stencil) + [Firebase](https://firebase.google.com) + [Stencil Store](https://stenciljs.com/docs/stencil-store). | ||
|
||
|
||
## Features 📋 | ||
|
||
- Firebase setup | ||
- Stencil Store setup | ||
- Login/Register/Update Profile/Logout functionality(Basic one) | ||
- Protecting routes that are accessed after login | ||
|
||
## Getting Started 🚀 | ||
|
||
To start using this boilerplate, clone this repo to a new directory: | ||
|
||
```bash | ||
git clone https://github.com/ranjeetsinghbnl/stencil-firebase.git | ||
``` | ||
|
||
and run: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
## Usage 🚊 | ||
|
||
Setup Firebase configuration | ||
|
||
Please setup firebase configuration in the file | ||
``` | ||
src -> config -> config.ts | ||
``` | ||
```js | ||
const firebaseConfig = { | ||
apiKey: "", | ||
authDomain: "", | ||
databaseURL: "", | ||
projectId: "", | ||
storageBucket: "", | ||
messagingSenderId: "", | ||
appId: "" | ||
}; | ||
``` | ||
You can find more about firebase web config setup [Firebase Web Config](https://firebase.google.com/docs/web/setup) | ||
|
||
To start a project, run: | ||
```bash | ||
npm run start | ||
``` | ||
|
||
To build the app for production, run: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
To run the unit tests once, run: | ||
|
||
``` | ||
npm run test | ||
``` | ||
|
||
To run the unit tests and watch for file changes during development, run: | ||
|
||
``` | ||
npm run test.watch | ||
``` | ||
|
||
## Project structure 🗄️ | ||
|
||
### Service | ||
This class will handle application authenticate features to firebase. | ||
``` | ||
src -> services -> auth.service.ts -> Class FirebaseAuthService | ||
``` | ||
You can create more classes to group a functionality. | ||
|
||
### Store | ||
Application store | ||
``` | ||
src -> store -> app.store.ts | ||
``` | ||
|
||
### Interfaces | ||
Interfaces used in the application | ||
``` | ||
src -> interface -> interface.ts | ||
``` | ||
### Utility | ||
Utility for parsing application messages and holding form configurations | ||
``` | ||
src -> util -> util.ts | ||
``` | ||
### Configuration | ||
Application level configurations | ||
``` | ||
src -> config -> config.ts | ||
``` | ||
### Assets | ||
Application level assets | ||
``` | ||
src -> assets | ||
``` | ||
### Components | ||
Application level components | ||
|
||
``` | ||
src -> components -> | ||
1. <app-flash-message> for showing alert messages | ||
2. <app-home> Dashboard | ||
3. <app-root> entry component of the application | ||
4. <common> sidebar functional component used in login/register components | ||
5. <page> for showing pages | ||
6. <auth> -> having login/register/update-profile components | ||
``` | ||
|
||
### Styling 💀 | ||
I have used `scss` for styling components. Ths boilerplate have a basic design i.e it focus more on configuring and using firebase in stencil web app along with stencil store. You can customize the looks as per our needs. | ||
|
||
## Firebase Error Messages | ||
I have shown the error message directly without modifying them returned by the API. You can customize them by modifying the `FirebaseAuthService` code | ||
|
||
## Contributing 👏 | ||
- :octocat: [Pull requests](https://github.com/ranjeetsinghbnl/stencil-firebase/pulls) and 🌟 stars are always welcome. | ||
- For changes, please open an [issue](https://github.com/ranjeetsinghbnl/stencil-firebase/pulls) first to discuss what you would like to change. | ||
|
||
## Contact 📩 | ||
📧 [email protected] | ||
|
||
🐦 Twitter [@ranjeetsingh_bl](https://twitter.com/ranjeetsingh_bl) | ||
|
||
💼 Linkedin [@ranjeetsinghbnl](linkedin.com/in/ranjeetsinghbnl) | ||
|
||
## License | ||
MIT © [Ranjeet Singh](https://github.com/ranjeetsinghbnl) |
Oops, something went wrong.