A simple url shortener made with laravel + tailwindcss.
- user authenticatiom
- URL shortening and redirection
- Expiration dates for short URLs
- Click tracking analytics
- Make sure you have PHP version 8+ installed on your system. You can check by running the following in your terminal.
php -v
-
Install Composer, a dependency manager for PHP. You can download it from the official website: https://getcomposer.org/.
-
Install MySQL, a popular database system. You can download and install MySQL from the official website: https://dev.mysql.com/downloads/ or You can use a server stack like
Xampp
orWamp
which comes pre-installed with PHP and MySQL. -
Visit the official Node.js website: https://nodejs.org/. Download the appropriate installer for your operating system and run it. Run the following command to verify that Node.js and npm are installed:
node -v
npm -v
Open your terminal and navigate to the directory where you want to install the app. Run the following command to clone the repository:
git clone https://github.com/bethropolis/myurls.git
Navigate into the app's directory:
cd myurls
Run the following command to install the app's dependencies using Composer and npm:
# composer
composer install
# npm
npm install
Make a copy of the .env.example
file and rename it to .env
:
cp .env.example .env
php artisan key:generate
Create a new database called myurls
onto your database manually.
If you have mysql environment installed you can run.
mysql -u your_username -p -e "CREATE DATABASE myurls;"
Update the .env
file with the necessary database credentials:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myurls
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
note: your'll need to create the database called
myurls
or any other name according to the value ofDB_DATABASE
.
Run the following command to migrate the database tables:
php artisan migrate
Run the following command to start the Laravel development server & vite server:
npm run dev
php artisan serve
The app will be accessible at http://localhost:8000
in your browser.
That's it! You've successfully installed the app.
I made this project to learn more about Laravel (so far I'm Loving it).
My favourite license, MIT license