-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from BFlorian91/dev
Dev merge new firebase admin config and some minors update
- Loading branch information
Showing
3 changed files
with
59 additions
and
56 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 |
---|---|---|
@@ -1,49 +1,52 @@ | ||
# Contributing to Code-Snippets-Vault | ||
# Contribution Guide | ||
|
||
Hey there! 👋 Excited you're interested in contributing to Code-Snippets-Vault! Your contributions help this project grow and improve. 🚀 | ||
## Welcome | ||
|
||
## How to Contribute? | ||
Thank you for considering contributing to Snippet Vault! We value your input and are excited to collaborate with you. | ||
|
||
Here’s how you can jump in: | ||
## How to Contribute | ||
|
||
- Fixing bugs or resolving issues | ||
- Improving or updating the documentation | ||
- Suggesting or adding new features | ||
- Optimizing existing code | ||
- Writing tests to ensure stability | ||
### Reporting Bugs | ||
|
||
## Steps for Contributing | ||
- **Check Existing Issues**: Before creating a new issue, please check if it's already reported. | ||
- **Provide Details**: When reporting a bug, include as much information as possible to help us understand and fix it. | ||
|
||
1. **Fork the Project**: Start by forking the repository to your account. | ||
### Feature Suggestions | ||
|
||
2. **Clone Your Fork**: Get your fork onto your local machine. | ||
- **Open an Issue**: Discuss new features in an issue before working on them. | ||
- **Describe Clearly**: Provide a clear and detailed explanation of the proposed feature. | ||
|
||
3. **Create a New Branch**: Make a new branch for your updates. Give it a descriptive name. | ||
### Pull Requests | ||
|
||
4. **Make Your Changes**: Time to code! Implement your ideas. | ||
- **Small Changes**: Keep your changes small and focused to make the review process easier. | ||
- **Follow Style**: Adhere to the existing coding style of the project. | ||
- **Test Your Code**: Ensure your code works correctly and add new tests if necessary. | ||
- **Describe Your Changes**: In your pull request, explain what your changes do and why they are needed. | ||
|
||
5. **Commit Your Changes**: Commit your changes with clear messages. | ||
## Review Process | ||
|
||
6. **Push Your Changes**: Push your changes to your fork. | ||
Your contributions will be reviewed by the maintainers. They might request some changes or additional information. | ||
|
||
7. **Open a Pull Request**: Create a pull request to the main branch. Describe what you've done. | ||
## Getting Started | ||
|
||
8. **Review and Discussion**: We'll review your PR. Be open to suggestions or questions. | ||
- **Fork the Repo**: Create your own fork of the project. | ||
- **Clone Your Fork**: `git clone [your-fork-url]` | ||
- **Create a Branch**: `git checkout -b [your-branch-name]` | ||
|
||
9. **Merge**: If all is good, your contributions will be merged into the project! | ||
## Resources | ||
|
||
## Best Practices | ||
**The documentation is currently under development.** | ||
|
||
- Add tests for new features. | ||
- Update the documentation if you're adding or changing features. | ||
- Small, focused pull requests are easier to review and merge. | ||
- [Project Documentation](link-to-docs) | ||
|
||
## Need Help? | ||
## Thanks | ||
|
||
If you have questions or need assistance, feel free to open an "issue". We're here to help! | ||
Your contributions help make this project better. We appreciate your efforts! | ||
|
||
## Thank You! | ||
## Questions? | ||
|
||
Your contributions make Code-Snippets-Vault a great project. Let's build something amazing together! | ||
For any questions, feel free to contact bflorian91 at 2jggvgdztt@privaterelay.appleid.com. | ||
|
||
Happy coding! | ||
--- | ||
|
||
Thank you for contributing to our project! |
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
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,28 @@ | ||
import admin from "firebase-admin"; | ||
|
||
async function initFirebaseAdmin() { | ||
if (process.env.FIREBASE_TYPE) { | ||
try { | ||
const serviceAccount = { | ||
type: process.env.FIREBASE_TYPE, | ||
project_id: process.env.FIREBASE_PROJECT_ID, | ||
private_key_id: process.env.FIREBASE_PRIVATE_KEY_ID, | ||
private_key: process.env.FIREBASE_PRIVATE_KEY!.replace(/\\n/g, "\n"), | ||
client_email: process.env.FIREBASE_CLIENT_EMAIL, | ||
client_id: process.env.FIREBASE_CLIENT_ID, | ||
auth_uri: process.env.FIREBASE_AUTH_URI, | ||
token_uri: process.env.FIREBASE_TOKEN_URI, | ||
auth_provider_x509_cert_url: | ||
process.env.FIREBASE_AUTH_PROVIDER_X509_CERT_URL, | ||
client_x509_cert_url: process.env.FIREBASE_CLIENT_X509_CERT_URL, | ||
}; | ||
await admin.initializeApp({ | ||
credential: admin.credential.cert(serviceAccount), | ||
}); | ||
} catch (error) { | ||
console.error("Failed to initialize Firebase Admin:", error); | ||
} | ||
} | ||
} | ||
|
||
initFirebaseAdmin(); |