Skip to content

A swift TypeScript-based Express web framework with GraphQL.

License

Notifications You must be signed in to change notification settings

yepengding/swift-express-graphql

Repository files navigation

Swift Express with GraphQL

A swift TypeScript-based Express web framework based on swift-express. It adopts the aspect-oriented programming style and implements useful modules like logging aspect and global exception handler to boost the development. GraphQL is integrated with the REST API.

Quickstart

By Docker Compose

  1. Duplicate .env.example as .env and configure environment variables;
  2. Configure Dockerfile and docker-compose.yml;
  3. Compose and run containers.
docker compose up -d

By Docker

  1. Duplicate .env.example as .env and configure environment variables;
  2. Configure Dockerfile;
  3. Build Docker image
docker build -t vcs .
  1. Run in container
docker run -p <host_port>:<container_port> --name <container_name> -d vcs

Manually

  1. Install dependencies
yarn install
  1. Duplicate .env.example as .env and configure environment variables

  2. Build project to dist

npm run build
  1. Run project
npm run start

API Document Endpoint

*/api-docs/

Development

Create new models

Refer to User.ts and User.dto.ts to create new entities and data transfer objects in folder src/models.

Create new repositories

Refer to UserRepository.ts to create new repositories in folder src/repositories.

Create new services

Refer to UserService.ts to create new services in folder src/services.

Create new resolvers

Refer to UserResolver.ts to create new resolvers in folder src/resolvers

Create new controllers (Optional)

Refer to UserController.ts to create new controllers in folder src/controllers

Run in dev

Run project in development server

npm run dev

Run code analysis

npm run lint

References