Grow your SaaS organically with Content Marketing.
Try for free →Looking for the backend Node.js project? Click here.
npx create-react-app react-frontend --template typescript
cd react-frontend
Run the app with:
npm run start
Create a .env
:
REACT_APP_SECRET_CODE=1234
Using it in React components:
console.log(process.env.REACT_APP_SECRET_CODE);
Make sure to add to .gitignore:
.env
node_modules
build
Choose Deployment method: Heroku CLI
Download Heroku CLI from here.
git init
git add .
git commit -am "first commit"
heroku apps:create saasbase-fe
heroku git:remote -a saasbase-fe
git push heroku master
heroku open
If you're deploying to Production, continue on.
FROM node:16 AS builder
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . ./
RUN npm run build
FROM nginx:1.19.0
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/build .
ENTRYPOINT ["nginx", "-g", "daemon off;"]
docker build -t saasbase-fe . --platform linux/amd64 # make sure the build is for correct platform
docker run -p 8000:8000 -d sssaini/saasbase-fe
To create a repository:
sssaini/saasbase-fe
docker login
docker tag saasbase-fe sssaini/saasbase-fe:0.1
docker push sssaini/saasbase-fe:0.1
Follow instructions to set up Homebrew for M1 Macs here and try again.
I'm building a new SaaS to automate content marketing for your SaaS
Tools for SaaS Devs