Skip to content

zshanabek/quttai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

URL shortener.

Server: Node.js, Express, MongoDB, mongoose.

Client: Vue.js

Extra packages: vue-toasted, vue-clipboard2, valid-url, shortid, dotenv

quttai - word from Kazakh құттай ("small").

Backend installation

  1. Clone repository
git clone https://github.com/zshanabek/quttai
cd quttai/server
  1. Install dependencies
npm install
  1. Create the environment variables file. Here I pasted connection url to my remote database, but you can past your database's url. Create a remote mongodb database here
echo "BASE_URL=http://localhost:5000" >> .env
echo "PORT=5000" >> .env
echo "MONGODB_URL='mongodb://zshanabek:[email protected]:41647/nodejs-url-shortener" >> .env
  1. Install HTTPie. It is a command line HTTP client
apt-get install httpie
  1. Run server
npm start
  1. Shorten long url
http post localhost:5000/api/items url=https://twitter.com/theshanabek/status/1180694065014349825
  1. Expect short url in response and then past it somewhere
{
    "success": true,
    "url": "http://localhost:5000/api/items/HJY15wCXe"
}

Frontend installation

  1. Go to client directory
cd quttai/client
  1. Install dependencies
npm install
  1. Run server
npm run serve
  1. App is running here: http://localhost:8080

Screenshot