Skip to content

"A lightweight URL shortener built using Encore and TypeScript, designed for fast and scalable link management with a RESTful API."

Notifications You must be signed in to change notification settings

Slygriyrsk/encore-ts-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener with Encore.ts

This project is a URL shortener service built with Encore.ts. It allows users to create short, easy-to-share links for long URLs.

Table of Contents

Features

  • Shorten long URLs to compact, shareable links
  • Retrieve original URLs using shortened IDs
  • Built with Encore.ts for efficient backend development
  • Deployable to Encore's development cloud

Getting Started

Prerequisites

  • Encore installed on your system
  • Node.js and npm (for local development)
  • Docker (optional, for running containers)

Installation

  1. Create a new Encore application using this template:

    encore app create encore-ts-url-shortener --example=ts/empty
  2. Navigate to the project directory:

    cd encore-ts-url-shortener
  3. Install dependencies:

    npm install

Usage

To create a shortened URL:

curl -X POST https://staging-encore-url-shortener-rd32.encr.app/url -d "{\"url\": \"https://twitter.com/repatriation_23\"}" -H "Content-type: application/json"

Example response:

{"id":"BLGZchQY","url":"https://twitter.com/repatriation_23"}

To retrieve the original URL:

curl https://staging-encore-url-shortener-rd32.encr.app/url/BLGZchQY

Example response:

{"url":"https://twitter.com/repatriation_23","id":"BLGZchQY"}

Development

To run the application locally:

encore run

While encore run is running, open http://localhost:9400/ to view Encore's local developer dashboard.

Local Development

Deployment

To deploy your application to a staging environment in Encore's free development cloud:

git add -A .
git commit -m 'Commit message'
git push encore

After pushing, head over to the Cloud Dashboard to monitor your deployment and find your production URL.

Testing

Run tests using the following command:

encore test

Encore Dashboard

Docker

The project uses Docker containers for the database and other services. Here's a view of the Docker containers running:

Docker Containers

This image shows the SQL database container and other related containers used in the project.


For more information on Encore and its features, visit the Encore Documentation.

About

"A lightweight URL shortener built using Encore and TypeScript, designed for fast and scalable link management with a RESTful API."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published