Get started
Initialize new application

Setting SugoiJS application

Setting a SugoiJS application is only two steps away.
Simple init of new application

Installing @sugoi/cli

1
$ npm i -g @sugoi/cli
Copied!

Run SugoiJS initialization wizard

Use the initialization wizard to define your needs.
1
$ sugoi init <app name> && cd <app name>/server
Copied!
Or
1
$ sgi init <app name> && cd <app name>/server
Copied!

Run

All you left to do is to to run your server!
1
$ npm start
Copied!

Development command (live reload)

For using the live reload feature you need to
  1. 1.
    Build with watch by using the dev action - command session won't get closed
1
npm run dev
Copied!
2. Run the server with nodemon - command session won't get closed
1
npm run start:watch
Copied!

Enjoy your new server

As soon you will done the installation you should be able to reach http://localhost:3000 for reach the client application andhttp://localhost:3000/index for reach the API endpoint.

File structure

1
├───client <-- Your web client application directory
2
│ └───assets
3
├───common <-- Common (shared) files between client and server
4
└───server <-- Your SugoiJS server directory
5
├───configuration <-- Build config (environment based configurations)
6
│ └───<env | default>
7
| └── variables.js <-- environment variables for this build
8
| └── security.js <-- server security configurations
9
| └── ssl.js <-- ssl configurations
10
| └── <Custom>.js <-- custom configurations
11
└───src <-- Your server app source code
12
├───app <-- Bootstrap module, Server initialize and listener files, 'authorization' class(optional)
13
│ └───classes
14
├───config <-- Server configuration (services, paths, etc.)
15
└───modules <-- All of you application modules
16
└───index <-- Single module
17
├───controllers <-- Modules' controllers
18
├───models <-- Modules' models(optional)
19
└───services <-- Modules' services
Copied!
Last modified 2yr ago