Skip to content
프로젝트

AlaaMezian/NodeJs-backend-structure

GitHub에서 보기

소개

async/await를 완전히 지원하고 적절한 오류 처리, 기본 Joi 검증, 객체 지향 para-diagram 등을 포함한 Node.js 프로젝트용 기본 구조입니다.

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

NodeJS Project Structure

Recently I have started working on a new project and the issue that I faced was spending a lot of time building the project structure based on the best practices, especially with JavaScript/NodeJS that has a lot of approaches. I couldn't find any place that wraps the best practices into a single project, so I decided to make it on my own.

In this repository, I don't aim to provide any optimal solution as each project have its own necessity but to help anyone that is starting with a NodeJS project and can't find any inspiration on how to start building the project to take this project as the starting point.

Some of the good practices followed in this repository:

  • async & await support
  • WinstonJS logger implementation
  • Error Handling
  • Sequelize Support
  • Basic Joi Validation
  • Open API specification implemented through swagger-jsdocs and swagger-ui
  • JWT implementation
  • Enviroment variables to hold configuration values .env file
  • OOP (Object-Oriented Programming)
  • I followed airbnb coding standard with eslint, to help keep things into prespective.

How to start the project:

  • First, you clone the project by using the following command:
    git clone https://github.com/AlaaMezian/NodeJs-backend-structure.git
  • Install node version 8.11.0 or use nvm to downgrade your node version.
  • Delete the existing package.lock.json and run npm install
  • Then you create a postgres database named iLrn with the following credentials:
username: postgres
password: password
  • Run the migration using the following command: npx sequelize-cli db:migrate
  • Lastly, you run npm start

Future improvements utilize component based structure.
Please feel free to :star: and happy programming :v:

관련 프로젝트 살펴보기

불러오는 중…