PicLink is an image hosting service that allows users to upload images and receive a CDN link to share them instantly. It leverages GitHub as the storage backend and jsDelivr as the CDN for fast and reliable image delivery.
- Image Upload with Preview: Upload images with a live preview before submission.
- Drag and Drop Support: Easily upload images by dragging them into the upload area.
- Upload Progress Indicator: Visual feedback during the upload process.
- CDN URL Generation: Automatically generates a CDN link for the uploaded image.
- Copy to Clipboard: Quickly copy the generated CDN URL with a single click.
- Confetti Celebration: A fun confetti animation celebrates successful uploads.
- Node.js: JavaScript runtime for server-side logic.
- Express.js: Web framework for handling HTTP requests.
- Multer: Middleware for handling multipart/form-data, used for file uploads.
- Octokit: GitHub API client for interacting with GitHub repositories.
- CORS: Middleware for enabling cross-origin resource sharing.
- React: JavaScript library for building user interfaces.
- Vite: Fast development server and build tool.
- Tailwind CSS: Utility-first CSS framework for styling.
- AOS: Library for scroll animations.
- Lucide React: Icon library for React.
- Canvas Confetti: Library for confetti animations.
- Typed.js: Library for typing animations.
- Axios: Promise-based HTTP client for making API requests.
- Node.js and npm: Ensure you have Node.js and npm installed on your machine.
- GitHub Account: You need a GitHub account and a public repository to store the uploaded images.
- Navigate to the PicLink-Backend directory:
cd PicLink-Backend - Install the required dependencies:
npm install
- Create a .env file in the PicLink-Backend directory with:
Replace placeholder values with your actual GitHub details.
PORT=3001 FRONTEND_URL=http://localhost:5173 GITHUB_TOKEN=your_github_personal_access_token GITHUB_USERNAME=your_github_username GITHUB_REPO=your_github_repository_name GITHUB_BRANCH=main GITHUB_FOLDER=images
- Start the backend server:
node index.js
- Navigate to the PicLink-Frontend directory:
cd PicLink-Frontend - Install the required dependencies:
npm install
- Create a .env file in the PicLink-Backend directory with:
Replace placeholder values with your actual GitHub details.
VITE_BACKEND_URL=http://localhost:3001
- Start the development server:
npm run dev
-
Open your browser and navigate to http://localhost:5173 (or the port shown after running npm run dev).
-
Select an image file or drag and drop it into the upload area.
-
Click the "Upload Image" button to start the upload process.
-
After a successful upload, the CDN URL will be displayed along with a preview of the image.
-
Use the "Copy" button to copy the CDN URL to your clipboard for easy sharing.
-
PORT: The port on which the backend server runs (default: 3001).
-
FRONTEND_URL: The URL of the frontend application for CORS configuration (e.g., http://localhost:5173).
-
GITHUB_TOKEN: Your GitHub personal access token with repo scope.
-
GITHUB_USERNAME: Your GitHub username.
-
GITHUB_REPO: The name of the GitHub repository where images will be stored.
-
GITHUB_BRANCH: The branch to use in the repository (default: main).
-
GITHUB_FOLDER: The folder within the repository to store images (default: images).
- VITE_BACKEND_URL: The URL of the backend server (e.g., http://localhost:3001).
To deploy PicLink to a production environment:
- Deploy the backend to a server (e.g., Heroku, Vercel, DigitalOcean)
- Set the environment variables in your hosting platform's dashboard
- Ensure the server is running and accessible via a public URL
- Deploy the frontend to a hosting service (e.g., Netlify, Vercel, GitHub Pages)
- Update the
VITE_BACKEND_URLin the frontend's environment variables to point to the deployed backend URL
- Update the
FRONTEND_URLin the backend's environment variables to the deployed frontend URL
- Ensure the GitHub repository is public, as jsDelivr requires public access to serve the images
If you encounter any issues or have suggestions for improvements, feel free to:
- Open an issue on the project's repository
- Submit a pull request with your proposed changes
Jadamal Sangeetha Choudhary
Give a ⭐️ if this project helped you!