Skip to content

mylims/backend

Repository files navigation

backend

build status

Backend for MyLims project.

Usage

docker-compose build
docker-compose up -d
docker-compose logs mylims_server

If the server is run outside the docker environment, it's necessary export the following environmental variables:

  • DB_USER: MongoDB username (checked against the admin database)
  • DB_PWD: MongoDB password
  • DB_HOST: MongoDB host address (default to localhost)
  • DB_PORT: MongoDB port (default to 27017)

For the testings there's no necessary to run against a local database instance, it is mocked using jest mocks.

Files structure

Inside the src directory the entry file is index.ts, that creates the server and joins the resolvers and schemas into production. There are also 4 files for each class that structure the project:

  • schemas: GraphQL schemas for type definitions, queries and mutations.
  • resolvers: GraphQL resolvers for queries and mutations.
  • models: Classes for data manipulation and search.

Each class has these files named like this: name.model.ts, name.resolver.ts and name.schema.ts. Also each test has the same name of the resource to test, following the jest convention resource.test.ts, for example model.test.ts.

License

MIT

About

Backend server for MyLims project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages