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

next-gen-code-generator

v1.1.4

Published

FastTrack your projects with a powerful CLI tool that auto-generates the most important code for you.

Downloads

21

Readme

Getting Started

First, install the package:

npm install next-gen-code-generator -g
# or
yarn install next-gen-code-generator -g

To use the next gen run:

next-gen ui
# or
next-gen generate

Note: to run next-gen generate you have to have the next-gen.json file where you are running the command.

Setup

  1. After running next-gen ui the next-gen wizard should be running on http://localhost:8087

  2. Add the project name. This will be the project name of the generated Next JS project.

  3. Add the MYSQL DB Host URL.

  4. Add the MYSQL DB Name.

  5. Add the MYSQL DB username.

  6. Add the MYSQL DB password

  7. Add the model name that should not include spaces, non-alphanumeric characters (except underscores), starts with a number, or includes SQL keywords.

  8. Add the allowed CRUD operations for your model. Check all boxes to allow all CRUD actions

  9. Repeat the process adding all the models for your project. Ensure you use plural nouns to name your models.

  10. Setup fields for all your models. After selecting a model for your field, add the field type, if the field will be required when creating the record, and the main identifier(A field that will act as the main identifier for a record eg. name, A model can have only one identifier). Add if the field should be visible on the UI table display.

  11. Setup the relationships. Next-gen supports 1:n relationships for now. For each model, Add the parent models.(All the models that the current model belongs to).

  12. Confirm the models, fields and relationships and generate Next JS project.

  13. The project should be running on http://localhost:3000/

REST APIs

Next-Gen will automatically generate REST endpoints for:

  1. POST - create record for the model

  2. PUT - update record for the model

  3. GET - fetch record(s) for the model(GET model/?id=2 to fetch specific record using the record id and GET model/ to fetch all the records for the model. By default the GET method will return the main identifiers for the parent models)

  4. DELETE - delete the record for the model