A comprehensive Nuxt 3 starter project that demonstrates different rendering strategies: Server-Side Rendering (SSR), Static Site Generation (SSG), and Incremental Static Regeneration (ISR).
- Multiple Rendering Strategies: Demonstrates SSR, SSG, and ISR with real-world examples
- Contentstack CMS Integration: Headless CMS for content management
- Modern UI: Beautiful, responsive design with Tailwind CSS
- TypeScript Support: Full TypeScript integration
- SEO Optimized: Meta tags, structured data, and performance optimizations
- Component Architecture: Reusable components and layouts
- File-based Routing: Intuitive routing based on file structure
kickstart-nuxt-Tim/
βββ components/ # Reusable Vue components
βββ composables/ # Nuxt composables (useGetPage.ts)
βββ layouts/ # Layout components (default.vue)
βββ pages/ # File-based routing
β βββ index.vue # Home page (SSR)
β βββ about.vue # About page (SSG)
β βββ contact.vue # Contact page (SSG)
β βββ products/ # Products section
β β βββ index.vue # Products page (SSR)
β βββ blog/ # Blog section
β βββ index.vue # Blog listing (ISR)
β βββ [slug].vue # Individual blog posts (ISR)
βββ plugins/ # Nuxt plugins (contentstack.ts)
βββ public/ # Static assets
βββ server/ # Server-side code
βββ types.ts # TypeScript type definitions
βββ nuxt.config.ts # Nuxt configuration
βββ package.json # Dependencies and scripts
- Pages: Home (
/), Products (/products) - Use Case: Dynamic content, real-time data
- Benefits: Fresh content, good SEO, server processing
- Example: Product catalog with real-time inventory and pricing
- Pages: About (
/about), Contact (/contact) - Use Case: Static content, marketing pages
- Benefits: Instant loading, excellent SEO, no server processing
- Example: Company information and contact details
- Pages: Blog listing (
/blog), Individual posts (/blog/[slug]) - Use Case: Content that changes occasionally
- Benefits: Fast loading with background updates
- Example: Blog posts that can be updated without rebuilding
- Nuxt 3: Vue.js framework with SSR/SSG support
- Vue 3: Progressive JavaScript framework
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
- Contentstack: Headless CMS
- Vue Router: Client-side routing
- Node.js 20.x or higher
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd kickstart-nuxt-Tim
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:NUXT_CONTENTSTACK_API_KEY=your_api_key NUXT_CONTENTSTACK_DELIVERY_TOKEN=your_delivery_token NUXT_CONTENTSTACK_ENVIRONMENT=your_environment NUXT_CONTENTSTACK_REGION=your_region
-
Run the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run generate- Generate static sitenpm run preview- Preview production build
- Create a new
.vuefile in thepages/directory - The file path determines the route (e.g.,
pages/services.vueβ/services) - Choose the appropriate rendering strategy for your content
- The project uses Tailwind CSS for styling
- Custom styles can be added in the
<style>section of components - Global styles are defined in
app.vue
- Content is managed through Contentstack CMS
- Use the
useGetPagecomposable to fetch content
export default defineNuxtConfig({
modules: ['@nuxtjs/tailwindcss'],
runtimeConfig: {
public: {
apiKey: process.env.NUXT_CONTENTSTACK_API_KEY,
deliveryToken: process.env.NUXT_CONTENTSTACK_DELIVERY_TOKEN,
// ... other config
},
},
})- SSR: Use
useAsyncDataoruseFetchin page components - SSG: Static content embedded in components
- ISR: Use
definePageMetawithrevalidateoption
- Lighthouse Score: 90+ across all metrics
- First Contentful Paint: < 1.5s
- Largest Contentful Paint: < 2.5s
- Cumulative Layout Shift: < 0.1
- Connect your repository to Launch.
- The build commands, output directory and server commands get auto-populated.
- Set build command:
npm run build - Set output directory:
./.output - Set server command:
npm run start
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Nuxt 3 - The Vue.js framework
- Contentstack - Headless CMS
- Tailwind CSS - CSS framework
- Vue.js - Progressive JavaScript framework
For support and questions:
- π§ Email: hello@nuxtstarter.com
- π Issues: GitHub Issues
- π Documentation: Nuxt 3 Docs
Built with β€οΈ using Nuxt 3 and Contentstack