Skip to content

Commit 1a0799b

Browse files
authored
Initial commit
0 parents  commit 1a0799b

File tree

167 files changed

+32886
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+32886
-0
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Accessibility CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
accessibility:
10+
runs-on: ubuntu-latest
11+
env:
12+
BASE_URL: http://localhost:3000
13+
NEXT_PUBLIC_DMS: https://api.cloud.portaljs.com/@datopian
14+
15+
steps:
16+
- name: 🧩 Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: ⚙️ Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '22'
23+
cache: 'npm'
24+
25+
- name: 📦 Install dependencies
26+
run: npm ci
27+
28+
- name: 🧱 Build Next.js app
29+
run: npm run build
30+
31+
- name: 🗺️ Generate routes manifest
32+
run: npm run generate:routes
33+
34+
- name: 🎭 Install Playwright browsers
35+
run: npx playwright install --with-deps
36+
37+
- name: 🚀 Run accessibility tests (Playwright + Pa11y + Lighthouse)
38+
run: |
39+
npm i -D start-server-and-test
40+
npx start-server-and-test 'npm run start' $BASE_URL \
41+
'npx playwright test && npm run test:pa11y && npm run test:lhci'
42+
43+
- name: 📤 Upload Playwright report
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: playwright-report
48+
path: playwright-report
49+
if-no-files-found: ignore
50+
51+
- name: 📤 Upload Pa11y report
52+
if: always()
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: pa11y-report
56+
path: pa11y-report.ndjson
57+
if-no-files-found: ignore
58+
59+
- name: 📤 Upload Lighthouse report
60+
if: always()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: lhci-report
64+
path: lhci-report
65+
if-no-files-found: ignore

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env*.local
29+
.env
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

.lighthouserc.base.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"ci": {
3+
"assert": {
4+
"assertions": {
5+
"categories:accessibility": ["error", { "minScore": 0.95 }]
6+
}
7+
},
8+
"upload": {
9+
"target": "filesystem",
10+
"outputDir": "./lhci-report"
11+
}
12+
}
13+
}

.pa11yci.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"defaults": {
3+
"standard": "WCAG2AA",
4+
"timeout": 60000,
5+
"wait": 1000,
6+
"level": "error",
7+
"chromeLaunchConfig": {
8+
"args": ["--no-sandbox", "--disable-setuid-sandbox"]
9+
}
10+
},
11+
"urls": []
12+
}

