Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/prixladi/linky
- Owner: prixladi
- Created: 2024-04-26T19:24:08.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-12T16:31:50.000Z (6 months ago)
- Last Synced: 2024-08-09T16:28:54.070Z (3 months ago)
- Topics: daisyui, drizzle-orm, nextjs, postgresql, react-server-components
- Language: TypeScript
- Homepage:
- Size: 664 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)