/bbn

Primary LanguageTypeScriptMIT LicenseMIT

Blog BE Next

The backend platform for Yancey Official Blog with Node.js, NestJS, MongoDB, GraphQL, JWT and more...

This library is part of the BEG (Blog Environment Group) ecosystem 📖

Build Status Codacy Badge codecov FOSSA Status

License: MIT Code Style Version PRs Welcome Commitizen friendly

Gitter Average time to resolve an issue Percentage of issues still open

⭐️ Found it cool? Want more updates? Show your support by giving a ⭐️


Menu

Available Scripts

In the project directory, you can run:

yarn build

Builds the app for production to the dist folder. This script will delete the old dist folder before build.

yarn watch

Runs the app in the development mode. Open http://localhost:3002 to view it in the browser. The page will reload if you make edits. You will also see any lint errors in the console.

yarn document

Uses compodoc to generate an awesome document for this app.

yarn test

Runs Jest via yarn test.

yarn commit

An optional way to use git cz if you don't want to install commitizen globally.

⇧ back to top

Contributing

The main purpose of this repository is to continue to evolve BEG (Blog Environment Group), making it faster and easier to use. Development of Blog BE Next happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Blog BE Next.

BEG has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Blog BE Next.

Good Issues

Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

Uses Commitizen

This app follows the Angular Team's Commit Message Guidelines, your commit will be checked by commitlint, please use git cz instead of git commit. For this reason, you should install commitizen globally or use yarn commit instead.

Uses Env Files

Rename env/.env.example to 'production.env' and 'development.env' and save to the env file folder. Then replace those environment variables with your own. Both DATABASE_USER and DATABASE_PWD are optional parameters in development.env and test.env file. Furthermore, NEED_SIMULATE_NETWORK_THROTTLE is only taken efforts in the development environment.

NODE_ENV=<YOUR_NODE_ENV>
APP_PORT=<YOUR_APP_PORT>

DATABASE_HOST=<YOUR_DATABASE_HOST>
DATABASE_PORT=<YOUR_DATABASE_PORT>
DATABASE_USER=<YOUR_DATABASE_USER>
DATABASE_PWD=<YOUR_DATABASE_PWD>
DATABASE_COLLECTION=<YOUR_DATABASE_COLLECTION>

BANDWAGON_SECRET_KEY=<YOUR_BANDWAGON_SECRET_KEY>
BANDWAGON_SERVER_ID=<YOUR_BANDWAGON_SERVER_ID>

ALI_ACCESS_KEY_ID=<YOUR_ALI_ACCESS_KEY_ID>
ALI_ACCESS_KEY_SECRET=<YOUR_ALI_ACCESS_KEY_SECRET>
ALI_OSS_BUCKET=<YOUR_ALI_OSS_BUCKET>
ALI_SMS_SIGN_NAME=<YOUR_ALI_SMS_SIGN_NAME>
ALI_SMS_TEMPLATE_CODE=<YOUR_ALI_SMS_TEMPLATE_CODE>

IP_STACK_ACCESS_KEY=<YOUR_IP_STACK_ACCESS_KEY>

GOOGLE_RECAPTCHA_KEY=<YOUR_GOOGLE_RECAPTCHA_KEY>

JWT_SECRET_KEY=<YOUR_JWT_SECRET_KEY>
JWT_EXPIRES_TIME=<YOUR_JWT_EXPIRES_TIME>

# Only works in the development environment
NEED_SIMULATE_NETWORK_THROTTLE=<BOOLEAN>

E2E Test

We use e2e test for every module and test them at CI stage, you must write related test cases before PR.

⇧ back to top

Changelogs

The following are prehistoric changelogs on building infrastructure for this app. Just as a memorial. See the real detailed changes for each release are documented in the CHANGELOG.

  • 2019-12-03 Integrates e2e test.

  • 2019-11-26 Integrates JWT.

  • 2019-11-07 Integrates dotenv.

  • 2019-11-04 Integrates GraphQL.

  • 2019-10-20 Integrates MongoDB and write the first RESTful CRUD.

  • 2019-10-12 Initital repo.

⇧ back to top

TODOs

  • Full text search for post

  • Vilidation schema optimization

  • Support forget password

  • Dockerize

⇧ back to top

License

Blog BE Next is under the MIT licensed. See the LICENSE file for the full license text.