Overview
Svelte Shortener is a web application built with SvelteKit and PocketBase. It allows users to shorten URLs and manage them within a database. The application provides authentication for users and ensures that only verified users can create links. With the ability to deploy the application using Vercel or manually, Svelte Shortener offers flexibility in hosting options.
Features
- URL Shortening: Users can shorten long URLs into shorter, more manageable links.
- Authentication: Verified users can create and manage links securely.
- PocketBase Integration: Utilizes PocketBase as the database for storing user and link data.
- Deployment Options: Can be deployed using Vercel or manually, giving users flexibility in hosting.
Installation
To install and run Svelte Shortener:
- Clone the repository:
git clone [repository-url]
- Install dependencies:
npm install
Set up PocketBase:
- Download the PocketBase executable from [download-link] and move it to the pocketbase directory.
- Run the PocketBase instance locally by executing the command:
./pocketbase serveThis will start a PocketBase instance at
127.0.0.1:8090.Import the schema in PocketBase:
- Go to your PocketBase instance and navigate to “Import collections” in the settings.
- Import the schema located in the pocketbase folder.
Create a new verified user in PocketBase:
- After importing the schema, create a new verified user. This user will be used for authentication.
Create an
.envfile in the project’s root directory and add the following variable:
POCKETBASE_URL - The URL of your PocketBase instance (without /_/ or /api/)
- Run SvelteKit:
npm run dev
This will start the SvelteKit instance.
Summary
Svelte Shortener is a web application that allows users to shorten URLs securely. Built with SvelteKit and PocketBase, it offers features such as URL shortening, authentication, and flexible deployment options. By following the installation guide, users can set up their own instance of Svelte Shortener and start managing their shortened links.