Skip to content

softvence-agency/softvence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Softvence πŸš€

A modern monorepo of reusable NestJS packages and utilities for building scalable applications

License: MIT pnpm Turborepo

πŸ“¦ Packages

This monorepo contains a collection of production-ready NestJS packages designed to accelerate your development workflow.

Available Packages

Package Version Description
@softvence/s3 0.0.1 AWS S3 file upload service with caching and auto-organization
@softvence/mail 0.0.1 Email service powered by Nodemailer with template support

Package Details

πŸ“€ @softvence/s3

A powerful NestJS module for uploading files to AWS S3 with built-in features:

  • ✨ Single and multiple file uploads
  • πŸ—‚οΈ Automatic folder organization by MIME type
  • ⚑ Built-in caching with hash-based deduplication
  • πŸ”’ SHA256 file hashing
  • πŸ“¦ Full TypeScript support

View Documentation β†’

A flexible email service for NestJS applications:

  • πŸ“¨ Built on Nodemailer
  • 🎨 Template system with built-in OTP template
  • πŸ”§ Support for all major email providers (Gmail, SendGrid, SMTP, etc.)
  • πŸ“¬ Rich email options (attachments, CC, BCC, priority)
  • ⚑ Optional queue integration

View Documentation β†’

πŸš€ Getting Started

Prerequisites

  • Node.js: >= 18
  • pnpm: >= 9.0.0
  • NestJS: >= 11.0.0 (for using the packages)

Installation

Install pnpm if you haven't already:

npm install -g pnpm

Clone the repository:

git clone https://github.com/softvence-agency/softvence.git
cd softvence

Install dependencies:

pnpm install

πŸ“– Using the Packages

Installing a Package

You can install any package from this monorepo in your NestJS application:

npm install @softvence/s3
# or
npm install @softvence/mail

Quick Example - S3 Package

import { Module } from "@nestjs/common";
import { S3Module } from "@softvence/s3";

@Module({
  imports: [
    S3Module.forRoot({
      region: "us-east-1",
      bucket: "my-bucket",
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    }),
  ],
})
export class AppModule {}

Quick Example - Mail Package

import { Module } from "@nestjs/common";
import { MailModule } from "@softvence/mail";

@Module({
  imports: [
    MailModule.forRoot({
      transport: {
        service: "gmail",
        auth: {
          user: process.env.EMAIL_USER,
          pass: process.env.EMAIL_PASSWORD,
        },
      },
    }),
  ],
})
export class AppModule {}

πŸ› οΈ Development

Project Structure

softvence/
β”œβ”€β”€ apps/              # Applications
β”œβ”€β”€ packages/          # Shared packages
β”‚   β”œβ”€β”€ s3/           # S3 upload service
β”‚   β”œβ”€β”€ mail/         # Email service
β”‚   └── typescript-config/  # Shared TypeScript configs
β”œβ”€β”€ package.json       # Root package configuration
β”œβ”€β”€ pnpm-workspace.yaml  # pnpm workspace configuration
└── turbo.json        # Turborepo configuration

Available Scripts

# Build all packages
pnpm build

# Run development mode
pnpm dev

# Run linting
pnpm lint

# Format code
pnpm format

# Type checking
pnpm check-types

# Publish packages
pnpm publish-packages

Building Packages

Build all packages in the monorepo:

pnpm build

Build a specific package:

cd packages/s3
pnpm build

Running Tests

# Run tests for all packages
pnpm test

# Run tests for a specific package
cd packages/mail
pnpm test

πŸ—οΈ Monorepo Architecture

This project uses:

  • pnpm - Fast, disk space efficient package manager
  • Turborepo - High-performance build system for monorepos
  • Changesets - Version management and changelog generation

Why Monorepo?

  • πŸ“¦ Code Sharing - Share code between packages easily
  • πŸ”„ Atomic Changes - Make changes across multiple packages in a single commit
  • πŸš€ Faster Builds - Turborepo caches and parallelizes builds
  • πŸ“ Consistent Tooling - Shared configuration across all packages
  • πŸ”— Better Collaboration - All packages in one place

πŸ“š Documentation

Each package has its own comprehensive documentation:

🀝 Contributing

We welcome contributions! Here's how you can help:

Adding a New Package

  1. Create a new directory in packages/:

    mkdir packages/my-package
    cd packages/my-package
  2. Initialize the package:

    pnpm init
  3. Add the package to pnpm-workspace.yaml (already included via packages/*)

  4. Follow the existing package structure and conventions

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test your changes thoroughly
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Code Style

  • Use TypeScript for all packages
  • Follow the existing code style
  • Run pnpm format before committing
  • Ensure pnpm lint passes
  • Add tests for new features

Commit Convention

We follow conventional commits:

feat: add new feature
fix: bug fix
docs: documentation changes
chore: maintenance tasks
test: add tests
refactor: code refactoring

πŸ“‹ Publishing Packages

This monorepo uses Changesets for version management:

  1. Create a changeset:

    pnpm changeset
  2. Commit the changeset:

    git add .
    git commit -m "chore: add changeset"
  3. Publish packages:

    pnpm publish-packages

πŸ”§ Troubleshooting

pnpm Installation Issues

If you encounter issues with pnpm:

# Clear pnpm cache
pnpm store prune

# Reinstall dependencies
rm -rf node_modules
pnpm install

Build Failures

If builds fail:

# Clean build artifacts
pnpm clean

# Rebuild all packages
pnpm build

Turborepo Cache Issues

Clear Turborepo cache:

rm -rf .turbo
pnpm build

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Authors

πŸ”— Links

🌟 Support

If you find this project helpful, please consider giving it a ⭐ on GitHub!


Made with ❀️ by the Softvence Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors