npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ysf-gen2

v1.0.7

Published

A CLI tool for generating fullstack applications.

Downloads

56

Readme

Forks Stargazers Issues MIT License LinkedIn

About The Project

YSF Generator CLI is a powerful command-line tool that helps you quickly generate server and client entities for your projects. It supports initializing new projects, creating CRUD structures, and more to streamline your development process.

Built With

  • Nodejs
  • Postgresql

Tech Stack

Frontend:

  • Next
  • Tailwind
  • Shadcn

Backend:

  • Nodejs
  • Expressjs
  • Mysql
  • Postgresql

Usage

YSF Generator CLI supports initializing projects and creating CRUD structures. Below are examples of the key commands.

Initialize a Project

Use the init command to initialize a new project:

ysf-gen init <type> <projectName>

Example

ysf-gen init fullstack fullstack-project-name

Available types:

  • server
  • client
  • fullstack

Create an Entity

Use the create command to generate CRUD structures for an entity:

ysf-gen create <type>:[options]

Example

ysf-gen create fullstack:posts

PS: You have to make the model first on the prisma.schema, then use "pnpm migrate" to migrate db with prisma

Options:

--include [relatedEntities]: Include related entities in the CRUD structure. --protected [rolesRoutes]: Protect routes with roles in the format role=route1,route2,.... --search [field]: Add a search field (for client and fullstack types).

Commands

init

Initialize a new project.

: Type of project (server, client, fullstack). : Name of the project.

create

Create a CRUD structure for an entity.

: Type of entity (server:, client:, fullstack:). --include: Include related entities. --protected: Protect routes with roles. --search: Add search field for quick filtering.

Utilities

YSF Generator CLI provides utilities for interacting with your Prisma schema and project configuration.

generateEntityCrud

Generate CRUD operations for a given entity.

initializeProject

Initialize a new project with the specified type and name.

cli/protectedRoutes

Configure protection for routes based on user roles.

getRolesFromDb

Fetch user roles from the Prisma schema.

getEntityRelations

Fetch entity relationships from the schema.

generateClientEntity

Generate client-side code for a specified entity.

getEntityFields

Fetch fields from the schema for an entity.

updateConfig

Update the configuration file with new entity information.

Prisma Schema Template

This section covers the Prisma schema template for the YSF Generator CLI, including models, enums, and rules.

Models

  • users: Main user entity.
  • local_users: Represents users authenticating locally.
  • oauth_users: Represents users authenticating via OAuth.
  • user_details: Additional user details.
  • user_preferences: User preferences.
  • addresses: User addresses.
  • email_verifies: Email verification records.
  • images: Image management.

Enums

  • Role: User roles.
  • Gender: Gender options.
  • OAuthProvider: OAuth providers.

Rules for Using ysf-gen with Prisma

  • Image Integration: Link models representing images with the images model.
  • Plural Model Names: Keep model names plural for consistency.
  • Naming Conventions: Use camelCase for fields and models.
  • Unique Identifiers: Ensure each model has a unique identifier.
  • Relationships: Use @relation to define relationships.
  • Indexes: Apply indexes for frequently searched fields.
  • Default Values: Use @default for fields where applicable.
  • Enum Usage: Use enums for fields with predefined values.
  • Optional Fields: Use ? for optional fields.
  • Cascade Deletion: Use onDelete: Cascade for related child records.

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Fikri Nurdiansyah

gmail tele linkedin

Project Link: https://github.com/Fnz11/ysf-gen

PS: This README includes comprehensive details for the YSF Generator CLI, using a clean structure similar to your example. Let me know if you'd like to refine any sections!