AiAutoA is a branded, read-only media showcase built with Next.js 14 for a Nextcloud backend. It connects to a single Nextcloud folder over WebDAV, keeps credentials server-side, and presents files through a clean green SaaS interface rather than the native Nextcloud UI.
- Next.js 14 App Router
- TypeScript
- Tailwind CSS
- Server-side API routes
- WebDAV via
fetch+ Basic Auth
- Homepage with featured content and recent files
- Gallery page with responsive grid layout
- File detail pages with inline previews
- Support for images, videos, and documents
- Folder navigation from a scoped Nextcloud root
- Search across the configured library scope
- Server-side metadata and download proxy routes
- Loading, empty, and error states
Create .env.local from .env.example:
NEXTCLOUD_BASE_URL=https://nextcloud.example.com
NEXTCLOUD_USERNAME=your-username
NEXTCLOUD_APP_PASSWORD=your-app-password
NEXTCLOUD_ROOT_FOLDER=/AiAutoA/Public
ENABLE_SYSTEM_PAGE=false
AFFILIATE_URL=https://s.shopee.vn/4fs7jwXwtN- Install dependencies:
npm installOn Windows PowerShell with script restrictions, use:
cmd /c npm.cmd install- Create your local environment file:
copy .env.example .env.local-
Update
.env.localwith a valid Nextcloud base URL, username, app password, and root folder. -
Start the app:
npm run devOr on restricted PowerShell setups:
cmd /c npm.cmd run dev- Open
http://localhost:3000.
This project can be deployed to Render as a Web Service.
- Push this repo to GitHub.
- In Render, create a new
Web Servicefrom the repo. - Render can read render.yaml automatically, or use:
- Build Command:
npm install && npm run build - Start Command:
npm run start
- Build Command:
- Add these environment variables in Render:
NEXTCLOUD_BASE_URLNEXTCLOUD_USERNAMENEXTCLOUD_DAV_USERNEXTCLOUD_APP_PASSWORDNEXTCLOUD_ROOT_FOLDERAFFILIATE_URLENABLE_SYSTEM_PAGE
- The app is read-only by design.
- Admins manage files in Nextcloud only.
- The frontend never receives Nextcloud credentials.
- All WebDAV requests are executed on the server.
- The configured root folder acts as the app boundary.
AFFILIATE_URLis server-only and opens in a new tab at most once every 24 hours per browser when users download files.
GET /api/filesReturns the current folder listing, filters, and search results.GET /api/files/[...path]Returns metadata for a specific file.GET /api/download/[...path]Streams a file from Nextcloud to the browser.GET /api/thumb/[...path]Returns a lightweight poster thumbnail for non-image assets.GET /api/healthReturns sync health metadata when the system page is enabled.
.
|-- app
| |-- api
| | |-- download/[...path]/route.ts
| | `-- files
| | |-- [...path]/route.ts
| | `-- route.ts
| |-- files/[...path]/page.tsx
| |-- gallery/page.tsx
| |-- error.tsx
| |-- globals.css
| |-- layout.tsx
| |-- loading.tsx
| |-- not-found.tsx
| `-- page.tsx
|-- components
| |-- app-shell.tsx
| |-- breadcrumbs.tsx
| |-- empty-state.tsx
| |-- file-card.tsx
| |-- file-preview.tsx
| |-- hero-featured.tsx
| |-- loading-skeleton.tsx
| `-- search-form.tsx
|-- lib
| |-- nextcloud.ts
| |-- types.ts
| `-- utils.ts
|-- .env.example
|-- next.config.mjs
|-- package.json
|-- postcss.config.mjs
|-- tailwind.config.ts
`-- tsconfig.json
- WebDAV listing uses
PROPFINDand XML parsing on the server. - System files such as dotfiles and common desktop metadata are filtered out.
- File previews use the download proxy in inline mode.
- The optional
/systempage and/api/healthroute stay hidden unlessENABLE_SYSTEM_PAGE=true. - Search is scoped to the configured root folder and traverses nested folders with server-side limits to avoid runaway requests.