Next + TypeScript Starter
A Next + TypeScript Starter by Justin Juno. Featuring Styled-Components, ESLint, Prettier, Axe a11y monitoring, Fathom analytics, sitemap generation, and more!
✅
Feature Overview.
-
Styled-Components
with global styles, a modern reset, and theme support. -
ESLint
+Prettier
setup for maintaining code quality and formatting. -
useAnalytics
hook for quickly enabling site analytics via Fathom. -
useAxe
hook for monitoring and reporting accessibility issues via Chrome console. - Custom
SEO
component based on Open Graph standards. - Custom
Link
component for handling both internal and external links. - Custom
404
page for invalid routes. - Automatic sitemap and robots.txt generation with
next-sitemap
.
🚀
Getting Started.
- Clone and/ or download the project locally.
- Navigate to the projects root directory and install its dependencies:
npm i
- Open
lib/metaFields
in your editor and update the default meta fields. Note: this is an important step, as these fields are referenced in theSEO
component,useAnalytics
hook, andnext-sitemap
. - Rename the
.env.sample
file to.env.local
and add your Fathom site id to theNEXT_PUBLIC_FATHOM_SITE_ID
environment variable. You’ll also need to add this environment variable to your project's deployment settings in Vercel (or wherever your project is hosted). Note: If you are not using Fathom analytics, you can delete thehooks/useAnalytics
file and remove its invocation from_app.tsx
. - You’re ready to code! Start your development environment
npm run dev
and build something awesome.
🔗
Documentation and Resources.
- Next - React framework for production.
- TypeScript - Strongly-typed programming language that builds on JavaScript.
- Styled-Components - CSS-in-JS styling solution.
- ESLint - Code analysis tool monitoring code and maintaining quality.
- Prettier - Opinionated code formatter.
- Axe-Core - Accessibility testing library.
- Next-Sitemap - Sitemap generator for Next.
- Fathom - Privacy first analytics.
🙇♂️
Credits.
- Josh W Comeau for his amazing css reset that I included in this project.
⭐️
Contributions.
Thanks for your interest in this project! Pull Requests are welcome for any level of improvement, from small typos to pesky bugs, let’s make this project better. When opening or responding to an issue, please be kind, patient, and open to feedback. Derogatory comments, insults, etc. aren't cool, nor tolerated.