zorn
V2EX  ›  Node.js

搞了一个 Nextjs、Graphql 项目的模版,大家可以这个模版初始化你的 Nextjs 项目。

  •  
  •   zorn · Jan 11, 2024 · 2144 views
    This topic created in 853 days ago, the information mentioned may be changed or developed.

    项目地址: https://github.com/chenzn1/awesome-examples
    模版地址: https://github.com/chenzn1/awesome-examples/tree/master/examples/nextjs-prisma-graphql-example

    因为这个项目是打算做成模版库,所以是 Monorepo 的架构。
    说回这个 Nextjs 、Graphql 模版,它集成了一下技术库:

    项目结构

    .
    ├── prisma
    ├── src
    │   ├── app
    │   ├── client
    │   │   ├── components
    │   │   ├── graphql
    │   │   ├── utils
    │   ├── server
    │   │   ├── drives
    │   │   ├── entities
    │   │   ├── errors
    │   │   ├── interfaces
    │   │   ├── resolvers
    │   │   ├── servers
    │   │   ├── graphql-builder.ts
    │   │   ├── graphql-schema.ts
    │   ├── shared
    │   ├── tests
    │   │   ├── fixtures
    

    项目的文件命名风格是 {xx}-{xx}.{modal|entity|service|resolver|...}.{ts|tsx|...} ,比如:

    • create-user.modal.tsx
    • update-user.modal.tsx
    • user.entity.ts
    • user.d.ts
    • user.servier.ts

    如果大家觉得好用,就给个 star 吧,以后还会不定时更新其它的模版。

    Supplement 1  ·  Jan 12, 2024
    pengtdyd
        1
    pengtdyd  
       Jan 11, 2024
    nextjs 不是取消了 src 目录吗?
    zorn
        2
    zorn  
    OP
       Jan 11, 2024
    @pengtdyd nextjs 初始化可以时候可以选择是否要 src
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5639 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 08:28 · PVG 16:28 · LAX 01:28 · JFK 04:28
    ♥ Do have faith in what you're doing.