Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sinanptm/url-shortener

My First nestjs project
https://github.com/sinanptm/url-shortener

mern-stack nesjs nestjs-backend node-js url-shortner

Last synced: 10 days ago
JSON representation

My First nestjs project

Awesome Lists containing this project

README

        


Nest Logo

URL Shortener - MERN Stack with NestJS Backend


A powerful and efficient URL shortener built with the MERN stack, featuring a NestJS backend for robust server-side operations.


Features
Tech Stack
Getting Started
Usage
Learning NestJS
Contributing


NestJS
React
Express.js
MongoDB

## Features

- 🚀 Shorten long URLs into easily shareable links
- 📊 Track click statistics for each shortened URL
- 🔒 User authentication and personalized dashboard
- 🎨 Responsive and intuitive user interface
- ⚡ High-performance backend powered by NestJS

## Tech Stack

- **Frontend**: React, Redux, Tailwind CSS
- **Backend**: NestJS (Node.js framework), Express.js
- **Database**: MongoDB
- **Authentication**: JWT

## Learning NestJS


Nest Logo

As a NestJS beginner, I am discovering how it differs from traditional Node.js frameworks like Express. With its modular architecture and TypeScript-first approach, NestJS makes it easier to build scalable and testable backend services. I chose NestJS for this project to gain hands-on experience in building a more structured backend.

Some key aspects I'm exploring with NestJS in this project:

- Modular architecture
- Dependency injection
- Decorators for routing and request handling
- Integration with MongoDB using Mongoose
- Authentication and authorization with Guards

To learn more about NestJS, check out the [official documentation](https://docs.nestjs.com/).

## Getting Started

1. Clone the repository:
```bash
git clone https://github.com/yourusername/url-shortener.git
cd url-shortener
```

2. Install dependencies for both client and server:
```bash
# Install client dependencies
cd client
npm install

# Install server dependencies
cd ../server
npm install
```

3. Set up environment variables:
Create a `.env` file in the server directory and add the following:
```
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:300
```

4. Start the development servers:
```bash
# Start the NestJS backend server
cd server
npm run start:dev

# In a new terminal, start the React frontend
cd client
npm start
```