Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/diedemiguel/lists-server-actions

Exploring better design patterns in NextJS
https://github.com/diedemiguel/lists-server-actions

lists nextjs15 server server-functions usetransition

Last synced: 3 days ago
JSON representation

Exploring better design patterns in NextJS

Awesome Lists containing this project

README

        

# List + Server Actions NextJS 15

## Exploring best practices using NextJS 15, Server Functions and Server Components

### Main Features

- **Pagination**: Content is paginated to enhance user experience, allowing users to navigate through data efficiently.
- **Tailored "Next and Previous" Buttons**: Users can seamlessly navigate between paginated tables with buttons that are appropriately enabled or disabled based on the current page.
- **Search**: Users can search through the tabulated data while preserving pagination behavior, ensuring a smooth and intuitive search experience.
- **Loading States**: The `useTransition` hook is utilized to provide the best possible user experience by displaying loading states during data fetching and transitions.
- **Server-Side Rendering (SSR)**: The component architecture is designed to leverage SSR, providing an optimized and fast user experience by rendering content on the server.

### Installation:

- We'll use pnpm

```sh
pnpm install
```

- Setup your environment variables

```bash
cp .env.example .env.development.local
```

- Then, open the `.env.development.local` file and fill in the required environment variables.

- You'll need all the `POSTGRES_*` variables from the Vercel dashboard to access the Vercel Postgres API. The Vercel Postgres API is used to store the current backgrounds and their status.

- You can get all the Vercel variables by using the Vercel CLI by running `vercel link`

- Initialize your DB

```
psql "" -f src/db/schema.psql
```

- Run the development server

```
pnpm dev
```

You're all set : ) Happy Coding