https://github.com/shivankk26/url-shortener
In this Project, I've built a WebApp using which you can create a shorter form of any URL which you want to. The Tech Stacks which I've used are: Bootstrap, EJS, MongoDB, Node.js, Express.js. So, just explore this WebApp and have fun!
https://github.com/shivankk26/url-shortener
backend bootstrap ejs expressjs javascript mongodb mongoose nodejs
Last synced: 3 months ago
JSON representation
In this Project, I've built a WebApp using which you can create a shorter form of any URL which you want to. The Tech Stacks which I've used are: Bootstrap, EJS, MongoDB, Node.js, Express.js. So, just explore this WebApp and have fun!
- Host: GitHub
- URL: https://github.com/shivankk26/url-shortener
- Owner: ShivankK26
- Created: 2023-01-31T17:22:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-04T07:51:44.000Z (about 2 years ago)
- Last Synced: 2025-01-09T06:21:58.288Z (4 months ago)
- Topics: backend, bootstrap, ejs, expressjs, javascript, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage:
- Size: 63.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About The Project
In this Project, I've built a WebApp using which you can create a shorter form of any URL which you want to. It can be used by Social Media Influencers in order to appropriately design their posts so that the URL occupies minimum space and has many other practical applications too. So, just have fun!!!
Use the `README.md` to get started.
# Built With
The Tech Stacks use are:
# Getting Started
To get started, create a file called server.js and import all the required modules in it. After that create a folder called views and place the index.ejs file in it. Also, create another folder called models in which add the mongoDB connecting file. To shorten our links we'll use the shortId module from mongoDB.
* modules
```sh
const express = require('express')
const mongoose = require('mongoose')
const ShortUrl = require('./models/shortUrl')
const app = express()
```* ejs connectivity
```sh
app.set("view engine","ejs")
```
* shortId module```sh
const mongoose = require('mongoose')
const shortId = require('shortid')
```## Prerequisites
To begin with our Project, we'll need to install some npm packages like node, express, mongoose, mongo, ejs using the command given below. We'll also need to install the shortId module.
* npm
```sh
npm install node express mongo mongoose ejs
```* Some other modules
```sh
const mongoose = require('mongoose')
const shortId = require('shortid')
```
* To ease the process of development, we'll install nodemon (Make sure you already have nodemon installed in your system, if not then [visit here](https://nodemon.io/)).```sh
npm i nodemon
```## Installation
In this Project, we'll use the schema method from mongoDB in order to create an object wherein we can perform all the operations.
In order to create a URL Shortener we'll shortId.generate command to generate a shortID automatically.```sh
// This is inside the mongoDB schema object.
short: {
type: String,
required: true,
default: shortId.generate
},
```# Contact
Your Name - Shivank Kapur - [email protected]
Project Link: