Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/prixladi/linky

Simple url shortener service with statistics for authenticated users
https://github.com/prixladi/linky

daisyui drizzle-orm nextjs postgresql react-server-components

Last synced: about 6 hours ago
JSON representation

Simple url shortener service with statistics for authenticated users

Awesome Lists containing this project

README

        

# Linky

Simple url shortener service with statistics for authenticated users.

## Development

1) Set up a instance of the PostgreSQL database. For example the [Vercel postgres](https://vercel.com/docs/storage/vercel-postgres) has a free tier.
2) Set up `.env.local` file:
- POSTGRES_URL=(PostgreSQL connection string)
- TOKEN_SECRET=(Secret for token signature)
3) Run:
```sh
pnpm install
pnpm dev
```

The application will start listening on port `3000`.

## Project Overview

The project is using classic Next.js app router structure with `src` folder. Pages are utilizing [Server components](https://nextjs.org/docs/app/building-your-application/rendering/server-components) and [Server actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations) whenever possible.

### Structure

- `/public` - Web root assets
- `/src` - Source code
- `./app` - Next.js app router root, following mandatory app router structure.
- Folders `./**/_components` include route scoped components.
- `./components` - Shared UI components
- `./server` - Server logic decoupled from Next.js frontend and backend
- `./db` - Db connection, client and models
- `./utils` - Server internal utils
- `./methods` - Front facing methods containing business logic
- `./lib`
- `./server` - Bindings to server logics (`/src/server/methods`)
- `./actions` - Next.js server actions
- `./middleware.ts` - Next.js middleware handling protected routes

## Application images

![Home](misc/assets/home.png)
![Dashboard](misc/assets/dashboard.png)