Getting Started
Welcome to your new portfolio starter template! This guide will walk you through the initial setup and customization process, helping you create a stunning portfolio website that showcases your work and skills using Astro and Sanity. Let’s GO 🚀
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js (version 16 or later)
- npm (usually comes with Node.js)
- Git (for version control)
- A code editor (we recommend Visual Studio Code)
- A Sanity account (free tier available)
- A Resend account for email notifications (free tier available)
Step 1: Project Setup
-
Extract the
.zip
file you received after purchase. -
Open the extracted folder in your preferred code editor (e.g., VS Code).
-
Open your terminal
ctrl + ~
and Install the project dependencies: -
Create a new Sanity project:
- Go to sanity.io and sign in or create a new account.
- Click on “Create new project” and follow the prompts to set up your Sanity studio.
- Copy the Project ID, as you’ll need it for configuration.
-
Set up environment variables:
- Rename
.env.example
to.env
- Replace the placeholder values with your Sanity credentials:
Note: leave
SANITY_DATASET
as it is. - Rename
-
Obtain a Sanity API token:
- Log in to your Sanity account and go to your project settings.
- Navigate to the “API” section.
- Click “Tokens,” and Click “Add API token.”
- Give your token a name (e.g., “Portfolio Token”) and select the appropriate permissions (usually “Read” and “write” access to all datasets, with access to project settings for developers).
- Click on save.
- Copy the generated token and paste it into your
.env
file as theSANITY_TOKEN
value.
-
Set up Resend for contact form emails:
- Sign up for a free account at resend.com
- Once logged in, navigate to the API Keys section
- Create a new API key and copy it
- Add it to your .env file as RESEND_API_KEY
- Add your email address where you want to receive notifications to NOTIFICATION_EMAIL
Step 2: Configuration
-
Navigate to
astro.config.mjs
and replace the projectId with your projectId -
Update
sanity.config.ts
with your Sanity projectId and you can change the title to the project name of your sanity studio: -
Update
sanity.cli.ts
with your Sanity projectId:
Step 3: Import Preconfigured Dataset
-
Run the following command in your terminal:
This will load the placeholder content into your Sanity project.
Step 5: Preview Your Site
-
Run the development server:
-
Open your browser and go to
http://localhost:3000
to see your site.
Step 5: Customize your site
Once you’ve started the development server, you can easily customize your portfolio directly from Sanity by 👇🏼
Opening a new tab on your browser and go to http://localhost:3000/admin
to see your studio.
You’ll see a pop up to add your link to cors
Click on the link and add the link to the cors
Then you will be prompted to sign in with your Sanity credentials.
Step 6: Building for Production
When you’re ready to deploy:
-
Build your site:
-
The output will be in the
dist/
folder, ready for deployment.
Troubleshooting Contact Form
If you’re experiencing issues with the contact form:
- Check your environment variables are correctly set
- Verify your Resend API key is valid
- Ensure your notification email is correctly formatted
- Check the browser console and server logs for any error messages
- Verify that your domain is properly configured in Resend (for production use)
Need Help?
If you encounter issues or need help, feel free to contact us:
- Email: lawrencestixx@gmail.com
- Community: Join our Telegram support group here.
Happy portfolio building!