Skip to content

Commit 81276dc

Browse files
authored
Merge pull request #2049 from appwrite/add-portfolio-template-blog
Add blog on the personal portfolio site template
2 parents f0e8738 + 40ffe9a commit 81276dc

File tree

9 files changed

+118
-0
lines changed

9 files changed

+118
-0
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
layout: post
3+
title: Build and deploy a personal portfolio on Appwrite Sites
4+
description: Learn how to configure the Appwrite Sites portfolio template and deploy your changes via the GitHub integration.
5+
date: 2025-05-28
6+
cover: /images/blog/portfolio-template-sites/cover.png
7+
timeToRead: 7
8+
author: aditya-oberai
9+
category: tutorial
10+
featured: false
11+
callToAction: true
12+
---
13+
14+
Today, a personal portfolio website is no less than real estate on the internet for developers. It's your digital home address, where people can discover who you are, what you do, how they can contact you, and so much more in between. However, many of us don't have our portfolio websites ready despite their importance because, even with modern vibe coding tools, a clean and straightforward portfolio is much harder to design than expected.
15+
16+
That's why, as part of the Sites templates, Appwrite offers a portfolio template that you can deploy in just a few short steps.
17+
18+
# Overview of the portfolio template
19+
20+
The Appwrite portfolio template is a personal portfolio app for developers. Built with Next.js and styled with Tailwind CSS, it features several pages:
21+
22+
- Landing page with an about section and project listing
23+
- Individual project pages
24+
- Contact me page with an email form (currently just logs form data on the console)
25+
26+
![Deployed site](/images/blog/portfolio-template-sites/deployed.png)
27+
28+
# Deploy the portfolio template on Appwrite
29+
30+
Firstly, you must head to Appwrite Cloud and [create an account](https://cloud.appwrite.io/console/register) if you haven't already (or [self-host Appwrite 1.7](https://appwrite.io/docs/advanced/self-hosting)). Next, create your first project, which will lead you to the project overview page.
31+
32+
![Get started](/images/blog/portfolio-template-sites/get-started.png)
33+
34+
Head to the **Sites** page from the left sidebar, click on the **Create site** button, and select the **Clone a template** option. This will take you to the Appwrite Sites templates listing, where you should select **Portfolio** under the **Use case** category on the left sidebar. This will show you numerous templates, some developed by our team and some by our partners, from which you must click on the `Portfolio template` option.
35+
36+
![Site templates](/images/blog/portfolio-template-sites/templates.png)
37+
38+
After selecting the template, connect a GitHub repository now (you can do this later, too). Leave the production branch and root directory as is, update the domain name if you want, and click the **Deploy** button. You can watch the deployment logs as Appwrite builds your site.
39+
40+
![Deployment logs](/images/blog/portfolio-template-sites/deployment-logs.png)
41+
42+
After your site has been successfully deployed, Appwrite will show you a **Congratulations** page. You can view the site by clicking the **Visit site** button, or view the site configuration (deployments, logs, domains, usage, and settings) by clicking the **Go to dashboard** button.
43+
44+
![Congratulations](/images/blog/portfolio-template-sites/congrats.png)
45+
46+
# Making changes and deploying them to the site
47+
48+
To learn how to make changes in the portfolio site, let's update the contact form action to email you whenever someone submits a message. For this demo, we shall use Resend, a popular API service for sending emails.
49+
50+
First, create an account on [Resend](https://resend.com/), then go to the **API Keys** tab in the left sidebar to create a new API key. Save this API key for later usage.
51+
52+
![Resend API key](/images/blog/portfolio-template-sites/resend-api-key.png)
53+
54+
> Note: While this isn't mandatory for the demo, for production apps, you should add and verify a [domain](https://resend.com/docs/dashboard/domains/introduction) to send emails via Resend.
55+
56+
Next, you must update the environment variables of our Appwrite Site. Head back to your Appwrite project, visit **Sites** from the left sidebar, and click on your portfolio site. Head to the **Settings** tab of your site, scroll down to the **Environment variables** section, and create the following environment variables:
57+
58+
- `RESEND_API_KEY`: The Resend API key you created earlier
59+
- `EMAIL_ADDRESS`: The email address you want to receive contact form messages on
60+
61+
![Site environment variables](/images/blog/portfolio-template-sites/env-vars.png)
62+
63+
Lastly, clone the repository Appwrite created for your portfolio site. Enter the directory, and install Resend's Node.js library by running the following command:
64+
65+
```js
66+
npm install resend
67+
```
68+
69+
Then, head to the `src/actions/contact.ts` file and update it to the following:
70+
71+
```js
72+
'use server'
73+
import { Resend } from "resend"
74+
75+
export const submitContactForm = async (formData: FormData) => {
76+
try {
77+
const rawFormData = {
78+
name: formData.get('name'),
79+
email: formData.get('email'),
80+
subject: formData.get('subject'),
81+
message: formData.get('message'),
82+
}
83+
84+
console.log(rawFormData);
85+
86+
const resendApiKey = process.env.RESEND_API_KEY;
87+
const emailAddress = process.env.EMAIL_ADDRESS;
88+
if (!resendApiKey || !emailAddress) {
89+
throw new Error('Missing environment variables for Resend API key or email address');
90+
}
91+
92+
const resend = new Resend(resendApiKey);
93+
94+
await resend.emails.send({
95+
from: 'Acme <[email protected]>', // You can switch this out with an email of your domain once added to Resend
96+
to: [emailAddress],
97+
subject: `New message from ${rawFormData.name}`,
98+
text: `Name: ${rawFormData.name}\n\nEmail: ${rawFormData.email}\n\nSubject: ${rawFormData.subject}\n\nMessage: ${rawFormData.message}`
99+
});
100+
} catch (error) {
101+
console.error('Error sending email:', error);
102+
throw new Error('Failed to send contact form. Please try again later.');
103+
}
104+
}
105+
```
106+
107+
You can now commit these changes and push them to GitHub, automatically deploying the updated site to Appwrite.
108+
109+
# Next steps
110+
111+
And with that, the personal portfolio template is deployed to Appwrite Sites. You can explore other templates or deploy any other websites you'd like.
112+
113+
For more information about Appwrite Sites:
114+
115+
- [Appwrite Sites product docs](/docs/products/sites)
116+
- [Quick start to deploy web app](/docs/products/sites/quick-start)
117+
- [Deploy Appwrite Site templates](/docs/products/sites/templates)
118+
- [Appwrite Discord server](/discord)
211 KB
Loading
52.5 KB
Loading
104 KB
Loading
105 KB
Loading
139 KB
Loading
192 KB
Loading
113 KB
Loading
159 KB
Loading

0 commit comments

Comments
 (0)