Setup the landing page
ShipFlutter starter-kit offers also a landing page to promote and get organic traffic for your app.
We use Astro.build framework to build a static page that is, fast and optimized for search engines. It allows you to customize the landing page with your own content, add blogs (for SEO) and hosts privacy policy and terms pages that are required to launch an app on Google Play and Apple Store.
The ladning page is based on AstroWind but optimized for app landing page use-case.
Page speed results
We used Google Pagespeed to analyze the landing page and get a score of 100 in nearly all categories.
Getting started
You can locally run the landing page by following these steps:
- Install Node.js and npm (if you haven’t yet)
- From within the landing page folder run
- Once the dependencies are installed run
- Open http://localhost:4321 in your browser and enjoy
Setup Firebase Hosting
First, make sure you setup Firebase before continuing.
The setup depends if your project include a Flutter web target or not:
Landing + Flutter Web
If you are targeting web for Flutter and want to setup a landing page. You need to create two targets for Firebase Hosting. Otherwise you can skip this step.
-
Create two sites. One for landing and one for your app (e.g.
landing-myproject
andapp-myproject
). -
Go to the root of your project and run:
Only Landing
If you only need to setup the landing page you can use the firebase CLI wizard:
-
Run
firebase init
-
Select
Hosting
and follow the setup flow -
What do you want to use as your public directory?
landing/distPoint to the build folder of Astro.
-
Configure as a single-page app (rewrite all urls to /index.html)?
yes -
Set up automatic builds and deploys with GitHub?
yes -
Login to GitHub and follow the setup flow
-
When asked about
Set up the workflow to run a build script...
say NO to both.We already provide the GitHub workflow
.github/workflows/
Deploy
We recommend using Firebase Hosting to deploy your landing page (along your webapp). The project comes with a Firebase configuration and GitHub workflows that will help you setup and deploy the project.
Manually Deploy to Firebase Hosting
To manually deploy the site follow these steps:
-
Build your site with
-
If you target Flutter web build it too
-
Deploy with
Automatically Deploy to Firebase Hosting
If you are using GitHub we provide a workflow that will deploy whenever you merge code in GitHub. You can follow the detailed steps from the official docs.
In a nutshell:
- Create the secrets for
GITHUB_TOKEN
andFIREBASE_SERVICE_ACCOUNT
by running - Set the user/project in GitHub
- Say
No
when prompted to generate the workflow files (they are already provided by us) - Update workflows in
.github/workflows/
by providing the right secrets names.