• Stars
    star
    257
  • Rank 158,728 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An easiest authentication system on top of NestJS, TypeORM, NEXT.js(v9.3) and Material UI(v4).

An easiest authentication system on top of NestJS, TypeORM, NEXT.js (v9) and Material UI (v4).

Package License (MIT)

Features

  • Cross platform - Mac, Linux and Windows
  • Database synchronization with entities - powered by TypeORM
  • Server Side Rendering - powered by NEXT.js
  • API server - powered by NestJS
  • Authentication - powered by Passport
  • Material UI design

Technologies

  • Hot reloading for the developer experience :)
    • ts-node-dev - Compiles your TS app and restarts when files are modified
    • NEXT.js - The React Framework
  • Lang
  • Database
    • PostgreSQL - The World's Most Advanced Open Source Relational Database
  • ORM (Object-relational mapping)
    • TypeORM - ORM for TypeScript and JavaScript (ES7, ES6, ES5)
  • Server
    • NestJS - A progressive Node.js framework for building efficient, reliable and scalable server-side applications
      • internally using Express - Fast, unopinionated, minimalist web framework for Node.js
    • NEXT.js - The React Framework
  • Environment variables
    • dotenv - Loads environment variables from .env for nodejs projects
    • dotenv-webpack - A secure webpack plugin that supports dotenv and other environment variables and only exposes what you choose and use.
  • User authentication
    • Passport - Simple, unobtrusive authentication for Node.js
  • UI framework
    • React - A JavaScript library for building user interfaces
    • NEXT.js - The React Framework
    • Material UI - React components that implement Google's Material Design.

Setup

Database Setup

Ark uses PostgreSQL v11.

For Mac Users

# install postgresql@11
$ brew install postgresql@11

# if you want to start postgresql@11 in startup, try do this
$ brew services start postgresql@11

# [MUST] create user "arkuser" with password "arkpass"
$ createuser -P arkuser

# [MUST] create database "arkdb" owened by "arkuser"
$ createdb arkdb -O arkuser

For Windows Users

Python

Because Ark uses node.bcrypt.js, we need a Python:

windows-build-tools
  • Run npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe as Administrator
PostgreSQL
> postgresql-11.6-3-windows-x64.exe --install_runtimes 0
pgAdmin
  • Download a latest installer at https://www.pgadmin.org/download
  • Run the pgAdmin and login with a root user
  • Right click Login/Group Roles and Create > Login/Group Role
    • General Panel:
      • Name: arkuser
    • Definition Panel:
      • Password: arkpass
    • Priviledges Panel:
      • Check all Yes
  • Right click Databases and Create > Database
    • General Tab:
      • Database: arkdb
      • Owner: arkuser

Application Setup

# prepare `.env` and edit it for your own environments
$ cp .env.example .env

# install dependencies
$ yarn

# development mode
$ yarn dev

# production mode
$ yarn build
$ yarn start

The .env file is like this:

DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=arkuser
DB_PASSWORD=arkpass
DB_DATABASE=arkdb
DB_SYNCHRONIZE=true

APP_PROTOCOL=http
APP_HOST=localhost
APP_PORT=4000
APP_SESSION_SECRET=ark

Production Deployment

With production usages, please use pm2 for Node.js process managements.

# install pm2
$ npm install --global pm2

# run the app "ARK" with the config `ecosystem.config.js`
$ cd ark
$ pm2 start

The example ecosystem.config.js:

module.exports = {
  apps : [{
    name: 'ARK',
    script: '.next/production-server/main.js',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production'
    }
  }]
};

Screenshots

Register Page

Login Page

Top Page (Auth Guard)

Articles

Related

  • YARK - Yet another easiest authentication system on top of NestJS, TypeORM, react-ssr and Material UI(v4)

More Repositories

1

nextron

⚡ Next.js + Electron ⚡
TypeScript
3,908
star
2

react-ssr

React SSR as a view template engine
TypeScript
251
star
3

nuxtron

⚡ Nuxt.js + Electron ⚡
TypeScript
219
star
4

create-nextron-app

Create nextron (NEXT.js + Electron) apps in one command ⚡
JavaScript
60
star
5

webpack-typescript-react-starter

Webpack + TypeScript + React = ❤️
JavaScript
59
star
6

nest-crawler

An easiest crawling and scraping module for NestJS
TypeScript
56
star
7

nestpress

A production ready personal blogging system on top of NestJS and NEXT.js
TypeScript
41
star
8

rollup-typescript-react-starter

Rollup + TypeScript + React = ❤️
JavaScript
39
star
9

nextjs-redux-todo-app

A minimal todo app with NEXT.js on the redux architecture
TypeScript
28
star
10

react-ssr-nestjs-starter

An example of @react-ssr/nestjs-express
TypeScript
23
star
11

gfm-preview

Preview your markdown with GitHub API in real time 🎉
JavaScript
19
star
12

web-master

Web mastering tools for my personal services
TypeScript
13
star
13

nerv-ie8-boilerplate

A minimalistic boilerplate of NervJS with IE8+ and React 16 compatibility ⚡
JavaScript
10
star
14

markdown-viewer-for-firefox

[NO MAINTENANCED] GitHub flavored Markdown Viewer for **OLD** Firefox
CSS
10
star
15

LGTMify-extension

Looks Good To Me <3
TypeScript
10
star
16

tiny-pro-tips-for-windows

Tiny but pro tips for Windows
9
star
17

node-npx

A tiny npx alternative for Node.js, which executes local npm package binaries
TypeScript
7
star
18

vue-jwt-auth-example

A starter example of Vue + Vuex + JWT Authentication
TypeScript
6
star
19

editify

A pure implementation of WYSIWYG HTML editor all we needed
TypeScript
5
star
20

resolve-as-bin

Resolve a local npm package as the absolute binary path
TypeScript
5
star
21

yark

Yet another easiest authentication system on top of NestJS, prisma2, react-ssr and Material UI
TypeScript
4
star
22

viteron

⚡ vite + electron ⚡
TypeScript
4
star
23

objectio

A JavaScript object getter and setter with string literals ⚡
TypeScript
3
star
24

react-ssr-jsx-starter

An example of @react-ssr/express
JavaScript
3
star
25

react-ssr-tsx-starter

An example of @react-ssr/express
TypeScript
3
star
26

react-ssr-redux-todo-app

A redux todo example on top of @react-ssr/express
TypeScript
2
star
27

saltyshiomix

1
star
28

create-viteron-app

Create viteron (vite + electron) apps in one command ⚡
JavaScript
1
star