Files organisation
To keep things well structured, we will slip our code in different folders in packages/api.
/project configuration filessrcall the code we write for the app.configone file per environment.entitiesour data models.migrationsif we need to alter the database.routersone folder per route.
This is the final files structure:
.
├── jest.config.js
├── package.json
├── src
│  ├── app.ts
│  ├── config
│  │  ├── ci.ts
│  │  ├── index.ts
│  │  ├── local.ts
│  │  ├── production.ts
│  │  ├── shared.ts
│  │  └── staging.ts
│  ├── containers.ts
│  ├── coverage
│  │  ├── Emoji.ts.html
│  │  ├── base.css
│  │  ├── containers.ts.html
│  │  ├── index.html
│  │  ├── prettify.css
│  │  └── sort-arrow-sprite.png
│  ├── entities
│  │  ├── Link.ts
│  │  ├── User.ts
│  │  └── index.ts
│  ├── index.ts
│  ├── middlewares
│  │  ├── RateLimiter
│  │  │  ├── index.spec.ts
│  │  │  └── index.ts
│  │  └── index.ts
│  ├── migrate.ts
│  ├── migrations
│  │  └── 001_example.ts
│  ├── routers
│  │  ├── Emoji
│  │  │  ├── index.spec.ts
│  │  │  └── index.ts
│  │  ├── GraphQL
│  │  │  ├── helpers
│  │  │  │  ├── PaginatedArgs.ts
│  │  │  │  ├── PaginatedResponse.ts
│  │  │  │  └── index.ts
│  │  │  ├── index.ts
│  │  │  └── resolvers
│  │  │  ├── Health.ts
│  │  │  ├── Link
│  │  │  │  ├── Link.spec.ts
│  │  │  │  ├── Link.ts
│  │  │  │  ├── LinkInput.ts
│  │  │  │  └── index.ts
│  │  │  ├── User
│  │  │  │  ├── User.spec.ts
│  │  │  │  ├── User.ts
│  │  │  │  ├── UserAuthInput.ts
│  │  │  │  └── index.ts
│  │  │  └── index.ts
│  │  └── index.ts
│  ├── sequelize.ts
│  └── setupTests.ts
├── tsconfig.json
├── tslint.json
└── yarn.lockLast updated