ProjectInBio serves as a micro SaaS boilerplate, in this case users can create their own shareble page to use on social media such as Linkedin, GitHub, Instagram and others. This app was developed during my studies about micro SaaS app at Rocketseat.
Public Pages:
- Home: The main landing page showcasing the product, including a hero section, video presentation, pricing details, and FAQs.
- Create Your Page: A secondary landing page similar to the home page but featuring an input field for users to enter a custom slug. Submitting the form directs them to social login to proceed.
- Resources: A landing page optimized for programmatic SEO, targeting specific social networks to promote the service.
- Pages: Public profile pages created by users, displaying their avatar, name, introduction, social media links, and custom links. Users can also showcase their projects.
Private Pages:
- Create Now: After social login, users complete their profile setup by entering a unique slug.
- Profile: A private version of the public profile with additional features, including edit buttons for all data, page visit analytics, and project click insights. If the user is in the trial period, a top bar prompts them to upgrade.
- Upgrade: If the trial period expires and the user has no active payment or subscription, this page is displayed to select a plan via Stripe.
Development:
- Next.js 15 & React 19: uses the App Router with Server Components for improved performance. Implements
unstable_cache
to optimize API usage. - Mixpanel Analytics: tracks user interactions on the server side and provides custom reports on app activity.
- Google Tag Manager & Google Analytics: enables custom tracking tags and client-side interaction tracking for detailed analytics.
- Stripe: handles subscriptions and one-time payments, leveraging webhooks to monitor payment events.
- Firebase: utilizes Firestore for data persistence and Storage for file management.
1️⃣ Stripe
- Create and setup your account.
- Set test mode on.
- Create a product with two prices: a recurring by month and a one-off (charge a one-time fee).
- Copy both prices ids and paste on env: recurring on
STRIPE_SUBSCRIPTION_PRICE_ID
and one-off onSTRIPE_PAYMENT_PRICE_ID
. - Access
Settings / Billing / Customer Portal
and activate this resource. - Access
Developers / API Keys
and copy both publishable and secret key and paste it respectively onNEXT_PUBLIC_STRIPE_PUBLIC_KEY
andSTRIPE_SECRET_KEY
env variables. - To get started with listening events, check out the below section Listen to Stripe events
2️⃣ Google Cloud API and Services (Auth)
- Create or use an existent project
- Setup the OAuth consent screen: on authorized domains, add a domain that you own or use vercel.com in case you are deploying and using their domain.
- Setup the OAuth Client on Credentials.
- Authorized JavaScript Origins:
http://localhost:3000
andhttps://<YOUR_DOMAIN>
. - Authorized Redirect URIs:
http://localhost:3000/api/auth/callback/google
andhttps://<YOUR_DOMAIN>/api/auth/callback/google
- Authorized JavaScript Origins:
- Copy both Client ID and Client Secret and paste it respectively on
AUTH_GOOGLE_ID
andAUTH_GOOGLE_SECRET
env variables.
3️⃣ Firebase Firestore Database and Storage
- Create or use a existent project
- Setup Firebase Database and Storage, this last one needs a Google Billing account attached.
- Access
Project Settings / Service Accounts
and generate a private key. A JSON file will be downloaded.- Copy the value of
project_id
toFIREBASE_PROJECT_ID
env variable - Copy the value of
private_key
toFIREBASE_PRIVATE_KEY
env variable - Copy the value of
client_email
toFIREBASE_CLIENT_EMAIL
env variable
- Copy the value of
- Access the Storage section and copy the bucket base url, something like
gs://in-bio-micro-saas.firebasestorage.app
and paste onFIREBASE_STORAGE_BUCKET
env variable withoutgs://
4️⃣ Google Analytics, Google Tag Manager and Mixpanel Analytics
NEXT_PUBLIC_GOOGLE_TAG_MANAGER
: used to create custom tags for tracking along with Google Analytics. Theses tags are ready to be configured:cta_home_clicks
,create_page_effective
,create_page_intention
,click_to_upgrade
andclick_to_checkout
.NEXT_PUBLIC_GOOGLE_ANALYTICS
: used for tracking interactions on client side.MIXPANEL_SECRET
: used for tracking interactions with these events on server side:page_view
,page_create_intend
,page_created
andcheckout_created
.
5️⃣ Misc env
NEXT_PUBLIC_APP_URL
: define your base domain or simplyhttp://localhost:3000
NEXT_PUBLIC_TRIAL_DAYS
: define the number of days that new users can get free access.NEXT_PUBLIC_MAX_PROJECTS
: define amax number of projects per page.AUTH_SECRET
define a random UUID used on Auth.js.
1️⃣ Localhost
- Install Stripe CLI.
- Sign in with your account and follow th steps:
stripe login
- Forward events to webhook:
stripe listen --forward-to localhost:3000/api/stripe/webhook
- After running the last command, you will receive on terminal a webhook secret key that you can paste on
STRIPE_WEBHOOK_SECRET
env variable.
2️⃣ Production
- Access
Developers / Webhooks
- Add an endpoint
https://<YOUR_DOMAIN>/api/stripe/webhook
and listen to these four events: - customer.subscription.updated - checkout.session.completed - checkout.session.async_payment_succeeded - customer.subscription.deleted - Set
STRIPE_WEBHOOK_SECRET
env with 'Signing secret' on endpoint details page.
The UI design was provided by Rocketseat, check it out.