All Projects → app-generator → api-server-nodejs

app-generator / api-server-nodejs

Licence: other
Nodejs API Server - Express / SQLite / TypeORM | AppSeed

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to api-server-nodejs

django-datatables-sample
Django - Datatables Sample | AppSeed
Stars: ✭ 47 (-72.51%)
Mutual labels:  appseed, appseed-sample
babel-example
Example how to use TypeORM with JavaScript + Babel.
Stars: ✭ 51 (-70.18%)
Mutual labels:  typeorm
nest-rest-typeorm-boilerplate
🍱 backend with nest (typescript), typeorm, and authentication
Stars: ✭ 142 (-16.96%)
Mutual labels:  typeorm
microservice-template
📖 Nest.js based microservice repository template
Stars: ✭ 131 (-23.39%)
Mutual labels:  typeorm
Wern-Fullstack-Template
React, Next.js, MaterialUI, Styled-Components, TypeGraphQL, URQL, ApolloServer (express), TypeORM, PostgreSQL, Node.js, TypeScript
Stars: ✭ 173 (+1.17%)
Mutual labels:  typeorm
sf-nest-admin
🚀 基于NestJs + TypeScript + TypeORM + Redis + MySql + Vue2 + Element-UI编写的一款简单高效的前后端分离的权限管理系统
Stars: ✭ 125 (-26.9%)
Mutual labels:  typeorm
argon-dashboard-flask
Argon Dashboard - Flask Template | Creative-Tim
Stars: ✭ 52 (-69.59%)
Mutual labels:  appseed
flask-dashboard-tabler
Flask Dashboard - Tabler Design | AppSeed
Stars: ✭ 19 (-88.89%)
Mutual labels:  appseed
flask-gradient-able
Gradient Able - Open-Source Flask Dashboard | AppSeed
Stars: ✭ 59 (-65.5%)
Mutual labels:  appseed
ecoleta-api
♻ API of an application to help people find collection points for recycling, made with express, typescript and typeorm - Next Level Week
Stars: ✭ 16 (-90.64%)
Mutual labels:  typeorm
node-ts-api-base
REST API boilerplate made with Express + NodeJS
Stars: ✭ 87 (-49.12%)
Mutual labels:  typeorm
server
Core server in the Alkemio platform, offering a GraphQL api for interacting with the logical domain model.
Stars: ✭ 20 (-88.3%)
Mutual labels:  typeorm
angular-react-microfrontend
🚧 React vs Angular ? Why not both ! Micro frontend demo using Angular and React alongs with a NodeJS API
Stars: ✭ 17 (-90.06%)
Mutual labels:  typeorm
react-soft-ui-dashboard
React Dashboard - Soft UI Dashboard | AppSeed
Stars: ✭ 171 (+0%)
Mutual labels:  appseed
jinja-material-kit
Jinja Template - Material Kit 2 (Bootstrap 5) | AppSeed
Stars: ✭ 14 (-91.81%)
Mutual labels:  appseed
nest-convoy
[WIP] An opinionated framework for building distributed domain driven systems using microservices architecture
Stars: ✭ 20 (-88.3%)
Mutual labels:  typeorm
prime-nestjs
A production-ready NestJS boilerplate using Typescript, Postgres, TypeORM, and Docker.
Stars: ✭ 140 (-18.13%)
Mutual labels:  typeorm
IssueTracker-40
Github IssueTracker Clone Project
Stars: ✭ 18 (-89.47%)
Mutual labels:  typeorm
typeorm-factories
Create factories for your TypeORM entities. Useful for NestJS applications
Stars: ✭ 43 (-74.85%)
Mutual labels:  typeorm
django-black-dashboard
Django Dashboard Black - Open-source Seed Project | AppSeed
Stars: ✭ 225 (+31.58%)
Mutual labels:  appseed

Nodejs API Server

Express / Nodejs Starter with JWT authentication, and SQLite persistance - Provided by AppSeed App Generator. Authentication Flow uses json web tokens via Passport library - passport-jwt strategy.


Features:

  • API Definition - the unified API structure implemented by this server
  • Simple, intuitive codebase - can be extended with ease.
  • TypeScript, Joy for validation
  • Stack: NodeJS / Express / SQLite / TypeORM
  • Auth: Passport / passport-jwt strategy
  • 🚀 Instant Deploy on RENDER using Python Deployer
    • python.exe deployer.py nodejs <THIS_REPO>

Tested with:

NodeJS NPM YARN
v18.0.0
v17.0.0
v16.13.0
v16.0.0

Can be used with other React Starters for a complete Full-Stack experience:

React Node JS Berry React Node Soft Dashboard React Node Horizon
React Node JS Berry React Node Soft Dashboard React Node Horizon

Nodejs API Server - Open-source Nodejs Starter provided by AppSeed.


Requirements


How to use the code

Step 1 - Clone the project

$ git clone https://github.com/app-generator/api-server-nodejs.git
$ cd api-server-nodejs

Step 2 - Install dependencies via Yarn

$ yarn

Step 3 - Run the SQLite migration via TypeORM

$ yarn typeorm migration:run

Step 4 - Start the API server (development mode)

$ yarn dev

Step 5 - Production Build (files generated in build directory)

$ yarn build

Step 6 - Start the API server for production (files served from build/index.js)

$ yarn start

The API server will start using the PORT specified in .env file (default 5000).


Codebase Structure

< ROOT / src >
     | 
     |-- config/                              
     |    |-- config.ts             # Configuration       
     |    |-- passport.ts           # Define Passport Strategy             
     | 
     |-- migration/
     |    |-- some_migration.ts     # database migrations
     |
     |-- models/                              
     |    |-- activeSession.ts      # Sessions Model (Typeorm)              
     |    |-- user.ts               # User Model (Typeorm) 
     | 
     |-- routes/                              
     |    |-- users.ts              # Define Users API Routes
     | 
     | 
     |-- index.js                   # API Entry Point
     |-- .env                       # Specify the ENV variables
     |                        
     |-- ************************************************************************

SQLite Path

The SQLite Path is set in .env, as SQLITE_PATH


Database migration

Generate migration:

$ yarn typeorm migration:generate -n your_migration_name

run migration:

$ yarn typeorm migration:run

API

For a fast set up, use this POSTMAN file: api_sample

Register - api/users/register

POST api/users/register
Content-Type: application/json

{
    "username":"test",
    "password":"pass", 
    "email":"[email protected]"
}

Login - api/users/login

POST /api/users/login
Content-Type: application/json

{
    "password":"pass", 
    "email":"[email protected]"
}

Logout - api/users/logout

POST api/users/logout
Content-Type: application/json
authorization: JWT_TOKEN (returned by Login request)

{
    "token":"JWT_TOKEN"
}

Run the Tests

yarn test


Credits

This software is provided by the core AppSeed team with an inspiration from other great NodeJS starters:



Node JS API Server - provided by AppSeed App Generator

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].