This is the official website for Matlu ry, built with Next.js, TypeScript, and Strapi CMS.
- Features
- Getting Started
- Development
- Static Export
- Testing
- Environment Variables
- Image Optimization
- Event Request Flow
- Deployment
- License
- Next.js App Router (app/ directory)
- TypeScript throughout the codebase
- Static export (
output: "export"in next.config.ts) - Strapi CMS integration (REST and GraphQL)
- Multilingual support (Finnish and English)
- SCSS styling with custom variables and mixins
- Jest for unit testing
- SEO-friendly sitemap generation
- Node.js 20.9+
- npm 9+
npm installCreate a .env.local file in the project root:
SITE_URL=http://localhost:3000
STRAPI_URL=http://localhost:1337
Adjust these as needed for your environment.
Start the development server:
npm run dev- The site will be available at http://localhost:3000
- By default, images are loaded from the local Strapi instance (
localhost:1337). - To use production Strapi, update the
images.remotePatternsinnext.config.ts.
To generate a static export (for Netlify, GitHub Pages, etc):
npm run buildThe output will be in the out/ directory.
Run all tests:
npm test- Jest is used for unit testing (see
src/lib/__tests__) - TypeScript is fully supported in tests
SITE_URL: The base URL for sitemap and canonical linksSTRAPI_URL: The base URL for Strapi API (REST/GraphQL)
- Next.js image optimization is configured for both local and production Strapi uploads
- Update
next.config.tsto add your production Strapi URL when deploying
Public users can submit event additions from the events page. The flow is:
- Open the "Add event" dialog on
/eventsor/en/events. - Fill event details (name, times, titles, optional location text, optional link, optional descriptions).
- Optionally set exact location coordinates:
- Click on the embedded map picker (react-leaflet), or
- Enter latitude/longitude manually.
- Optionally use location autocomplete suggestions. Suggestions are fetched from Strapi endpoint:
GET /api/event-locations/suggestions- This list is a separate location index and only contains entries indexed from approved requests.
- Submit to:
POST /api/event-requests/submit
- After approval in CMS, the event appears in website listings.
- If approved event has coordinates, event cards can show a click-to-open map dialog (to avoid cluttering the main event list).
Notes:
- The website supports two location modes:
- Location text only
- Location text + coordinates
- Leaflet CSS is loaded in app layout for map rendering.
- Coordinates are optional and validated before submit.
- The site is designed for static hosting (current hosting donee in S3 bucket)
MIT