GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - azerothcore/universal-node: Boilerplate for Universal NodeJS server

BranchesTags
Open more actions menu

Latest commit

 

History

37 Commits
37 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
apps
apps
 
 
conf
conf
 
 
deps
deps
 
 
modules
modules
 
 
src
src
 
 
srv/upload
srv/upload
 
 
.babelrc
.babelrc
 
 
.editorconfig
.editorconfig
 
 
.env.dist
.env.dist
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.gitkeep
.gitkeep
 
 
.gitmodules
.gitmodules
 
 
.sequelizerc
.sequelizerc
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
_config.yml
_config.yml
 
 
app.sh
app.sh
 
 
jsconfig.json
jsconfig.json
 
 
package.json
package.json
 
 

Repository files navigation

HW Universal Node

This is a boilerplate project that allows you to start creating an Universal NodeJS Server. It uses Sequelize and Apollo Express server for GraphQL, automatically connected by sequelize-graphql-schema library.

It allows you to have a REST capable server with free graphql APIs for your database! Letting you to focus on writing sequelize models and applying your security/logic middlewares.

No need to write SQL, schemas, queries and mutations!*

  • If you need more advanced queries/mutations you can overwrite/extends autogenerated methods.

Moreover it's preconfigured to have:

  • path aliases
  • full-working intellisense
  • debug configurations
  • modular directory structure
  • formatting rules and settings for visual studio code
  • automatic installation of missing npm modules at start
  • GraphQL and REST ready
  • it works great with: HW Universal Client

and many other useful features allowing you to develop at the best!

So please, use VSCode, try to be DRY, comment your code with JSDocs, learn to use Javascript ES6 best practices and patterns!

Note: we're using 4 spaces (instead of 2 that is common in javascript because of callback hell) because it discourages nesting. In fact reducing the spaces to fit more levels in is a counterproductive idea. Use async/await as much as possible.

How to install

  1. npm install
  2. create a copy of /src/conf/conf.dist.js and rename in conf.js (do not delete or rename the .dist.js file directly!)
  3. create a copy of /src/conf/database.dist.js and rename in database.js (do not delete or rename the .dist.js file directly!)
  4. Configure your conf.js and database.js

How to develop

There are various tools inside this repo, however in most cases you just need to edit following files:

  1. package.json: app name, version etc.
  2. conf/: runtime configuration files
  3. src/ sources to implement your logic
  4. optional: other /apps/ configurations

How to run (development):

  1. npm run start

Directory Structure

This project follows partially the hw-core directory structure on (CRA folder structure)[https://facebook.github.io/create-react-app/docs/folder-structure]

With following specs:

  • apps: tools used by the project for specific tasks
  • conf: platform configuration files
  • deps: internal reusable dependencies (they can be shared between projects)
  • modules: optional and pluggable modules to extend app functionalities
  • src: application sources
    • database: sequelize migrations and seeders
    • server: server boot files
    • system: models/entities and apis

For internal deps and modules we're using subrepo instead of subtree/submodule that are not enough to both include a git based dependency and working on it at the same time. You can check the app.sh script to see how to sync your dependencies.

Folder aliases:

We're monkey-patching the CRA via craco library allowing us to create some useful path alias to avoid relative path hell: ( ../../ )

So you can use paths defined in cra-config.js file:

    "@this": ".", // this is the root alias
    "@hw-core": '/deps/hw-core'

About

Boilerplate for Universal NodeJS server

azerothcore.github.io/universal-node/

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.