You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Complete User Journey Example](#-Complete-User-Journey-Example)
46
47
-[Future Enhancements](#-future-enhancements)
47
48
-[Contribute](#-contribute-to-the-project)
@@ -569,8 +570,6 @@ This command generates a basic ESLint configuration file (`.eslintrc.json`) that
569
570
### 8. Add JWT Authetication and Authorization
570
571
Here is the content for the 8th command, "Add JWT Authentication":
571
572
572
-
### 8. Add JWT Authentication and Authorization
573
-
574
573
Add JWT authentication boilerplate to your backend project.
575
574
576
575
```bash
@@ -639,6 +638,133 @@ The generated files implement the following functionality:
639
638
640
639
After running this command, you can start using the authentication system in your backend application.
641
640
641
+
### 9. Deploy Frontend to Vercel
642
+
Deploy your frontend application to Vercel with a single command. This feature supports production deployments, preview deployments, custom domains, and automatic environment variable handling.
643
+
644
+
# 🚀 Frontend Deployment to Vercel CLI Guide
645
+
646
+
## Overview
647
+
Deploy your frontend application to Vercel with a single command using the `devcli` tool. This feature supports production deployments, preview deployments, custom domains, and automatic environment variable handling.
648
+
649
+
## Command Syntax
650
+
```bash
651
+
devcli deploy --vercel [options]
652
+
```
653
+
654
+
## Options
655
+
656
+
| Option | Description |
657
+
|--------|-------------|
658
+
|`--vercel`| Deploy the frontend to Vercel |
659
+
|`--preview`| Deploy a preview version (not production) |
660
+
|`--domain <domain>`| Specify a custom domain for deployment (e.g., `myapp.com`) |
661
+
662
+
## Features
663
+
664
+
#### 1. Automatic Environment Variable Handling
665
+
- Uploads environment variables from `.env` files automatically
666
+
- Validates required environment variables before deployment
667
+
668
+
#### 2. Preview Deployments
669
+
- Deploy a preview version of your app for testing and validation
670
+
671
+
#### 3. Custom Domain Support
672
+
- Deploy your application to a custom domain
673
+
674
+
#### 4. Deployment Status and URL
675
+
- Displays the deployment URL after successful deployment
676
+
677
+
#### 5. Vercel Login Check
678
+
- Automatically checks if the user is logged in to Vercel
679
+
- Prompts for login if not authenticated
680
+
681
+
#### Usage Examples
682
+
683
+
#### 1. Production Deployment
684
+
```bash
685
+
devcli deploy --vercel
686
+
```
687
+
688
+
**Expected Output:**
689
+
```
690
+
🚀 Deploying frontend to Vercel...
691
+
📦 Uploading environment variables...
692
+
✅ Frontend deployed successfully!
693
+
694
+
🎉 Your frontend has been deployed to Vercel!
695
+
👉 Open the deployed URL: https://myapp.vercel.app
696
+
```
697
+
698
+
#### 2. Preview Deployment
699
+
```bash
700
+
devcli deploy --vercel --preview
701
+
```
702
+
703
+
**Expected Output:**
704
+
```
705
+
🚀 Deploying frontend to Vercel (preview)...
706
+
📦 Uploading environment variables...
707
+
✅ Frontend deployed successfully!
708
+
709
+
🎉 Your frontend has been deployed to Vercel!
710
+
👉 Open the preview URL: https://myapp-git-branch.vercel.app
711
+
```
712
+
713
+
#### 3. Custom Domain Deployment
714
+
```bash
715
+
devcli deploy --vercel --domain myapp.com
716
+
```
717
+
718
+
**Expected Output:**
719
+
```
720
+
🚀 Deploying frontend to Vercel with custom domain...
721
+
📦 Uploading environment variables...
722
+
✅ Frontend deployed successfully!
723
+
724
+
🎉 Your frontend has been deployed to Vercel!
725
+
👉 Open the deployed URL: https://myapp.com
726
+
```
727
+
728
+
### Prerequisites
729
+
730
+
### Vercel CLI Installation
731
+
Install the Vercel CLI globally:
732
+
```bash
733
+
npm install -g vercel
734
+
```
735
+
736
+
### Vercel Login
737
+
Log in to Vercel:
738
+
```bash
739
+
vercel login
740
+
```
741
+
742
+
### Error Handling
743
+
744
+
#### 1. Invalid Directory
745
+
```
746
+
❌ This does not seem to be a valid frontend app. Make sure you are in the root of your frontend project.
747
+
```
748
+
749
+
#### 2. Vercel CLI Not Installed
750
+
```
751
+
❌ Vercel CLI is not installed. Please install it using `npm install -g vercel`.
752
+
```
753
+
754
+
#### 3. Vercel Login Required
755
+
```
756
+
🔑 You are not logged in to Vercel. Please log in to continue.
757
+
```
758
+
759
+
### Best Practices
760
+
- Ensure your project has a valid `package.json`
761
+
- Configure your Vercel project settings in the Vercel dashboard
762
+
- Use environment variables for sensitive configuration
763
+
- Regularly test preview deployments before production
764
+
765
+
### Support
766
+
For additional help, consult the Vercel documentation or contact your development team's support channels.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "mern-project-cli",
3
-
"version": "2.1.4",
3
+
"version": "2.1.5",
4
4
"description": "A developer-friendly CLI tool that streamlines MERN stack development by automating project setup, database configuration, and boilerplate generation by implementing MVC Architecture. Create production-ready MongoDB, Express, React, and Node.js applications with best practices built-in",
0 commit comments