Skip to content

A simple link shortener API, runs on Node.js and uses Fastify as well as MongoDB.

License

Notifications You must be signed in to change notification settings

thaddeuskkr/nova

Repository files navigation

Nova

Workflow Status (release) Workflow Status (push)

Nova is a simple link shortener created in TypeScript that runs on Node.js.
Currently in development, and not ready for production use.

Features

  • An API that is easy to use and understand
  • User management
  • Password-protected short URLs

Setup: Production

The following are the recommended ways to run Nova.
Do note, the Docker configurations are the exact same, but with different methods of running them.

Docker (CLI)

Run the following command directly. Do replace the environment variables (-e) and port mapping (-p) with a configuration more relevant to you.

docker run \
  --name nova \
  --restart unless-stopped \
  -p 80:3000 \
  -e MONGODB_CONNECTION_URL="<YOUR_DATABASE_URL>" \
  -e HOST="localhost" \
  -e PORT="3000" \
  -e BASE_URL="" \
  -e BASE_URL_REDIRECT="" \
  -e ALLOWED_HOSTS="" \
  -e PROHIBITED_SLUGS="api" \
  -e PROHIBITED_CHARACTERS_IN_SLUGS="/" \
  -e REGISTRATION_ENABLED="true" \
  -e URL_DELETION_ENABLED="true" \
  -e LOG_LEVEL="info" \
  -e NODE_ENV="production" \
  ghcr.io/thaddeuskkr/ nova:latest

Docker Compose

Create a compose.yml file in a empty directory with the following sample content edited to fit your use case. Then, run docker compose up.

services:
  nova:
    container_name: nova
    image: ghcr.io/thaddeuskkr/nova:latest
    restart: unless-stopped
    ports:
      - "80:3000"
    environment:
      MONGODB_CONNECTION_URL: "<YOUR_DATABASE_URL>"
      HOST: "localhost"
      PORT: "3000"
      BASE_URL: ""
      BASE_URL_REDIRECT: ""
      ALLOWED_HOSTS: ""
      PROHIBITED_SLUGS: "api"
      PROHIBITED_CHARACTERS_IN_SLUGS: "/"
      REGISTRATION_ENABLED: "true"
      URL_DELETION_ENABLED: "true"
      LOG_LEVEL: "info"
      NODE_ENV: "production"

Setup: Development

Prerequisites

Steps

  • Clone this repository

    git clone https://github.com/thaddeuskkr/nova.git && cd nova
  • Install all dependencies using NPM

    npm install
  • Copy .env.example to .env and fill it in

    cp .env.example .env
  • Build and start

    npm run build && npm start

Contributing

Contributions of all sorts are accepted and greatly appreciated.

To contribute to this codebase, do the following:

  1. Create a fork of this repository
  2. Follow the setup process above, but clone your fork instead
  3. Push the modified code to your fork of this repository
  4. Create a pull request to the main branch

To suggest a new feature or report a bug in Nova, please create an issue.

About

A simple link shortener API, runs on Node.js and uses Fastify as well as MongoDB.

Resources

License

Security policy

Stars

Watchers

Forks

Packages