This project is a full-stack URL shortener application with a .NET backend and a Vue.js frontend.
The backend is built with .NET and provides RESTful API endpoints for URL shortening and user authentication.
- .NET 8
- Entity Framework Core
- SQL Server
- JWT Authentication
-
Navigate to the backend directory:
cd url-shortener-backend
-
Restore dependencies:
dotnet restore
-
Update the database:
dotnet ef database update
-
Run the application:
dotnet run
The API will be available at http://localhost:5203
.
The frontend is built with Vue 3, TypeScript, and Vite.
- Vue 3
- TypeScript
- Vite
- Tailwind CSS
- Axios
-
Navigate to the frontend directory:
cd url-shortener-frontend
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add:VITE_API_BASE_URL=http://localhost:5203/api
-
Run the development server:
npm run dev
The application will be available at http://localhost:5173
.
To build the frontend for production:
The built files will be in the dist
directory.
- User registration and authentication
- Create shortened URLs
- Custom short URL creation
- Time-to-live (TTL) setting for URLs
- View list of shortened URLs
Controllers/
: API controllersModels/
: Data modelsServices/
: Business logicData/
: Database context and migrations
src/components/
: Vue componentssrc/services/
: API servicessrc/App.vue
: Main application componentsrc/main.ts
: Application entry point
POST /api/auth/register
: Register a new userPOST /api/auth/login
: Login and receive JWT tokenPOST /api/urls
: Create a shortened URLGET /api/urls
: Get list of shortened URLs
For more details, refer to the API documentation or the controller files.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.