Skip to content

thiagodff/brev-ly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brev-ly

brev-ly is a modern and efficient URL shortener developed with a full-stack architecture. It features a monorepo structure containing a Node.js backend and a React frontend.

Key Features

  • URL Shortening: Create short links with random or custom slugs.
  • Analytics: Track visits to shortened links.
  • Image Upload: Upload images for custom links (integrated with Cloudflare R2).
  • Management: List, manage, and delete links.
  • Export: Export link data to CSV.
  • API Documentation: RESTful API documented with Swagger.

Architecture

The project is organized as a monorepo:

  • server/: Backend API (Node.js/Fastify)
  • web/: Frontend Interface (React/Vite)

Technology Stack

Backend (/server)

Frontend (/web)

Package Management

Setup and Execution Guide

Prerequisites

  • Node.js >= 18.x
  • pnpm >= 10.x
  • Docker & Docker Compose

1. Backend Setup (/server)

cd server
pnpm install

# Configure Environment
cp .env.example .env
# Edit .env with your credentials

# Start Database
docker-compose up -d db

# Run Migrations
pnpm db:generate
pnpm db:migrate

# Start Dev Server
pnpm dev

Server runs at http://localhost:3333. Swagger docs at /docs.

2. Frontend Setup (/web)

cd web
pnpm install

# Configure Environment
cp .env.example .env

# Start Dev Server
pnpm dev

Frontend runs at http://localhost:5173.

3. Docker Execution (Full Stack)

To run the backend and database entirely in Docker:

cd server
docker-compose up -d

Available Scripts

Backend

  • pnpm dev: Development mode
  • pnpm build: Build for production
  • pnpm start: Start production build
  • pnpm db:studio: Open Drizzle Studio

Frontend

  • pnpm dev: Development server
  • pnpm build: Production build
  • pnpm preview: Preview production build
  • pnpm lint: Run ESLint

About

URL shortener service - streaming data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published