Giter Site home page Giter Site logo

coeus-project's Introduction

coeus-project

Project Template for Coeus. A living welcome page is here.

Quick Start

  • Download zip from the master branch. (If you are a chinese user, there is a version with all deps which have been installed in branch master-with-deps.)
  • Unzip the project and rename the project to what you want.
  • Install deps. (skip when using master-with-deps)
cd ${project_path}
npm install
  • Run server for development.
npm run development
  • Access to http://localhost:3000.

Configuration

By default, the project provides two configuration for webpack. One is webpack.development.js used by the dev server, the other is webpack.production.js.

For Development

As you can see in webpack.development.js, hot reload is on. If you use linux, hot loader may not work at the first time. A troubleshooting here might help you.

For Production

npm run build

No react, but react-lite.

Production Server

A default production server(powered by koajs) is provided to response static resources and your coeus app.

# listening on port 3001
npm run production

Additionally, as coeus's Router can not handle 404 land page correctly, some logic is coded as a middleware to handle 404 land page in server. If you ask why 404 land page can not be handled by Router, that's a good question and here is the answser:

404 is a state in coeus's Router rather than a page, which is a good design to escape depressing traps allowing 404 path pushing in history. Well, a deeper concern is token into account of course. I am always trying to make coeus app be a true client application completely based on data state. That's the core. All components should work fine depending on state, a clear data structure which we can read and test easily. Once coeus is loaded and up, all changes among components including errors and exceptions should be shown in state, not actions, not default pages, not conventional behaviors which is hard to be expected and controlled. Everything will be extremely clean and free if you expose some public data rather than some weird interfaces. So just expose state and listen to them. Components relate to each other in such a simple way!

The server is written simply as a demo now. And if you are looking for a manager to make server run in daemon which is a demand for real production environment, pm2 is recommended.

Something like this:

npm install -g pm2
cd ${project_path}
# start service
pm2 start server/production.js
# add auto start script to your platform
pm2 startup

coeus-project's People

Contributors

chieveit avatar

Watchers

 avatar  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.