⚡ next + nest ⚡


Keywords
nexst, nest, nestjs, nest.js, next, nextjs, next.js, react, reactjs, react.js, typescript, isomorphic, typeorm
License
MIT
Install
npm install @nexst/core@0.0.41

Documentation

😎 NEXST 😎

A typescript framework on top of Next.js and nest

How to use

Setup

Install it:

# install nexst packages
$ npm install --save @nexst/core @nexst/tsconfig @nexst/tsconfig-server

# install typescript
$ npm install --save-dev typescript

and add a script to your package.json like this:

{
  "scripts": {
    "dev": "nexst",
    "build": "nexst build",
    "start": "nexst start"
  }
}

Next.js side usage

Populate files below inside your project:

./tsconfig.json

{
  "extends": "@nexst/tsconfig",
  "compilerOptions": {
    "outDir": "build"
  }
}

./.babelrc

{
  "presets": [
    "next/babel",
    "@zeit/next-typescript/babel"
  ]
}

./pages/index.tsx

export default () => (
  <div>Welcome to NEXST!</div>
);

./next.config.js

const withTypescript = require('@zeit/next-typescript');

module.exports = withTypescript({
  distDir: 'build',
});

and then just run npm run dev and go to http://localhost:3000. You should see the Welcome to NEXST! message.

nest side usage

Populate files below inside your project:

./tsconfig.server.json

{
  "extends": "@nexst/tsconfig-server",
  "compilerOptions": {
    "outDir": "build"
  },
  "exclude": [
    "pages", // exclude all client files
  ],
}

./main.ts

import { bootstrap } from '@nexst/core';
import { AppModule } from './app.module';

bootstrap(AppModule);

./app.module.ts

import { Module } from '@nestjs/common';
import { AppController } from './app.controller';

@Module({
  controllers: [AppController],
})
export class AppModule {}

./app.controller.ts

import {
  Controller,
  Get,
} from '@nestjs/common';

@Controller()
export class AppController {
  @Get()
  public root(): string {
    return 'Welcome to NEXST!';
  }
}

and then just run npm run dev and go to http://localhost:4000. You should see the Welcome to NEXST! message.

Packages

package version description
@nexst/core @nexst/core downloads core package
@nexst/tsconfig @nexst/tsconfig downloads A tsconfig for the nexst app
@nexst/tsconfig-server @nexst/tsconfig-server downloads A tsconfig for the nexst server app
create-nexst-app create-nexst-app downloads A generator for nexst apps

Pickup packages included

There are so many packages already included, pickups are here:

Examples

See nexst-examples repository.

Features

WIP.

Contributing

WIP.

Roadmaps

  • develop main packages
    • lerna monorepo development
    • @nexst/core
    • @nexst/tsconfig
    • @nexst/tsconfig-server
    • classiii/nexst-examples
    • classiii/create-nexst-app
  • Update this README
    • Roadmaps
    • How to use
    • Pickup packages
    • Examples
    • Features
    • Contributing guilds
  • Add a README in each package

Related