URL Shortener SaaS is a Software-as-a-Service (SaaS) application that provides URL shortening functionality with additional features like user authentication, subscription management, and analytics. The platform is designed to handle high traffic and offers a scalable architecture for enterprise-grade URL management.
- URL Shortening: Generate short, unique URLs for long links.
- User Authentication: Secure login and signup using JWT-based authentication.
- Subscription Plans: Manage user subscriptions with tiered plans (e.g., free, premium).
- Analytics: Track URL clicks, user agents, and IP addresses.
- Rate Limiting: Prevent abuse with Redis-backed rate limiting.
- Caching: Improve performance with Redis caching for frequently accessed data.
- Scalable Architecture: Built with clean architecture principles for maintainability and scalability.
- Backend: Node.js, TypeScript, Express
- Database: PostgreSQL
- Payments: PayPal
- Caching: Redis
- Authentication: Passport.js, JWT
- Testing: Jest
- Core business logic and entities like
UserEntity,UrlEntity, andSubscriptionEntity. - Value objects for encapsulating domain-specific data (e.g.,
Email,Password). - Interfaces for repositories and services.
- Implements use cases such as
CreateUserUseCase,LoginUserUseCase, andRetrieveUserUseCase. - Maps domain entities to Data Transfer Objects (DTOs).
- Handles external integrations and configurations.
- Includes controllers, database repositories, and services like
JwtServiceandCacheService.
- Contains reusable utilities, middlewares, and error handling mechanisms.
- Node.js (v20 or higher)
- pnpm (v10 or higher)
- Docker and Docker Compose
-
Clone the repository:
git clone https://github.com/Cesar-Marcano/url-shortener-saas.git cd url-shortener-saas -
Install dependencies:
pnpm install
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add the required variables (e.g.,
DATABASE_URL,REDIS_URL,JWT_ACCESS_SECRET,JWT_REFRESH_SECRET).
- Create a
-
Start the application:
- For development:
pnpm start:dev
- For production:
docker-compose up --build
- For development:
Run unit tests using Jest:
pnpm testThe application is containerized using Docker. To deploy, use the following command:
docker-compose up --buildThis project is licensed under the MIT License. See the LICENSE file for details.
Developed by @Cesar-Marcano.