Giter Site home page Giter Site logo

fazle-rabbi-dev / link-bridge-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 48 KB

๐Ÿ› ๏ธ Link-Bridge-Api is the RESTful API for the LinkBridge React app, providing seamless connection management and link aggregation functionalities.

License: MIT License

Shell 0.13% JavaScript 99.87%

link-bridge-api's Introduction

Link-Bridge-Api

Link-Bridge-Api is the RESTful API for the LinkBridge React app, providing seamless connection management and link aggregation functionalities.

This api is deployed on Cyclic.

Fun Fact ๐Ÿค“

Note

I created this project entirely using my Android Phone with apps: Acode & Termux.

Features

  • ๐Ÿ”’ User Authentication: Secure user authentication using JWT tokens.
  • ๐Ÿ–ผ๏ธ Profile Customization: Users can customize their profiles, including updating their bio and profile picture.
  • ๐Ÿ”— Link Management: Add, update, and delete custom links for your LinkTree profile.
  • ๐ŸŒ Social Links Integration: Easily add and manage social media links to your profile.
  • ๐Ÿ”‘ Forgot Password: Password recovery functionality for users who forget their passwords.

Live Demo ๐ŸŽ‰

Installation

  1. Clone the repository:
    git clone https://github.com/fazle-rabbi-dev/Link-Bridge-Api
  2. Navigate to the project directory:
    cd Link-Bridge-Api
  3. Install dependencies:
    npm install

Configuration

  1. Create a .env file in the root directory and define the following environment variables:
     MONGODB_URI=
     JWT_SECRET=
     
     ACCESS_TOKEN_SECRET=
     REFRESH_TOKEN_SECRET=
     
     ACCESS_TOKEN_EXPIRY="1d"
     REFRESH_TOKEN_EXPIRY="10d"
     
     CLOUDINARY_CLOUD_NAME=
     CLOUDINARY_API_KEY=
     CLOUDINARY_API_SECRET=
     
     GMAIL_USERNAME=
     GMAIL_PASSWORD=<Write your app password, which you can obtain by enabling two-factor authentication in your Gmail account.>
    
    

Usage

  1. Start the server:
    npm run dev
  2. The API will be accessible at http://localhost:5000.

API Endpoints

  • /api/users: User authentication & User profile management endpoints.
  • /api/links: Link management endpoints.

Project Structure

.
โ”œโ”€โ”€ nodemon.json              // Configuration file for nodemon
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ public                    // Contains publicly accessible files
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ app.js
โ”‚   โ”œโ”€โ”€ controllers            // Contains controller logic for handling HTTP requests
โ”‚   โ”‚   โ”œโ”€โ”€ userController.js // Controller for user-related operations
โ”‚   โ”œโ”€โ”€ database               // Database-related logic and database connection setup
โ”‚   โ”‚   โ”œโ”€โ”€ User.js           // Database operations related to user management
โ”‚   โ”‚   โ””โ”€โ”€ db-connect.js     // Database connection setup
โ”‚   โ”œโ”€โ”€ index.js               // Entry point of the application
โ”‚   โ”œโ”€โ”€ middlewares            // Middleware functions for request processing
โ”‚   โ”‚   โ”œโ”€โ”€ authMiddleware.js       // Authentication middleware
โ”‚   โ”‚   โ”œโ”€โ”€ multerMiddleware.js     // Middleware for handling file uploads (if applicable)
โ”‚   โ”‚   โ”œโ”€โ”€ notFoundErrorHandler.js // Middleware for handling 404 errors
โ”‚   โ”‚   โ””โ”€โ”€ otherErrorHandler.js    // Other error handling middleware
โ”‚   โ”œโ”€โ”€ models                 // Database models/schema definitions
โ”‚   โ”‚   โ””โ”€โ”€ UserModel.js      // User model definition
โ”‚   โ”œโ”€โ”€ routes                 // Route definitions for different API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ index.js          // Main router file
โ”‚   โ”‚   โ”œโ”€โ”€ userRoutes.js     // Routes related to user management
โ”‚   โ”œโ”€โ”€ services               // Service layer containing business logic
โ”‚   โ”‚   โ”œโ”€โ”€ userService.js    // Service functions for user-related operations
โ”‚   โ””โ”€โ”€ utils                  // Utility functions and helper modules
โ”‚       โ”œโ”€โ”€ ApiError.js        // Custom API error handler
โ”‚       โ”œโ”€โ”€ ApiResponse.js    // Response format utility
โ”‚       โ”œโ”€โ”€ CustomError.js    // Custom error class definition
โ”‚       โ”œโ”€โ”€ cloudinary.js     // Cloudinary integration for file storage (if applicable)
โ”‚       โ”œโ”€โ”€ constants.js      // Constant values used throughout the application
โ”‚       โ”œโ”€โ”€ corsOptions.js    // CORS configuration options
โ”‚       โ”œโ”€โ”€ emailTemplates.js // Email template generation functions
โ”‚       โ”œโ”€โ”€ helpers.js        // Miscellaneous helper functions
โ”‚       โ”œโ”€โ”€ limiter.js        // Rate limiting configuration
โ”‚       โ””โ”€โ”€ sendEmail.js      // Email sending functionality
โ””โ”€โ”€ swagger.json              // Swagger/OpenAPI specification file

Contributing

Contributions are welcome! Please feel free to fork the repository and submit pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ฌ Connect with me

Let's connect! Reach out for collaborations, projects, or just a friendly chat.

Fazle Rabbi Fazle Rabbi Fazle Rabbi Fazle Rabbi Fazle Rabbi Fazle Rabbi

Feel free to explore, contribute, and get inspired!

link-bridge-api's People

Contributors

fazle-rabbi-dev avatar

Stargazers

Manthan Ankolekar avatar

Watchers

 avatar

Forkers

bio-link

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.