|
| 1 | +# PortalJS Frontend Starter |
| 2 | + |
| 3 | +<div align="center"> |
| 4 | + |
| 5 | +[](https://vercel.com/import/project?template=https://github.com/datopian/portaljs-frontend-starter) |
| 6 | + |
| 7 | +[](https://opensource.org/licenses/MIT) [](https://nextjs.org/) [](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 | +[](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