Skip to content

About

The sample portfolio with Next.js and Sanity

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ OkDo's Portfolio

A personal portfolio built with Next.js 16 and Sanity CMS β€” live at ver41.com

Next.js React TypeScript Tailwind CSS Sanity pnpm License: MIT


πŸ“Έ Screenshot

Portfolio Preview


✨ Features

  • 🎬 Animated hero: the name rises word by word, the text fades in from a blur, the social links pop in one after another, and the portrait floats inside a turning gradient ring and leans toward the mouse. Everything honours prefers-reduced-motion.
  • 🎠 Recent projects carousel on the home page: newest first, three at a time, a new set every five seconds. It holds still while hovered, focused or off screen, has prev / pause / next buttons, and never turns by itself for visitors who ask for reduced motion.
  • πŸ—‚οΈ Projects: /projects lists every project newest first. Each project page has a screenshot slider (swipe, arrows, ← β†’ keys, thumbnails, captions), a rich-text write-up and related projects.
  • 🧩 Tech stacks: projects grouped by technology, with a page per stack at /tech-stacks/[slug].
  • βœ‰οΈ Contact form: messages are saved as message documents in Sanity through /api/contact.
  • πŸ—„οΈ Embedded Sanity Studio at /studio.
  • πŸ” SEO: per-page metadata, Open Graph and Twitter cards, JSON-LD, sitemap.xml, robots.txt and a web manifest.
  • πŸŒ— Dark mode with next-themes, and πŸ“Š Vercel Analytics.

πŸ› οΈ Tech Stack

Area Packages
Framework Next.js 16.4.6 (App Router, Turbopack), React 19.3
Language TypeScript 5.9
Styling Tailwind CSS 3.4 with the typography and forms plugins
UI @headlessui/react 2.2, next-themes 0.4
CMS Sanity 5.31, next-sanity 12.4, @sanity/image-url 2.2
Content @portabletext/react 6.2, date-fns 4.4
Analytics @vercel/analytics 1.6
Package manager pnpm 12.23.0

πŸ“ Project Structure

my-portfolio/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (site)/                  # The public site
β”‚   β”‚   β”œβ”€β”€ components/          # Hero portrait, projects carousel, project gallery, cards, nav…
β”‚   β”‚   β”œβ”€β”€ projects/            # /projects and /projects/[slug]
β”‚   β”‚   β”œβ”€β”€ tech-stacks/         # /tech-stacks and /tech-stacks/[slug]
β”‚   β”‚   β”œβ”€β”€ contact/             # Contact page
β”‚   β”‚   β”œβ”€β”€ admin/               # Link to the Studio
β”‚   β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”‚   └── page.tsx             # Home page
β”‚   β”œβ”€β”€ (studio)/studio/[[...index]]/  # Embedded Sanity Studio
β”‚   β”œβ”€β”€ api/contact/route.ts     # Saves contact messages to Sanity
β”‚   β”œβ”€β”€ schemas/                 # Sanity schemas: profile, project, category, message
β”‚   β”œβ”€β”€ types/                   # Shared TypeScript types
β”‚   β”œβ”€β”€ utils/                   # Sanity client, image URLs, Portable Text components, constants
β”‚   β”œβ”€β”€ layout.tsx               # Root layout (fonts, theme, analytics)
β”‚   β”œβ”€β”€ globals.css
β”‚   β”œβ”€β”€ sitemap.ts, robots.ts, manifest.ts
β”‚   └── not-found.tsx
β”œβ”€β”€ public/                      # Static images and social icons
β”œβ”€β”€ sanity-project/              # Standalone Studio (older schemas, see below)
β”œβ”€β”€ sanity.config.ts             # Config of the embedded Studio
β”œβ”€β”€ sanity.types.ts              # Generated Sanity types (`pnpm typegen`)
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ tailwind.config.ts           # Theme, colours and animations
β”œβ”€β”€ pnpm-workspace.yaml          # pnpm settings: allowed build scripts, dependency overrides
β”œβ”€β”€ vercel.json                  # Vercel install and build commands
└── package.json

