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 | core package | |
@nexst/tsconfig | A tsconfig for the nexst app | |
@nexst/tsconfig-server | A tsconfig for the nexst server app | |
create-nexst-app | A generator for nexst apps |
Pickup packages included
There are so many packages already included, pickups are here:
- @nestjs/core@^6.0.4
- @nestjs/common@^6.0.4
- @nestjs/platform-express@^6.0.4
- @nestjs/typeorm@^6.0.0
- typeorm@^0.2.16
- next@^8.0.3
- react@^16.8.6
- react-dom@^16.8.6
- dotenv@^7.0.0
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