orientation-api
.
├── .babelrc # Babel config
├── .eslintrc.js # ESLint config
├── .sequelizerc # Sequelize config
├── CONTRIBUTING.md
├── docs
│ └── ...
├── hooks # Git hooks
│ └── pre-commit
├── LICENSE
├── nodemon.json # Nodemon config
├── package.json
├── package-lock.json
├── README.md
├── sample.env # Sample environment variables file
├── migrations
│ └── <timestamp-name>.js
├── seeders
│ └── <timestamp-name>.js
└── src
├── config
│ └── sequelize.js # Database config
├── constants
│ └── api.js
├── pre_handlers
│ ├── authantication.js
│ ├── complatePath.js
│ └── index.js
│ ├── exceptions
│ │ ├── errorHandler.js
│ │ └── HTTPError.js # Custom HTTP error
├── models
│ ├── index.js
│ └── <modelName>.js
├── services
│ └── <serviceName>.js
├── routes
│ ├── <routeName>
│ │ └── index.js
│ └── index.js
├── joi.js # For Joi multiple error
├── router.js
├── sequelize.js # Database connection
├── server.js # Server start point
└── utils
├── encription.js
├── generateSlug.js
└── sendEmail.js
Install
git clone https://github.com/mavidurak/orientation-api.git
cd orientation-api
Setup
Install dependencies
npm install
Set environment variables
Copy sample.env file then changes values.
cp sample.env .env
APP_PORT=4000
DATABASE=mavidurak
TEST_DATABASE=mavidurak_test
DATABASE_USERNAME=root
DATABASE_PASSWORD=
DATABASE_HOST=localhost
API_PATH=http://localhost:4000
DASHBOARD_UI_PATH=http://localhost:8080
EMAIL_HOST=
EMAIL_PORT=
EMAIL_SECURE=
EMAIL_USER=
EMAIL_PASSWORD=
Send mail with smtp.gmail. If you use smtp.google, EMAIL_SECURE=
is must be true
,
Send mail with smtp.office365.com. If you use smtp.office365.com, EMAIL_SECURE=
leave blank.
Migrate
Create database then migrate it
npm run migrate
Seed
Insert random data into database
npm run seed
Start
npm start
Lint
npm run lint
Build Hooks
Build git hooks
npm run build-hooks
Build Code
npm run build