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.
Note
I created this project entirely using my Android Phone with apps: Acode & Termux.
- ๐ 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.
- Clone the repository:
git clone https://github.com/fazle-rabbi-dev/Link-Bridge-Api
- Navigate to the project directory:
cd Link-Bridge-Api
- Install dependencies:
npm install
- 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.>
- Start the server:
npm run dev
- The API will be accessible at
http://localhost:5000
.
/api/users
: User authentication & User profile management endpoints./api/links
: Link management endpoints.
.
โโโ 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
Contributions are welcome! Please feel free to fork the repository and submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Let's connect! Reach out for collaborations, projects, or just a friendly chat.
Feel free to explore, contribute, and get inspired!