GithubHelp home page GithubHelp logo

qred-api's Introduction

❯ How can development teams work in parallel?

API-First Approach

  • Creating a contract between services that is followed by teams.
  • It also often involves additional planning and collaboration with the stakeholders providing feedback on the design of an API before any code is written.
  • Teams can mock APIs and test API dependencies based on the established API definition.
  • There are a lot of good API design tools like Swagger.

❯ Swagger

  • Describes the structure of the API and serves as interactive API documentation.

divider

Entity Relationship Diagram

divider

❯ API Routes

The route prefix is /api.

Route Description
/api Shows us the name, description and the version of the package.json
/swagger This is the Swagger UI with our API documentation
/api/accounts Account entity endpoint
/api/transactions Transaction entity endpoint

❯ Project Structure

Name Description
src/ Source files
src/api REST API implementation
src/api/middlewares/ Express Middlewares like helmet security features
src/api/controllers/ REST API Controllers
src/api/services/ Service layer contains the business logic, which uses the repository and other services.
src/api/models/ TypeORM Models
src/api/repositories/ Repository / DB layer
src/loaders/ Loader is a place where you can configure your app
src/public/ Static assets (fonts, css, js, img).
test Tests
test/e2e/ *.test.ts End-2-End tests (like e2e)
test/integration/ *.test.ts Integration test
test/unit/ *.test.ts Unit tests

❯ Getting Started

Set up the Development Environment

You need to set up your development environment before you can do anything.

Install Node.js and NPM

Install yarn globally

yarn global add yarn

Run the API

Go to the project dir and start your app with this yarn script.

yarn start serve

This starts a local server using nodemon, which will watch for any file changes and will restart the server according to these changes. The server address will be displayed to you as http://0.0.0.0:3000.

❯ Scripts and Tasks

All script are defined in the package-scripts.js file, but the most important ones are listed here.

Install

  • Install all dependencies with yarn install

Linting

  • Run code quality analysis using yarn start lint. This runs tslint.
  • There is also a vscode task for this called lint.

Tests

  • In-progress

❯ To improve

1. Authentication and Authorization

2. Unit, Integration, and E2E testing

3. Proper error codes and API versioning

4. DDoS and brute force attacks

❯ License

MIT

qred-api's People

Contributors

aubrian-halili avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.