Skip to content

Commit f8c025d

Browse files
Merge pull request #4 from charlyautomatiza:docs/google-docs+vercel
docs: 📝 docs/google-docs+vercel
2 parents 1310b70 + 262edff commit f8c025d

File tree

1 file changed

+52
-40
lines changed

1 file changed

+52
-40
lines changed

README.md

Lines changed: 52 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,74 +36,86 @@ DevFolio is a modern, responsive, and customizable portfolio template for develo
3636

3737
### Personal Information
3838

39-
Edit the `personal-info.md` file in the `content` directory to update your name, role, and other personal details.
39+
Edit the [personal-info.md](./src/content/personal-info.md) file in the `content` directory to update your name, role, and other personal details.
4040

4141
### Projects
4242

43-
Add or modify projects in the `projects.md` file in the `content` directory. Each project should have a title, description, image, and link.
43+
Add or modify projects in the [projects.md](./src/content/projects.md) file in the `content` directory. Each project should have a title, description, image, and link.
4444

4545
### CV/Resume
4646

47-
Update your experience, education, and skills in the `cv.md` file in the `content` directory.
47+
Update your experience, education, and skills in the [cv.md](./src/content/cv.md) file in the `content` directory.
4848

4949
### Social Links
5050

51-
Edit the `social-links.md` file in the `content` directory to add or modify your social media links.
51+
Edit the [social-links.md](./src/content/social-links.md) file in the `content` directory to add or modify your social media links.
5252

53-
## Google Sheets Integration
53+
## Portfolio Configuration with Google Sheets for Contact Form (optional)
5454

55-
To connect the contact form to Google Sheets:
55+
This guide explains how to set up Google Sheets to use it with the contact form in your portfolio and configure the necessary environment variables in Vercel.
5656

57-
1. Create a new Google Sheet
58-
2. Go to Tools > Script editor
59-
3. Replace the content of the script editor with the following code:
57+
### Setting Up Google Sheets for Your Portfolio
6058

61-
```javascript
62-
function doPost(e) {
63-
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
64-
var data = JSON.parse(e.postData.contents);
65-
sheet.appendRow([new Date(), data.name, data.email, data.message]);
66-
return ContentService.createTextOutput("Success");
67-
}
68-
```
59+
1. **Configure Google Sheets API**:
60+
- Go to the [Google Developers Console](https://console.developers.google.com/).
61+
- Create a new project (or select an existing one).
62+
- Enable the **Google Sheets API** and **Google Drive API** for this project.
63+
- In "Credentials," create a **Service Account** and download the credentials JSON file.
6964

70-
4. Deploy the script as a web app:
71-
- Click on "Deploy" > "New deployment"
72-
- Select "Web app" as the type
73-
- Set "Execute as" to your Google account
74-
- Set "Who has access" to "Anyone"
75-
- Click "Deploy"
76-
5. Copy the provided URL for the web app
65+
2. **Share Your Google Sheet**:
66+
- Open your Google Sheet and share access with the service account email (`GOOGLE_CLIENT_EMAIL`) that you created in Step 1. Ensure that it has **Editor** permissions.
67+
- Copy your spreadsheet ID from the URL (the part between `/d/` and `/edit`), which will be used for `GOOGLE_SHEET_ID`.
7768

78-
## Environment Variables
69+
3. **Setting Up Environment Variables in Vercel**:
70+
To enable Google Sheets functionality on Vercel, you need to configure the following environment variables.
7971

80-
Create a `.env.local` file in the root of your project with the following content:
72+
#### Steps to Add Environment Variables in Vercel
8173

82-
```
83-
NEXT_PUBLIC_GOOGLE_SCRIPT_URL=your_google_script_url_here
84-
```
74+
- Go to your Vercel project dashboard.
75+
- Navigate to **Settings** > **Environment Variables**.
76+
- Click on **Add New Variable** and add each variable with its corresponding value as follows:
77+
78+
- **Variable Name**: `NEXT_PUBLIC_GOOGLE_SHEETS_ENABLED`
79+
- **Value**: `true`
80+
- **Environment**: Select the appropriate environment (e.g., Production, Preview, Development).
8581

86-
Replace `your_google_script_url_here` with the URL you copied from the Google Apps Script deployment.
82+
- **Variable Name**: `GOOGLE_CLIENT_EMAIL`
83+
- **Value**: The service account email from Step 1.
84+
- **Environment**: Choose the environment as needed.
8785

88-
## Deployment
86+
- **Variable Name**: `GOOGLE_PRIVATE_KEY`
87+
- **Value**: Copy the private key from your service account JSON file. Make sure to paste it exactly as it appears, without adding `\n` for line breaks if entering directly in Vercel.
88+
- **Environment**: Select the desired environment.
8989

90-
You can easily deploy your portfolio using Vercel:
90+
- **Variable Name**: `GOOGLE_SHEET_ID`
91+
- **Value**: The ID of your Google Sheet.
92+
- **Environment**: Select the appropriate environment.
9193

92-
1. Push your changes to your GitHub repository
93-
2. Go to [Vercel](https://vercel.com) and sign in with GitHub
94-
3. Click "Import Project" and select your repository
95-
4. In the "Environment Variables" section, add the `NEXT_PUBLIC_GOOGLE_SCRIPT_URL` variable with your Google Apps Script URL
96-
5. Click "Deploy"
94+
- **Variable Name**: `NEXT_PUBLIC_GOOGLE_SCRIPT_URL`
95+
- **Value**: The URL of the Google Apps Script, if used (optional).
96+
- **Environment**: Select the desired environment.
97+
98+
- Once all variables are entered, redeploy your project to apply the changes.
99+
100+
### Example Environment Variable Configuration in `.env.local` (for local development)
101+
102+
```env
103+
NEXT_PUBLIC_GOOGLE_SHEETS_ENABLED=true
104+
GOOGLE_CLIENT_EMAIL=your-service-account-email@your-project.iam.gserviceaccount.com
105+
GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBg...\n-----END PRIVATE KEY-----\n"
106+
GOOGLE_SHEET_ID=1A2B3C4D5E6F7G8H9I0J
107+
NEXT_PUBLIC_GOOGLE_SCRIPT_URL=https://script.google.com/macros/s/EXAMPLE_SCRIPT_ID/exec
108+
```
97109

98110
Alternatively, you can use the deploy button below:
99111

100-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fyourusername%2Fdevfolio)
112+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/charlyautomatiza/devfolio)
101113

102114
## Opening in StackBlitz
103115

104116
To open and edit this project in StackBlitz:
105117

106-
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/yourusername/devfolio)
118+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/charlyautomatiza/devfolio)
107119

108120
## Contributing
109121

@@ -115,4 +127,4 @@ This project is open source and available under the [MIT License](LICENSE).
115127

116128
## Credits
117129

118-
Created by CharlyAutomatiza with ❤️
130+
Created by [CharlyAutomatiza](https://charlyautomatiza.tech/) with ❤️

0 commit comments

Comments
 (0)