πŸš€ Getting Started

Prerequisites

  • Node.js 20.9 or newer (22 LTS recommended)
  • pnpm 12.23.0 β€” pinned in package.json. With Corepack enabled (corepack enable) the pinned version runs automatically. pnpm 10 and older cannot read this lockfile.
  • A Sanity project (sanity.io, free)

Setup

  1. Clone and install

    git clone https://github.com/OthyTenk/my-portfolio.git
    cd my-portfolio
    pnpm install
  2. Configure the environment

    cp .env.example .env.local
    Variable Purpose
    NEXT_PUBLIC_SANITY_PROJECT_ID Sanity project ID
    NEXT_PUBLIC_SANITY_DATASET Dataset, e.g. production
    NEXT_PUBLIC_SANITY_API_VERSION API version date, e.g. 2026-01-17
    SANITY_API_TOKEN A token with write access; only the contact form uses it. Keep it out of the repo.
  3. Allow the Studio's origin in Sanity

    In sanity.io/manage β†’ your project β†’ API β†’ CORS origins, add http://localhost:3000 (and later your production URL) with credentials allowed. Without it /studio asks you to register the studio instead of loading.

  4. Run it

    pnpm dev

Scripts

Command What it does
pnpm dev Development server
pnpm build Production build
pnpm start Serve the production build
pnpm typegen Regenerate sanity.types.ts from the schemas
pnpm lint Currently broken: Next.js 16 removed next lint, and .eslintrc.json predates ESLint 9's flat config. Use tsc --noEmit.

πŸ“ Content Model

Everything on the site is edited in the Studio:

  • Profile β€” name, headline, bio (Portable Text), photo, email and social links. The home page uses the first profile.
  • Project β€” title, slug, short overview, description (Portable Text with images), main image, gallery (extra screenshots with alt text and a caption, shown in the slider after the main image), live link, tech-stack categories and date (sorts the lists, newest first).
  • Category β€” a technology, optionally under a parent group (e.g. React.js under Framework & library), with an icon.
  • Message β€” written by the contact form.

sanity-project/ holds a standalone Studio with an older copy of the schemas (no project description or gallery). The embedded Studio at /studio uses app/schemas and is the one to edit content with.


🎨 Customization

  • Colours, fonts and animations: tailwind.config.ts. The hero and carousel animations (reveal-up, blur-in, pop-in, portrait-in, float, drift, spin-slow, shine, slide-in-left/right) are defined there.
  • Global styles and dark mode: app/globals.css and the dark: variants in components.
  • Site URL used in metadata and the sitemap: app/utils/constants.ts.

πŸ”’ Dependencies & Security

  • pnpm audit reports no known vulnerabilities.
  • pnpm-workspace.yaml holds the dependency overrides that patch vulnerable packages pinned deep in Sanity's CLI, styled-components and the Tailwind typography plugin; each one has a comment saying why. (pnpm 11+ no longer reads the pnpm field of package.json.)
  • pnpm 12's supply-chain defaults are on: a package version published less than a day ago is not installed, and dependency build scripts only run when listed under allowBuilds.

🚒 Deployment

The site is deployed on Vercel.

  1. Import the repository in Vercel. Next.js is detected automatically.
  2. Add the four environment variables above to the Vercel project.
  3. Add the production URL to the Sanity project's CORS origins (with credentials) so /studio works there.

vercel.json runs the install and build with pnpm 12.23.0 via npx, because the pnpm bundled with Vercel's build image cannot read a pnpm 12 lockfile. When you change packageManager in package.json, change the version in vercel.json too.


🀝 Contributing

  1. Fork the repository
  2. Create a branch (git checkout -b feat/amazing-feature)
  3. Commit your changes
  4. Push the branch and open a pull request

See CONTRIBUTING.md and the Code of Conduct.


πŸ“„ License

MIT β€” see LICENSE.


πŸ‘¨β€πŸ’» Author

OkDo β€” GitHub @OthyTenk Β· ver41.com

Questions or problems: open an issue. Security reports: see SECURITY.md.

About

The sample portfolio with Next.js and Sanity

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages