Deployment Guide
Deploying your Stratox project is straightforward. This guide will walk you through building your project and deploying it to popular services like GitHub Pages, Netlify, Vercel and more.
Building Your Stratox Project
To build your Stratox project, run the following command in your terminal:
npm run buildThis command will compile your app and output the static files into a directory named dist located in your project's root directory. These files are ready to be deployed to a hosting service of your choice.
Deploying to GitHub Pages
GitHub Pages is a free hosting service that lets you host static websites directly from your GitHub repository.
Steps:
Initialize a Git Repository (if you haven't already):
git init git add . git commit -m "Initial commit"Create a
gh-pagesBranch:git checkout -b gh-pagesCopy the
distContents to the Root:Replace the contents of your repository with the built files:
rm -rf !(dist) cp -r dist/* . rm -rf distCommit and Push to
gh-pagesBranch:git add . git commit -m "Deploy to GitHub Pages" git push origin gh-pagesConfigure GitHub Pages:
Go to your repository on GitHub.
Navigate to Settings > Pages.
Under Source, select the
gh-pagesbranch.Click Save.
Access Your Deployed App:
Your app will be available at:
https://<your-username>.github.io/<your-repository>/
Deploying to Netlify
Netlify is a popular platform for deploying static websites with continuous deployment and other powerful features.
Steps:
Create a Netlify Account:
Sign up at netlify.com.
Install Netlify CLI (optional but recommended):
npm install netlify-cli -gLogin via CLI:
netlify loginInitialize Your Site:
netlify initChoose to create & configure a new site.
Select the team (usually your username).
Provide a site name (optional).
Set the deploy path to
dist.
Deploy Your Site:
netlify deploy --prodAccess Your Deployed App:
Netlify will provide a URL where your app is deployed.
Deploying to Vercel
Vercel offers a seamless experience for deploying static sites and serverless functions.
Steps:
Install Vercel CLI:
npm install -g vercelLogin to Vercel:
vercel loginDeploy Your Project:
vercelWhen prompted, set the output directory to
dist.
Configure Project Settings (if needed):
You can adjust settings in the
vercel.jsonfile.
Access Your Deployed App:
Vercel will provide a URL where your app is deployed.
Deploying to Other Services
The dist folder contains all the static files needed to run your app. You can deploy these files to any static hosting service, such as:
Amazon S3 and CloudFront
Firebase Hosting
GitLab Pages
Surge.sh
General Steps:
Sign Up for the Service:
Create an account on your chosen hosting platform.
Upload the
distFolder:Use the platform's interface or CLI tools to upload your static files.
Configure Domain and Settings:
Set up any necessary configurations, such as custom domains or SSL certificates.
Access Your Deployed App:
Your app should now be live at the URL provided by the hosting service.
Conclusion
Deploying your Stratox project is as simple as building your app and uploading the contents of the dist folder to your preferred hosting service. With platforms like GitHub Pages, Netlify, and Vercel, you can have your app live in just a few minutes.
If you encounter any issues during deployment, consult the documentation of the hosting service or reach out to the Stratox community for support.
Last updated