This repository contains the main sources and components of our company website (adfinis.com).
This is a full-stack web application built with:
- Frontend: Next.js 14 (React framework)
- Backend: Strapi 5 (Headless CMS)
- Database: PostgreSQL
-
Node.js: This project uses two different Node.js versions
- Next.js: Node.js v20.17.0
- Strapi: Node.js v22.11.0
-
Node Version Manager (nvm): Recommended for managing multiple Node.js versions
# Install nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash # Restart your terminal or source your profile source ~/.bashrc # or ~/.zshrc if using zsh
-
Docker: Recommended for PostgreSQL database
Fedora / RHEL / CentOS
sudo dnf install docker docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker $USERUbuntu / Debian
sudo apt update
sudo apt install docker.io docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
# Log out and back in for group changes to take effectArch Linux / Manjaro
sudo pacman -Syu docker docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
# Log out and back in, or run `newgrp docker` to apply group changesStart the PostgreSQL database container:
docker run -d \
-p 5432:5432 \
--name adfinis-website-postgres \
-e POSTGRES_DB=postgres \
-e POSTGRES_PASSWORD=supersecret \
postgresNavigate to the Strapi directory and set up the backend:
cd strapi
# Use the correct Node.js version
nvm use
# Install dependencies
npm install
# Start Strapi in development mode
npm run developStrapi will be available at: http://localhost:1337
-
Create Admin Account: When you first access http://localhost:1337/admin, create your admin account
-
Configure Locales:
- Go to Settings → Internationalization
- Add these locales (remove any others):
en(English)en-au(English Australia)nl(Dutch)de-ch(German Switzerland)de-de(German Germany)
-
Create Collection Types: Create the following collection types in Content-Types Builder:
footerhomepagenavigation-menuheroes(or multiple hero types as needed)
For each collection type, make sure to:
- Enable localization in the advanced settings
- Configure appropriate fields based on your content needs
-
Set Collection Permissions: Navigate to Settings → Users & Permissions plugin → Roles → Public
For each collection type (
footer,homepage,navigation-menu,heroes, etc, etc), enable:findpermission (to retrieve multiple entries)findOnepermission (to retrieve single entries)
This allows the Next.js frontend to fetch content from these collections via the Strapi API.
Open a new terminal and navigate to the Next.js directory:
cd nextjs
# Use the correct Node.js version
nvm use
# Install dependencies
npm install
# Start the development server
npm run devNext.js will be available at: http://localhost:3000
Make sure to configure the appropriate environment variables in both applications:
- Strapi: Check
.env.examplein thestrapi/directory - Next.js: Check
.env.localor.envin thenextjs/directory
npm run develop # Start development server
npm run start # Start production server
npm run build # Build for productionnpm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintThis project follows a headless CMS architecture:
- Strapi serves as the content management system and API backend
- Next.js consumes the Strapi API to render the frontend
- PostgreSQL stores all content and configuration data
- Content is managed through Strapi's admin interface and delivered via API to the Next.js frontend
- Port conflicts: Make sure ports 1337 (Strapi) and 3000 (Next.js) are available
- Node version mismatch: Always use
nvm usein each directory to ensure correct Node.js versions - Database connection: Ensure PostgreSQL container is running:
docker ps - Missing locales: Frontend only supports the 5 specified locales; others will cause issues
# Stop the database
docker stop adfinis-website-postgres
# Start the database
docker start adfinis-website-postgres
# Remove the database (warning: this will delete all data)
docker rm adfinis-website-postgres...