Giter Club home page Giter Club logo

cna's Introduction

CNA (create next.js app)

Create next.js web app based on next.js.

Quick overview

npm install -g cna

cna new my-next-app
cd my-next-app/
npm start

Getting started

Installation

install it once globally npm

npm i -g cna

You’ll need to have Node >= 6 on your machine. You can use nvm to easily switch Node versions between different projects.

You don't need to use Node as your primary backend. The Node installation is only required for CNA and running the Next.js server in development/production.

Creating an App

To create a new app, run commands below:

cna new my-app

cd my-app

It will create an project with name my-app with structure below:

my-app
├── assests/
├── node_modules/
├── components
│   └── Article/
│   └── Header/
└── containers
    └── Home/
├── hoc/
    └── withLayout.js
├── middlewares/
    └── clientMiddleware.js
├── pages/
    └── _document.js
    └── index.js
├── reducer/
    └── index.js
├── static/
    └── img/
    └── manifest.json
├── utils/
    └── constants.js
    └── request.js
├── .babelrc
├── .gitignore
├── config.js
├── index.js
├── next.config.js
├── package.json
├── README.md
├── server.js
├── store.js
├── yarn.lock

Generators

Provide commands to create new: page, container, component and HOC.

Note: You should stay at root directory of project and run commands.

cna new my-app

To create new web application with name my-app

cna page

To create new page. New page is located at pages directory.

cna container

To create new container. New page is located at containers directory.

cna component

To create new component. New page is located at components directory.

cna hoc

To create new HOC. New page is located at hocs directory.

Commands

npm start or yarn start

Runs app in development mode.

Open http://localhost:3000 to view it in the browser.

The app will automatically reload when code changes.

npm run build or yarn run build

Builds app in production mode.

It correctly bundles React in production mode and optimizes the build for the best performance.

npm run production or yarn run production

Builds and runs app in production mode.

Now your app is ready to deploy.

Demo

Screenshot

screen shot 2017-08-16 at 5 05 09 pm

iOS full screen

aug-16-2017 17-04-40

What's inside?

Technologies

Data source

Alternatives

If you don’t agree with the choices made in this project, you might want to explore alternatives with different tradeoffs. Some of the more popular and actively maintained ones are:

cna's People

Contributors

davidnguyen11 avatar

Watchers

 avatar James Cloos avatar

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.