https://github.com/nexveridian/next-url-shortener
A URL shortener using Next.js 14 server actions, Postgres or SurrealDB, Shadcn/ui, and Tailwind.
https://github.com/nexveridian/next-url-shortener
nextjs nextjs14 postgres postgresql surrealdb url-shortener
Last synced: 2 months ago
JSON representation
A URL shortener using Next.js 14 server actions, Postgres or SurrealDB, Shadcn/ui, and Tailwind.
- Host: GitHub
- URL: https://github.com/nexveridian/next-url-shortener
- Owner: NexVeridian
- License: apache-2.0
- Created: 2024-02-15T20:34:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-07T05:53:09.000Z (9 months ago)
- Last Synced: 2024-08-08T08:53:07.531Z (9 months ago)
- Topics: nextjs, nextjs14, postgres, postgresql, surrealdb, url-shortener
- Language: TypeScript
- Homepage: https://s.nexv.dev/
- Size: 557 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-Apache
Awesome Lists containing this project
README
# next-url-shortener
A URL shortener using [Next.js](https://nextjs.org/) 14 server actions, [Postgres](https://www.postgresql.org/) or [SurrealDB](https://surrealdb.com/), [Shadcn/ui](http://ui.shadcn.com/) and [Tailwind](https://tailwindcss.com/).# Install
### Copy one
- [docker-compose-postgres.yml](./docker-compose-postgres.yml)
- [docker-compose-surrealdb.yml](./docker-compose-surrealdb.yml)Create data folder next to docker-compose.yml and .env, and set the data type in .env
```
├── data
│ ├── postgres
│ └── surrealdb
├── Makefile
├── docker-compose-postgres.yml
└── .env
```
### Then run:
- `make up-postgres`
- `make up-surrealdb`### Then exit with:
- `make down-postgres`
- `make down-surrealdb`## Example .env
```shell
# postgres or surrealdb
DB_TYPE=postgres# For surrealdb: If using docker surrealdb:8000, if not use 0.0.0.0:8000
# For postgres: If using docker postgres:5432, if not use 0.0.0.0:5432
DB_URL_PORT=postgres:5432# postgres
POSTGRES_USER=root
POSTGRES_PASSWORD=root
POSTGRES_DB=url# surrealdb
DB_USER=root
DB_PASSWORD=root# Enter your website url here
# OVERRIDE_URL=s.nexv.dev
```# License
All code in this repository is dual-licensed under either [License-MIT](./LICENSE-MIT) or [LICENSE-APACHE](./LICENSE-Apache) at your option. This means you can select the license you prefer. [Why dual license](https://github.com/bevyengine/bevy/issues/2373)