- Project Overview
- Project Structure
- Prismic Configuration
- Content Types
- Slices
- Components
- Internationalization
- API Routes
- Assets and Public Files
- Project Setup & Development
- Deployment
This project is a Next.js application integrated with Prismic CMS. It appears to be a multi-lingual website with various content sections including hiring, fundraising, and general content pages. The project leverages Prismic's slicemachine for content modeling and management.
- Frontend Framework: Next.js (App Router)
- CMS: Prismic
- Styling: Tailwind CSS
- Language Support: Multi-language (English and German)
- UI Components: Custom components + Flowbite
The project follows a standard Next.js App Router structure with Prismic integration:
├── customtypes/ # Prismic content type definitions
├── docs/ # Project documentation
├── public/ # Static assets
├── src/
│ ├── actions/ # Server actions for form submissions
│ ├── app/ # Next.js app router pages
│ ├── components/ # Reusable UI components
│ ├── dictionaries/ # Language dictionaries
│ ├── hooks/ # Custom React hooks
│ ├── i18n/ # Internationalization configuration
│ ├── lib/ # Utility functions
│ ├── schemas/ # Schema definitions
│ ├── sections/ # Page sections components
│ ├── slices/ # Prismic slice components
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Helper utilities
The project uses Prismic as its headless CMS. Configuration is managed via:
slicemachine.config.json- Main Prismic configuration fileprismicio.ts- Prismic client setup and helper functionscustomtypes/- Content type definitions for Prismic
prismicio.ts: Sets up the Prismic client and defines helper functions for fetching contentmiddleware.ts: Handles Prismic preview sessions and language redirects
The project defines several custom types in the customtypes/ directory:
-
Navigation (
customtypes/navigation/):- Manages site navigation structure
- Configuration in
index.jsonwith mocks inmocks.json
-
Page (
customtypes/page/):- General content pages
- Flexible content using slices
-
Project (
customtypes/project/):- Project-specific content type
-
Settings (
customtypes/settings/):- Site-wide settings and configuration
The project contains a comprehensive set of slices for building page content. Each slice is defined in the src/slices/ directory and follows the structure:
SliceName/
├── index.tsx # Main component
├── model.json # Slice model definition
├── mocks.json # Mock data for slice
└── screenshot-*.png # Preview screenshots
-
Basic Content:
Text: Simple text contentImage: Image displayQuote: Quote displayDivider: Visual page dividerSEO: SEO metadata
-
Layout Components:
Hero: Hero sectionHeroSection: Alternative hero section with client componentsCallToAction: CTA blocksImageWithText: Combined image and text layoutsTextWithImage: Text with image (alternative layout)SectionBox: Boxed section container
-
Complex Components:
BoxesList: List displayed as boxesCompanyCarousel: Carousel of company logosCustomerLogos: Display of customer/partner logosFaq: FAQ accordionsQuestion: Q&A componentsProcessSection: Step-by-step process displayImageCards: Cards with images
-
Specialized Sections:
ChanceSection: Section about opportunitiesDiversitySection: Content about diversityFeedbackSection: User feedback displayTalentSection: Talent showcaseTalentsNumbers: Statistics about talents
The project has several reusable components in src/components/:
Bounded.tsx: Container with controlled width and paddingHeading.tsx: Typography component for headingsPrismicRichText.tsx: Renderer for Prismic Rich Text fieldsSEO.tsx: SEO meta tags componentLanguageDetector.tsx: Language detection and switchingdropdown/dropdown.tsx: Dropdown menu componentflowbite/init.tsx: Initialization for Flowbite components
The project organizes page sections in src/sections/, grouped by page type:
-
General:
carousel-section.tsx: General carousel componentheader-section.tsx: Main header componentheader-section-mobile.tsx: Mobile-specific headerlanguage-selector.tsx: Language switching component
-
Footer:
Footer/Footer.tsx: Main footer componentFooter/links.ts: Footer link definitions
-
Home:
home/alumni-section.tsx: Alumni showcasehome/female-accelerator-program.tsx: Female program highlightshome/sucess-story-section.tsx: Success stories display
-
Hiring:
hiring/company-carousel-section.tsx: Partner companies carouselhiring/diversity-section.tsx: Diversity initiativeshiring/faq-section.tsx: FAQ about hiringhiring/program-section.tsx: Program detailshiring/talents-section.tsx: Talent showcase
-
Fundraising:
fundraising/contact-section.tsx: Contact informationfundraising/partner-section.tsx: Partners displayfundraising/gift-card/: Gift card and donation related components
The project supports multiple languages through:
-
Language Configuration:
src/i18n/settings.ts: Language settings and configurationsrc/i18n/server.ts: Server-side internationalization utilities
-
Dictionaries:
src/dictionaries/en-us.json: English contentsrc/dictionaries/de.json: German content
-
Translations:
src/i18n/locales/en/translation.json: English translationssrc/i18n/locales/de/translation.json: German translations
-
Language Detection and Switching:
src/components/LanguageDetector.tsx: Language detectionsrc/actions/changeLanguage.tsx: Server action for language switching- Language is addressed in the middleware (
middleware.ts)
API routes are defined in src/app/api/:
-
Prismic Preview (
api/preview/route.ts):- Enables Prismic preview functionality
-
Exit Preview (
api/exit-preview/route.ts):- Exits Prismic preview mode
-
Revalidation (
api/revalidate/route.ts):- On-demand revalidation of pages
The project includes various static assets in the public/ directory:
-
Images:
- Homepage assets in
public/home/ - Logo files in
public/logos/ - Press materials in
public/press/
- Homepage assets in
-
Icons:
- Android icons in
public/android/ - iOS icons in
public/ios/ - Windows icons in
public/windows11/
- Android icons in
-
Fonts:
- Apercu font files in
public/fonts/
- Apercu font files in
-
PWA Support:
manifest.json: Progressive Web App manifestsw.js: Service workerworkbox-*.js: Workbox service worker library
The project uses Next.js Server Actions for form handling:
src/actions/saveAppointment.tsx: Handle appointment bookingssrc/actions/saveMessage.tsx: Save contact form messagessrc/actions/changeLanguage.tsx: Handle language switching
- Node.js (version specified in package.json)
- Yarn or NPM
- Prismic account with proper repository setup
# Install dependencies
yarn install
# Start development server
yarn dev
# Start Slice Machine (for Prismic content modeling)
yarn slicemachineCreate a .env.local file with the following variables:
NEXT_PUBLIC_PRISMIC_REPOSITORY_NAME=your-repository-name
PRISMIC_API_TOKEN=your-prismic-api-token
PRISMIC_ACCESS_TOKEN=your-prismic-access-token
The project appears to be set up for deployment with support for Progressive Web App features.
- Service worker setup in
src/service-worker/app-worker.ts - Manifest in
public/manifest.json - Various icon sizes for different platforms
# Build the project
yarn build
# Start production server
yarn startThis Prismic-based Next.js project provides a flexible, multi-language website with rich content management capabilities. The combination of Prismic's slicemachine for content modeling and Next.js for frontend rendering creates a powerful and maintainable web application.
For specific implementation details, refer to the individual component files and Prismic custom type definitions.