Git Product home page Git Product logo

authenticated-urlshortener-nestjs's Introduction

NestJS | Passport-local Authenticated | URL-shortener

This project implements a URL shortener using NestJS. It includes user authentication using the passport-local strategy and allows users to generate short codes for long URLs.

This document has been authored by referencing the content provided in the backendinfo.txt file. For more comprehensive information about the project, kindly consult the aforementioned file.

How to get started with running the project has also been mentioned below.

Project snippets/images can be viewed in the images directory in the root.

Homepage

homepage

Login page

loginpage

Cookie

cookie

Not Authorized

noauth

Technologies Used

  • NestJS
  • Passport (passport-local strategy)
  • express-session
  • nanoid (optional)

Installation

  1. Clone the repository:

    git clone https://github.com/paulaji/authenticated-urlshortener-nestjs.git
  2. Navigate to the project directory:

    cd your-url-shortener
  3. Install project dependencies:

    npm install

Getting Started

Development Mode

npm run start:dev

Production Mode

npm run start

Links to access the projects

Use the links given below in the Notable URLs category

Project Structure

The project follows a modular structure, including modules, services, guards, strategies, and more.

Notable URLs

User Authentication

For testing purposes, three users are created with the usernames: user1, user2, and user3. The password for all is "resu321321".

URL Shortening Logic

The URL shortening logic includes taking the long url and clipping it into a small one with randomly generated characters and mapping the short-url to the long one. (Optional) The URL shortening logic can also use the nanoid library to generate short codes for long URLs.

Frontend Integration

The frontend is served by the backend and provides access to the URL shortener.

Session Management

Session management is implemented using express-session with the secret set as "resu321321". User serialization is handled to store user information in sessions.

Additional Information

  • The project uses @nestjs/serve-static to serve static files.
  • For production use, consider using modules like node.bcrypt.js for password hashing.

Author

Project created by Paul Aji (https://github.com/paulaji)

License

This project is licensed under the MIT License.

References

Programming Assistance: Documentations, Youtube, ChatGPT Text/Document Refactoring: ChatGPT Aesthetic/UI Support: ChatGPT

authenticated-urlshortener-nestjs's People

Contributors

paulaji avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.