README.md

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# PortalJS Frontend Starter
2+
3+
<div align="center">
4+
5+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/datopian/portaljs-frontend-starter)
6+
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Next.js 13+](https://img.shields.io/badge/Next.js-13%2B-black?logo=next.js&logoColor=white)](https://nextjs.org/) [![GitHub Stars](https://img.shields.io/github/stars/datopian/portaljs?style=social)](https://github.com/datopian/portaljs/stargazers)
8+
9+
**A modern, customizable frontend template for building high-performance CKAN-based data portals**
10+
11+
Powered by **[Next.js](https://nextjs.org)**, **[React](https://react.dev/)**, and **[Tailwind CSS](https://tailwindcss.com/)**
12+
13+
**[🚀 Live Demo](https://demo.portaljs.com/)[📖 Documentation](https://portaljs.com/docs)[☁️ PortalJS Cloud](https://cloud.portaljs.com/)[🌐 Website](https://portaljs.com/)**
14+
15+
</div>
16+
17+
---
18+
19+
## Overview
20+
21+
This is the official frontend template used by [PortalJS Cloud](https://cloud.portaljs.com) — a fully managed data portal service built on top of CKAN and Next.js.
22+
23+
Use it to:
24+
25+
- Build decoupled CKAN frontends with modern tools (Next.js, React, TailwindCSS)
26+
- Customize dataset views, branding, and layouts
27+
- Deploy on Vercel, Netlify, Cloudflare Pages or your own infra
28+
29+
## ✨ Features
30+
31+
- **Modern UI** - Clean, responsive design with Tailwind CSS
32+
- **High Performance** - Built on Next.js 13+ with SSR/SSG
33+
- **CKAN Integration** - Seamless data fetching via @portaljs/ckan
34+
- **TypeScript** - Full type safety and better DX
35+
- **Easy Customizatio**n - Simple theme system and component styling
36+
- **Mobile-First** - Responsive design for all devices
37+
- **Deploy Ready** - One-click deployment to Vercel
38+
39+
## Getting started
40+
41+
### Option 1: PortalJS Cloud
42+
43+
PortalJS Cloud uses this template for creating new portals. If you want to quickly get started for free, follow the steps:
44+
45+
1. **Sign up** at <https://cloud.portaljs.com>
46+
2. **Create portal** → PortalJS Cloud will auto-generate a GitHub repository for your portal (based on this template) and deploy it automatically
47+
3. Find the repo link in your PortalJS Cloud dashboard
48+
4. **Customize** your portal via pull requests — or let us take care of it by reaching out at portaljs@datopian.com
49+
50+
### Option 2: Self-Hosted / Standalone
51+
52+
> [!note]
53+
> In standalone mode, you are going to need your own dedicated CKAN instance.
54+
55+
In order to use this repository in standalone mode (i.e. without PortalJS Cloud), click on the "Use this template" button on the top right corner to replicate this code to a new repo.
56+
57+
Then, you can start customizing it locally by following the development instructions bellow, and/or deploy it somewhere such as on Vercel.
58+
59+
### Development
60+
61+
1) Clone this repository
62+
63+
2) Install the dependencies with `npm i`
64+
65+
3) Create a new `.env` file with:
66+
67+
```bash
68+
# This is the URL of the CKAN instance. Use the example value if you are using PortalJS Cloud.
69+
NEXT_PUBLIC_DMS=https://api.cloud.portaljs.com/@my-portal-main-org-name
70+
71+
# Optional Queryless AI assistant integration
72+
# Set to true to display the floating AI button + right drawer chat
73+
NEXT_PUBLIC_QUERYLESS_ENABLED=false
74+
75+
# Optional internal API route path used by the chat widget
76+
NEXT_PUBLIC_QUERYLESS_API_ROUTE=/api/queryless-chat
77+
78+
# Server-side Queryless API config (keep these non-public)
79+
QUERYLESS_URL=
80+
QUERYLESS_TOKEN=
81+
QUERYLESS_MODEL=agent:your-agent-id
82+
```
83+
84+
4) Run `npm run dev` to start the development server
85+
86+
5) Access `http://localhost:3000` in your browser
87+
88+
## Customization
89+
90+
This template was developed with Next.js/React and TailwindCSS.
91+
92+
In order to learn more about how it can be customized, check the following documentations:
93+
94+
- https://react.dev/
95+
- https://nextjs.org/docs
96+
- https://v3.tailwindcss.com/docs/installation
97+
98+
### Quick Customizations
99+
100+
#### Logo Customization
101+
102+
```tsx
103+
// components/_shared/PortalDefaultLogo.tsx
104+
export default function PortalDefaultLogo() {
105+
return (
106+
<Link href="/">
107+
<img src="/your-logo.png" alt="Your Portal" height={55} />
108+
</Link>
109+
);
110+
}
111+
```
112+
113+
#### Footer Links
114+
115+
```tsx
116+
// components/_shared/Footer.tsx - Update navigation object
117+
const navigation = {
118+
about: [
119+
{ name: "About Us", href: "/about" },
120+
{ name: "Contact", href: "/contact" },
121+
],
122+
useful: [
123+
{ name: "Datasets", href: "/search" },
124+
{ name: "Organizations", href: "/organizations" },
125+
],
126+
social: [
127+
{ name: "twitter", href: "https://twitter.com/yourhandle" },
128+
{ name: "email", href: "mailto:contact@yoursite.com" },
129+
],
130+
};
131+
```
132+
133+
#### Homepage Content
134+
135+
```tsx
136+
// pages/index.tsx - Update title and description
137+
<Head>
138+
<title>Your Portal Name</title>
139+
<meta name="description" content="Your portal description" />
140+
</Head>
141+
```
142+
143+
##### Dataset Search
144+
145+
```tsx
146+
// lib/queries/dataset.ts - Add custom facet fields
147+
const facetFields = [
148+
"groups",
149+
"organization",
150+
"res_format",
151+
"tags", // Enable tags
152+
"license_id", // Add license filtering
153+
]
154+
```
155+
156+
#### Theme Components
157+
158+
```tsx
159+
// themes/default/index.tsx - Replace with custom components
160+
const DefaultTheme = {
161+
header: CustomHeader,
162+
footer: CustomFooter,
163+
layout: DefaultThemeLayout,
164+
};
165+
```
166+
167+
---
168+
169+
## Tech Stack
170+
171+
- **Framework:** [Next.js 13+](https://nextjs.org/) with TypeScript
172+
- **Styling:** [Tailwind CSS](https://tailwindcss.com/)
173+
- **Data:** [CKAN API](https://docs.ckan.org/en/2.10/api/) via [@portaljs/ckan](https://www.npmjs.com/package/@portaljs/ckan)
174+
- **Deployment:** [Vercel](https://vercel.com/)
175+
176+
## Deployment
177+
178+
### Vercel (Recommended)
179+
180+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fdatopian%2Fportaljs-frontend-starter&env=NEXT_PUBLIC_DMS&envDescription=DMS%20endpoint%2C%20e.g.%2C%20a%20CKAN%20instance%20URL.%20For%20testing%20purposes%2C%20you%20can%20use%20https%3A%2F%2Fapi.cloud.portaljs.com%2F&project-name=my-portaljs-app&repository-name=my-portaljs-app)
181+
182+
1. Push your repo to GitHub
183+
2. Connect it on [vercel.com](https://vercel.com/)
184+
3. Add environment variables
185+
4. Deploy! 🎉
186+
187+
#### Other Platforms
188+
189+
This template works on:
190+
- **Netlify** - Connect your GitHub repo
191+
- **Cloudflare Pages** - Import from Git
192+
- **Your server** - `npm run build && npm start`
193+
194+
## Contributing
195+
196+
We welcome contributions! Here's how to get started:
197+
198+
1. **Fork** this repository
199+
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
200+
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
201+
4. **Push** to the branch (`git push origin feature/amazing-feature`)
202+
5. **Open** a Pull Request
203+
204+
## 📄 License
205+
206+
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT).
207+
208+
## Need help or advanced features?
209+
210+
This template covers basic portal functionality. For complex customizations, integrations, or enterprise features, [contact our team](mailto:portaljs@datopian.com) for professional services.
211+
212+
- **Custom Design** - Tailored branding and UI/UX
213+
- **Advanced Features** - Custom integrations and functionality
214+
- **Enterprise Support** - Dedicated support and SLA
215+
- **Migration** - Help moving from existing portals
216+
217+
---
218+
219+
<div align="center">
220+
221+
**Built with ❤️ by [Datopian](https://datopian.com/)**
222+
223+
Let’s build better data portals together 🚀
224+
225+
**⭐️ [Star PortalJS](https://github.com/datopian/portaljs)[🐦 Follow us](https://www.linkedin.com/company/10340373)[💬 Contact](mailto:portaljs@datopian.com)**
226+
227+
**[📚 Docs](https://portaljs.com/docs)[ 🐛 Report a bug or suggest an idea](https://github.com/datopian/portaljs/issues)**
228+
229+
</div>

0 commit comments

Comments
 (0)