Since the app is deployed to firebase, we need to first connect the application with firebase.
Setup firebase project with functions from Firebase Console.
The usage of
functionsrequires the "Blaze" plan (which requires a payment method). The expense depends on the usage, so please be careful.
The only thing required to connect your firebase project to this remix app is the Firebase Project ID. Copy the Project ID and paste it in .firebaserc file in the root.
The "Project ID" can be found in the project settings of your Firebase project.
To install them, from your terminal:
npm install -g firebase-toolsThen login to firebase with your CLI
firebase loginDependencies must be installed for both root package and functions package.
From your terminal
npm installcd functions
npm installFrom your terminal:
npm run devThis starts your app in development mode, rebuilding assets on file changes.
The app is can be accessed at http://localhost:3000.
Depending on method of deployment, their are different steps.
If you want to deploy directly from your local machine, run following command in your terminal.
npm run deployThis is a manual process and may cause you to upload old files from previous builds which are no longer necessary. You may clear up all the cache and previous builds before deploying with following command:
npm run clearMost likely, you would want to auto-deploy your app when you push to GitHub or other git hosts.
This starter-template comes with a configured GitHub Actions workflow to deploy the app when changes are pushed to main branch.
Workflow file: .github/workflows/firebase-deploy.yml
First, you need a FIREBASE_TOKEN that can be used in the CI. From your terminal, run:
firebase login:ciThis will provide you a TOKEN that can be used for deploying the app through CI. Copy that TOKEN.
Since in this example we are using GitHub Actions, we have add this TOKEN as a repository secret in GitHub. Learn more here.
The name of the secret must be FIREBASE_TOKEN and value should be the TOKEN that you copied from the output of firebase login:ci command.
Similar configuration can be created for deploying to other CI.
Tailwind is a great tool but maybe not for everyone. Removing it is easy.
-
Delete
tailwind.config.jsfile from the root of the directory. -
In
package.json,-
remove
tailwindcssfrom devDependencies. -
remove script
build:css,dev:cssandprebuild -
replace
devscript with:"dev": "concurrently \"npm run dev:remix\" \"npm run start\""
-
-
In
app/root.tsx,- remove import statement for
tailwindStyles - remove stylesheet object from
linksfunction (wheretailwindStylesis used).
- remove import statement for
For any clarification and assistant, contact me:
Siddhant Gupta [email protected] / GitHub
I hope you create something amazing