Giter Club home page Giter Club logo

nuxt-url-shortner's Introduction

Nuxt 3 URL Shortener API PROJECT

Overview:

This open-source project is a simple URL shortener API built with Nuxt 3 and MongoDB. It allows users to shorten long URLs into more manageable and shareable links. This README provides information on how to set up and use the project.

Project Structure:

The project follows a modular structure to enhance maintainability and organization. Here's an overview of the key directories in server directory:

  • /api: Contains API-related endpoints.
  • /config: Houses configuration files for the project, including settings for the URL shortener API.
  • /controllers: Manages controllers, handling the business logic and interaction with the data.
  • /models: Defines the data models for MongoDB, specifying the structure of the stored data.
  • /plugins: Stores any plugins utilized in the project, enhancing functionality or providing additional features.
  • /repositories: Contains repository classes responsible for interacting with the database.
  • /view-models: Manages view models, which shape the data to be presented in the frontend.
  • tsconfig.json: TypeScript configuration settings.

Feel free to explore each directory for more details on their specific roles and contents.

Requirements:

  • Node.js
  • Nuxt 3
  • MongoDB

Installation:

  1. Clone the repository:

    git clone https://github.com/ahrasel/nuxt-url-shortner.git
  2. Navigate to the project directory:

    cd nuxt-url-shortner
  3. Install dependencies:

    npm install
  4. Configure the MongoDB connection:

    • Open config.js file and update the MongoDB connection URI.
  5. Create .env file from .env.example

Usage:

  1. Start the Nuxt 3 app:

    npm run dev
  2. Access the application in your browser:

    http://localhost:3000
  3. Use the API to register URLs:

    • Send a POST request to http://localhost:3000/api/v1/auth/register with a JSON payload containing the original URL:

      {
        "username": "ahrasel",
        "password": "123456789",
        "name": "MD Amanullah Hoque",
        "email": "[email protected]"
      }
  4. Use the API to login URLs:

    • Send a POST request to http://localhost:3000/api/v1/auth/login with a JSON payload containing the original URL:

      {
        "username": "ahrasel",
        "password": "123456789"
      }
  5. Use the API to logout URLs:

    • Send a POST request to http://localhost:3000/api/v1/auth/logout with a bearer token
  6. Use the API to change password URLs:

    • Send a POST request to http://localhost:3000/api/v1/auth/change-password with a JSON payload containing the original URL:

      {
        "oldPassword": "123456789",
        "newPassword": "123456789"
      }
  7. Use the API to forgot password URLs:

    • Send a POST request to http://localhost:3000/api/v1/auth/forgot-password with a JSON payload containing the original URL:

      {
        "email": "[email protected]"
      }
  8. Use the API to all shorten urls URLs:

    • Send a GET request to http://localhost:3000/api/v1/urls
  9. Use the API to create short url URLs:

    • Send a POST request to http://localhost:3000/api/v1/urls with a JSON payload containing the original URL:

      {
        "url": "http://localhost:3000/url"
      }
  10. Use the API to increase click URLs:

    • Send a GET request to http://localhost:3000/api/v1/urls/[id]/click

    there are also some other routes for api. you can test with this vscode thunder client extension

Configuration:

  • config.js contains configuration settings, including the MongoDB connection URI.

Contributing:

Contributions are welcome! If you'd like to contribute, please follow the Contribution Guidelines.

License:

This project is licensed under the MIT License. Feel free to use and modify it as per your needs.

Acknowledgments:

Special thanks to the Nuxt 3 and MongoDB communities for their excellent tools and resources.

Contact:

For any questions or concerns, feel free to reach out to the project maintainer:

nuxt-url-shortner's People

Contributors

ahrasel 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.