NextWeb.js

NextWeb.js

  • Docs
  • GitHub

›Getting Started

Getting Started

  • Getting Started
  • Folder Structure
  • Create a New Page
  • Navigate Between Pages

App

  • Environment Variables
  • Module Alias
  • Routing
  • Context
  • Store
  • Authentication

Page

  • Layout
  • Meta
  • Breadcrumb
  • Stats
  • Restricted Pages

Data Fetching

  • Repositories & Services
  • Server-Side Fetching
  • Client-Side Fetching
  • Error Handling
  • Custom Error

Styling

  • Local Styles
  • Global Styles
  • Grids
  • Style Helpers
  • Fonts
  • Icons

Deployment

  • Deployment

Folder Structure

The main folder structure of NextWeb.js looks like this:

my-app/
  src/
    components/
    features/
    lib/
    pages/
    router/
    public/
    next.config.js
    server.js
  .babelrc
  .env

src/ is the directory where you put your source code. And for lare-scale maintainable web apps, we recommend you to separate your code into the following subdirectories.

NameDescription
components/Keep react components for pages and section
features/Keep business logic separated by entities or modules
lib/Keep built-in utilities separated by modules
pages/Keep pages for Next.js
router/Keep routes and utilities for routing
public/Keep public files

Note: Adding more subdirectories in src/ is not recommended unless you know what you are doing.

In other words, NextWeb.js is about the concept that separate code based on module and provide some useful utilities in src/lib directory. The rest code in just recipes that use those utilities!

← Getting StartedCreate a New Page →