Code Monkey home page Code Monkey logo

Comments (9)

Metnew avatar Metnew commented on June 14, 2024 1

Hi @cyrus-za. I'm currently working on razzle integration. Both razzle and next.js have the same concept of modify function for webpack config customization. So, yeah, nextjs integration seems possible

from suicrux.

malixsys avatar malixsys commented on June 14, 2024 1

@Metnew I know but https://github.com/Metnew/suicrux/tree/master/src/server :)

from suicrux.

Metnew avatar Metnew commented on June 14, 2024 1

It'd be cool to add example dir, like in Next/Razzle with simple examples of integration with different libs, but it makes sense only after working modify function. @malixsys

from suicrux.

Metnew avatar Metnew commented on June 14, 2024 1

@cyrus-za
I've recently made https://github.com/Metnew/next-semantic-ui-react, that could be interesting for you.

It's not a full clone of this boilerplate, just a SUIR + Next.js integration.

Fully migrate to next.js is almost impossible, too much config overwriting.

from suicrux.

cyrus-za avatar cyrus-za commented on June 14, 2024

Thanks @Metnew I look forward to see what you do with this package.

I am currently using RAN (https://github.com/Sly777/ran) and would love to get all the goodies that both RAN and SUICRUX offer.

from suicrux.

Metnew avatar Metnew commented on June 14, 2024

I was researching Razzle last few weeks and finally have some good and bad news:

  • Good news: some Razzle internals(node-externals handling, dev mode) are integrated into boilerplate.
  • Bad news: Razzle lacks plugin system. No concrete info about this "plugin system" exists in the repo.

More info about v3.0.0 release: https://github.com/Metnew/suicrux/releases/tag/v3.0.1

Next.js integration now is the primary task.
Both Razzle and Next have same Webpack re-configuration mechanism - modify function.
So, current razzle.config.js will be transformed to next.config.js.

The best case: Suicrux's Webpack config is encapsulated to modify function, which is compatible with Next, Razzle, and other libs.

from suicrux.

malixsys avatar malixsys commented on June 14, 2024

Iā€™m using NestJS with NextJS: good fit... Maybe worth investigating?

from suicrux.

Metnew avatar Metnew commented on June 14, 2024

@malixsys thanks for the recommendation, I'll surely take a look, it looks interesting.
The only issue - it's a backend framework :)

from suicrux.

malixsys avatar malixsys commented on June 14, 2024

Serves nextJS perfectly and allows adding an API easily...

// server.js
import { NestFactory } from '@nestjs/core';
import { ApplicationModule } from './app.module';
import { GlobalExceptionFilter } from './app.exceptions';
import * as express from 'express';
import * as nextjs from 'next';
import * as helmet from 'helmet';
import * as cookieParser from 'cookie-parser';
import * as bodyParser from 'body-parser';

declare const process;

const port = process.env.PORT ? Number(process.env.PORT) : 3000;
const dev = process.env.NODE_ENV !== 'production';

const next = nextjs({ dev });
const handle = next.getRequestHandler();

next.prepare()
  .then(async() => {
    const server = express();

    const app = await NestFactory.create(ApplicationModule, server);

    app.useGlobalFilters(new GlobalExceptionFilter());

    app.setGlobalPrefix('api');

    app.use(helmet());

    app.use(cookieParser());

    app.use(bodyParser.json({ limit: '50mb' }));

    app.use(bodyParser.urlencoded({ extended: false }));

    await app.init();

    server.get('*', (req, res) => handle(req, res));

    await app.listen(port);

    console.log(`> Ready on http://localhost:${port}`);
  });

from suicrux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.