Skip to content

Instantly share code, notes, and snippets.

View Mohammad-Faisal's full-sized avatar
🎯
Focusing

Mohammad Faisal Mohammad-Faisal

🎯
Focusing
View GitHub Profile
@Mohammad-Faisal
Mohammad-Faisal / Backend Project Checklist
Last active February 25, 2024 12:38
Backend Project Checklist
When creating a backend project we need to ensure that all of these basic things are implemented.
* First choose a suitable file structure
* Add swagger
* Add Environment for development and production (at least)
* Enable Cors
* Add schema based request validator
* Implement throwing Custom Exception
* Add Global Exception Handling
- Handle Database Exception
@Mohammad-Faisal
Mohammad-Faisal / Awesome ReactJS Libraries
Created October 14, 2020 18:43
Awesome ReactJS Libraries
Here are some awesome react-js libraries to use for upgrading the user experience
1. For Creating scrollable Header for page **react-headroom** is an awesome library.
Details : https://kyleamathews.github.io/react-headroom/
2. For Dealing with Table **material-table** is a very powerful library
Details : https://material-table.com/#/docs/get-started
3. For awesome toast messages **cogo-toast** is the go to option
Details: https://cogoport.github.io/cogo-toast/
importScripts('https://www.gstatic.com/firebasejs/7.14.2/firebase-app.js')
importScripts('https://www.gstatic.com/firebasejs/7.14.2/firebase-messaging.js')
const config = {
apiKey: "API_KEY",
authDomain: "PROJECT_ID.firebaseapp.com",
databaseURL: "https://PROJECT_ID.firebaseio.com",
projectId: "PROJECT_ID",
storageBucket: "PROJECT_ID.appspot.com",
messagingSenderId: "SENDER_ID",
export default function App () {
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('firebase-messaging-sw.js')
.then(function(registration) {
console.log('[SW]: SCOPE: ', registration.scope);
return registration.scope;
})
.catch(function(err) {
import firebase from 'firebase'
export const useFirebaseNotificationProvider = () => {
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('./firebase-messaging-sw.js')
.then(function (registration) {
console.log('Registration successful, scope is:', registration.scope)
})
.catch(function (err) {
console.log('Service worker registration failed, error:', err)
import React from 'react';
export default function Home() {
return <div>Home Page</div>
}
import React from 'react';
import Link from "next/link";
export default function Home() {
return <div>
<Link href={'about'}>Go to About Page</Link>
</div>
}
import React from 'react';
import styles from './layout.module.css'
export default function Layout({children}) {
return <div className={styles.container}>{children}</div>
}
function generatePreSignedGetUrl( fileName , fileType) {
myBucket.getSignedUrl('getObject', {
Key: fileName,
ContentType: fileType,
Expires: URL_EXPIRATION_TIME
} , (err , url) => {
return url // API Response Here
});
}
import {fetchData} from './AwsFunctions';
export default const App = () => {
const fetchDataFormDynamoDb = () => {
fetchData('users')
}
return <>
<button onClick={() => fetchDataFormDynamoDb()}> Fetch </button>