Skip to content

Commit

Permalink
update: added instructions for developming locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza12700 committed Sep 13, 2024
1 parent 13520b7 commit 85e1226
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Shawty

**Shawty** is a URL shortener built using [Golang](https://go.dev) and
[Turso](https://turso.tech). It provides a simple interface for shortening
URLs, tracking their usage, and offering statistics about shortened URLs.
**Shawty** is a URL shortener built using [Golang](https://go.dev),
[Turso](https://turso.tech) and [HTMX](https://htmx.org). It provides a simple
web interface for shortening URLs, tracking their usage, and offering
statistics about shortened URLs.

## Features
- **Web UI with Golang's** `html/template`:
A minimalistic web interface built using Golang's standard `html/template`
package and [Tailwind](https://tailwindcss.com).

- **URL Click Statistics**:
Keep track of how many times each shortened URL is accessed.

Expand All @@ -23,24 +28,40 @@ Checks if the URL is a valid URL schema. It only allows `http://` and
### Installation and Setup

1. **Clone the repository**:
```
```bash
git clone https://github.com/wavly/shawty.git
cd shawty
```
2. **Set ENV Variables**:
Get the database URL and Token: [Turso Docs](https://docs.turso.tech/sdk/go/quickstart)

```
```bash
cp .env .env.local
```
3. **Install the dependencies**:
```
```bash
go mod tidy
```
4. **Run the server**:
```
```bash
go run .
```
5. **Access the web interface on port: `1234`:
```bash
curl -i http://localhost:1234/
```

### Development

Use the `Makefile` to run/build the web server.

### Requirements

- [Watchexec](https://github.com/watchexec/watchexec) - A file watcher for restarting and running the web server when the source files is updated
- [Bun](https://bun.sh) - Bun package manager (or `npm`,`pmpm`) for installing and watching static content for tailwind classes

- Run `make server` to start the server in watch mode
- Run `make tailwind` to watch for tailwind classes

## Contributing

Expand Down

0 comments on commit 85e1226

Please sign in to comment.