{"id":13623482,"url":"https://github.com/fdaciuk/conduit-api","last_synced_at":"2025-03-17T00:32:32.370Z","repository":{"id":45865709,"uuid":"379580541","full_name":"fdaciuk/conduit-api","owner":"fdaciuk","description":"API for Real World App project (Conduit) using Node.js + TS with Functional Programming","archived":false,"fork":false,"pushed_at":"2023-05-11T17:54:37.000Z","size":531,"stargazers_count":180,"open_issues_count":2,"forks_count":24,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-13T13:30:12.117Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://conduitapi.up.railway.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fdaciuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-06-23T11:31:39.000Z","updated_at":"2024-08-07T19:35:28.000Z","dependencies_parsed_at":"2024-01-14T08:11:54.683Z","dependency_job_id":"345b6bf0-6970-444b-9b23-c6f75c62acf8","html_url":"https://github.com/fdaciuk/conduit-api","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdaciuk%2Fconduit-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdaciuk%2Fconduit-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdaciuk%2Fconduit-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdaciuk%2Fconduit-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdaciuk","download_url":"https://codeload.github.com/fdaciuk/conduit-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221669350,"owners_count":16860855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-08-01T21:01:32.295Z","updated_at":"2024-10-27T11:35:28.874Z","avatar_url":"https://github.com/fdaciuk.png","language":"TypeScript","readme":"# Conduit API\n\n\u003e API for Real World App (Conduit) using Node.js + TypeScript with Functional Programming\n\n## Required global dependencies\n\n- Node.js v16\n- Yarn v1\n\n## Up \u0026 Running\n\n1. Install local dependencies:\n\n```terminal\nyarn\n```\n\n2. Tests (watch mode):\n\n```terminal\nyarn test:watch\n```\n\n3. Get the server and database up:\n\n```terminal\nyarn dev\n```\n\nTo stop the server watch, just press `Ctrl + c`.\n\n4. Stop docker after get server down:\n\n```\nyarn docker:down\n```\n\n5. Destroy all data from DB:\n\n```\nyarn docker:destroy\n```\n\n## Scripts\n\n| Script                        | Description                                                   |\n| ----------------------------- | ------------------------------------------------------------- |\n| `yarn start`                  | Run production server                                         |\n| `yarn dev`                    | Get database up and run dev server                            |\n| `yarn server`                 | Run only dev server                                           |\n| `yarn docker:up`              | Get docker configuration up                                   |\n| `yarn docker:down`            | Get docker configuration down                                 |\n| `yarn docker:destroy`         | Destroy database and all docker data                          |\n| `yarn migrate \u003cname\u003e`         | Run Prisma migration (You must provide a name)                |\n| `yarn migration`              | Run existent Prisma migrations                                |\n| `yarn migration:prod`         | Run existent Prisma migrations on production                  |\n| `yarn test`                   | Run unit and integration tests once (great to be used in CI)  |\n| `yarn test:unit`              | Run unit tests once                                           |\n| `yarn test:watch`             | Run unit tests in watch mode                                  |\n| `yarn test:integration`       | Run integration tests once                                    |\n| `yarn test:integration:watch` | Run integration tests in watch mode                           |\n| `yarn lint`                   | Run linter                                                    |\n| `yarn lint:fix`               | Fix lint errors                                               |\n| `yarn type-check`             | TS typechecking                                               |\n| `yarn prepare`                | Not suposed to be manually used. It's just to configure husky |\n| `yarn build`                  | Generates production build                                    |\n| `yarn ci`                     | Run lint, typechecking and tests (meant to be used in a CI)   |\n| `yarn update-deps`            | Update both dependencies and devDependencies                  |\n\n## Tree structure\n\nThis project uses Hexagonal Architecture (Ports \u0026 Adapters) with Functional Programming.\n\n```terminal\n.\n├── src\n│   ├── config\n│   │   ├── tests\n│   │   │   └── fixtures\n│   │   └── module-alias.ts\n│   ├── core\n│   │   ├── \u003cdomain / entity\u003e\n│   │   │   ├── use-cases\n│   │   │   │   ├── \u003cuse-case\u003e-adapter.ts\n│   │   │   │   ├── \u003cuse-case\u003e.test.ts\n│   │   │   │   ├── \u003cuse-case\u003e.ts\n│   │   │   └── types.ts\n│   │   └── types\n│   │       ├── \u003ctype\u003e.test.ts\n│   │       └── \u003ctype\u003e.ts\n│   ├── ports\n│   │   ├── adapters\n│   │   │   └── \u003cport-adapter\u003e\n│   │   └── \u003cport\u003e\n│   ├── app.ts\n│   └── index.ts\n├── .env.example\n├── jest.config.integration.js\n└── jest.config.js\n\n```\n| Directory / File                     | Description                                                                                                                                                         |\n| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `src`                                | All source code write in TypeScript must be in this directory.                                                                                                      |\n| `src/index.ts`                       | Main entry point for initial configuration of the project. **Do not edit this file.** Start with `src/app.ts`.                                                      |\n| `src/app.ts`                         | Project entry point. You can call your first `port` here and boot your providers that should start before your server.                                              |\n| `src/config`                         | All configurations can live here.                                                                                                                                   |\n| `src/config/tests/fixtures`          | Helpers for using in tests.                                                                                                                                         |\n| `src/config/module-alias.ts`         | Module configurations for using `@/` instead of `../../` on dev, tests and production environments.                                                                 |\n| `src/core`                           | Pure domain implementations. `core` files must **not know** any `port` or `adapter`, nor anything ouside `core` directory.                                          |\n| `src/core/\u003cdomain/entity\u003e`           | Inside the `core` directory, you can organize your files by domain or entity.                                                                                       |\n| `src/core/\u003cdomain/entity\u003e/types`     | Start point for modelling your domain / entity with TypeScript types.                                                                                               |\n| `src/core/\u003cdomain/entity\u003e/use-cases` | Here you can put your functions with business rules for this specific domain / entity, and the adapters that `ports` will use.                                      |\n| `src/core/types`                     | Here you can put the types that are not related with any of your domains or entities.                                                                               |\n| `src/helpers`                        | Here you can put your global helpers.                                                                                                                               |\n| `src/ports`                          | Anything with external world contact. When you need to access something on `core`, you must use an `adapter`.                                                       |\n| `src/ports/adapters`                 | Adapters for ports. For example: You can have a `database` adapter that can use `Postgres` or `MariaDB`. An `http` adapter that can consume `express` or `fastify`. |\n| `src/ports/\u003cport\u003e`                   | Here you can create your raw `ports` with real implementation: `express` / `fastify` as http server, `postgres` / `mariadb` as databases, etc.                      |\n| `.env.example`                       | List of Environment Variables. Please, copy this file and create a new `.env` file to use Env Vars.                                                                 |\n| `jest.config.integration.js`         | Jest configuration file for integration tests.                                                                                                                      |\n| `jest.config.js`                     | Main Jest configuration file.                                                                                                                                       |\n\n## Important usage information\n\n### Environment Variables\n\nYou can use env vars by copying the `.env.example` file to a new `.env` file on the root of the project.\nTo document all used env vars, and get autocomplete when use the function `env('YOU_VAR')`,\njust put all your env vars on file `src/helpers/env.ts`.\n\n### Global import\n\nAll files and dirs inside `src` directory can be imported using `@/`.\nPrefer using this way over local import (`../../`).\n\n## License\n\nMIT\n","funding_links":[],"categories":["TypeScript","Packages"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdaciuk%2Fconduit-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdaciuk%2Fconduit-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdaciuk%2Fconduit-api/lists"}