https://github.com/tencentedgeone/koa-template
A demonstration website for function requests developed with Next.js + Tailwind CSS + shadcn/ui technology stack, showcasing how to deploy and run Node Functions based on the Koa framework on EdgeOne Pages.
https://github.com/tencentedgeone/koa-template
Last synced: 10 months ago
JSON representation
A demonstration website for function requests developed with Next.js + Tailwind CSS + shadcn/ui technology stack, showcasing how to deploy and run Node Functions based on the Koa framework on EdgeOne Pages.
- Host: GitHub
- URL: https://github.com/tencentedgeone/koa-template
- Owner: TencentEdgeOne
- License: mit
- Created: 2025-08-22T03:09:54.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-22T09:12:50.000Z (10 months ago)
- Last Synced: 2025-08-22T11:30:28.762Z (10 months ago)
- Language: TypeScript
- Size: 177 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node Functions on EdgeOne Pages - Koa Demo Website
A demonstration website for function requests developed with Next.js + Tailwind CSS + shadcn/ui technology stack, showcasing how to deploy and run Node Functions based on the Koa framework on EdgeOne Pages.
## π Features
- **Modern UI Design**οΌAdopting a black background with white text theme, using #1c66e5 as the accent color
- **Responsive Layout**οΌSupporting desktop and mobile devices, providing the best user experience
- **Real-time API Demo**οΌIntegrating Express backend, supporting real-time function call testing
- **Componentized Architecture**οΌUsing shadcn/ui style component system
- **TypeScript Support**οΌComplete type definitions and type safety
## π οΈ Technology Stack
### Frontend
- **Next.js 15** - React full-stack framework
- **React 19** - User interface library
- **TypeScript** - Type-safe JavaScript
- **Tailwind CSS 4** - Utility-first CSS framework
### UI Components
- **shadcn/ui** - High-quality React components
- **Lucide React** - Beautiful icon library
- **class-variance-authority** - Component style variant management
- **clsx & tailwind-merge** - CSS class name merging tool
### Backend
- **Express.js** - Node.js Web application framework
- **Node Functions** - EdgeOne Pages serverless function
## π Project Structure
```
express-template/
βββ src/
β βββ app/ # Next.js App Router
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main page
β βββ components/ # React components
β β βββ ui/ # UI basic components
β β βββ button.tsx # Button component
β β βββ card.tsx # Card component
β βββ lib/ # Utility functions
β βββ utils.ts # General utilities
βββ public/ # Static resources
βββ package.json # Project configuration
βββ README.md # Project documentation
```
## π Quick Start
### Environment Requirements
- Node.js 18+
- npm or yarn
### Install Dependencies
```bash
npm install
# or
yarn install
```
### Development Mode
```bash
edgeone pages dev
```
Access [http://localhost:8088](http://localhost:8088) to view the application.
### Build Production Version
```bash
edgeone pages build
```
## π― Core Features
### 1. Main Page Display
- Project title and description
- One-click deployment and documentation view button
- Express code example display
### 2. API Call Demo
- Real-time function call testing
- Loading status display
- Result display
### 3. Responsive Design
- Mobile-friendly layout
- Adaptive component sizing
- Touch-friendly interaction
## π§ Configuration Explanation
### Tailwind CSS Configuration
The project uses Tailwind CSS 4, supporting custom color variables:
```css
:root {
--primary: #1c66e5; /* Primary color */
--background: #000000; /* Background color */
--foreground: #ffffff; /* Foreground color */
}
```
### Component Style
Using `class-variance-authority` to manage component style variants, supporting multiple preset styles.
## π Documentation Entry
- **EdgeOne Pages Official Documentation**οΌ[https://docs.edgeone.com](https://docs.edgeone.com)
- **Next.js Documentation**οΌ[https://nextjs.org/docs](https://nextjs.org/docs)
- **Tailwind CSS Documentation**οΌ[https://tailwindcss.com/docs](https://tailwindcss.com/docs)
- **Express.js Documentation**οΌ[https://expressjs.com](https://expressjs.com)
## π Deployment Guide
### EdgeOne Pages Deployment
1. Push the code to a GitHub repository
2. Create a new project in the EdgeOne Pages console
3. Select the GitHub repository as the source
4. Configure the build command: `npm run build`
5. Configure the output directory: `.next`
6. Deploy the project
### Node Functions Configuration
Create a `node-functions/` folder in the project root directory, adding an Express application:
```javascript
// node-functions/express/[[default]].js
import express from "express";
const app = express();
app.get("/", (req, res) => {
res.json({ message: "Hello from Express on Node Functions!" });
});
export default app;
```
## Deployment
[](https://edgeone.ai/pages/new?from=github&template=koa-template)
## π License
This project uses the MIT License - see the [LICENSE](LICENSE) file for details.