master 56ac4e120202 cached
70 files
34.4 KB
11.7k tokens
19 symbols
1 requests
Download .txt
Repository: ejazahm3d/fullstack-turborepo-starter
Branch: master
Commit: 56ac4e120202
Files: 70
Total size: 34.4 KB

Directory structure:
gitextract_s_o25e31/

├── .dockerignore
├── .github/
│   └── workflows/
│       ├── api.yaml
│       └── web.yaml
├── .gitignore
├── LICENSE
├── README.md
├── apps/
│   ├── api/
│   │   ├── .eslintrc.js
│   │   ├── .prettierrc
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── nest-cli.json
│   │   ├── package.json
│   │   ├── prisma/
│   │   │   ├── migrations/
│   │   │   │   ├── 20220307034109_initial_migrate/
│   │   │   │   │   └── migration.sql
│   │   │   │   └── migration_lock.toml
│   │   │   └── schema.prisma
│   │   ├── src/
│   │   │   ├── app.controller.spec.ts
│   │   │   ├── app.controller.ts
│   │   │   ├── app.module.ts
│   │   │   ├── app.service.ts
│   │   │   ├── config/
│   │   │   │   └── environment-variables.ts
│   │   │   ├── main.ts
│   │   │   └── persistence/
│   │   │       ├── persistence.module.ts
│   │   │       └── prisma/
│   │   │           ├── prisma.service.spec.ts
│   │   │           └── prisma.service.ts
│   │   ├── test/
│   │   │   ├── app.e2e-spec.ts
│   │   │   └── jest-e2e.json
│   │   ├── tsconfig.build.json
│   │   ├── tsconfig.json
│   │   └── webpack-hmr.config.js
│   └── web/
│       ├── .eslintrc.js
│       ├── Dockerfile
│       ├── README.md
│       ├── jest.config.js
│       ├── jest.setup.js
│       ├── next-env.d.ts
│       ├── next.config.js
│       ├── package.json
│       ├── pages/
│       │   ├── _app.tsx
│       │   └── index.tsx
│       ├── postcss.config.js
│       ├── src/
│       │   ├── common/
│       │   │   └── .gitkeep
│       │   ├── screens/
│       │   │   ├── admin/
│       │   │   │   └── .gitkeep
│       │   │   ├── auth/
│       │   │   │   └── login/
│       │   │   │       ├── login.test.tsx
│       │   │   │       └── login.tsx
│       │   │   ├── common/
│       │   │   │   └── .gitkeep
│       │   │   └── employee/
│       │   │       └── .gitkeep
│       │   ├── store/
│       │   │   ├── index.ts
│       │   │   └── services/
│       │   │       └── api.ts
│       │   └── styles/
│       │       └── global.css
│       ├── tailwind.config.js
│       └── tsconfig.json
├── docker-compose.yml
├── package-scripts.js
├── package.json
├── packages/
│   ├── config/
│   │   ├── eslint-preset.js
│   │   ├── nginx.conf
│   │   ├── package.json
│   │   ├── postcss.config.js
│   │   └── tailwind.config.js
│   ├── tsconfig/
│   │   ├── README.md
│   │   ├── base.json
│   │   ├── nestjs.json
│   │   ├── nextjs.json
│   │   ├── package.json
│   │   └── react-library.json
│   └── ui/
│       ├── components/
│       │   └── Button/
│       │       └── Button.tsx
│       ├── index.tsx
│       ├── package.json
│       └── tsconfig.json
└── turbo.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
**/node_modules
**/.next
**/dist
**/.turbo

================================================
FILE: .github/workflows/api.yaml
================================================
# This is a basic workflow to help you get started with Actions

name: api-ci

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [master]
    paths:
      - "apps/api/**"
  pull_request:
    branches: [master]
    paths:
      - "apps/api/**"

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    env:
      DATABASE_URL: "postgresql://test:test@localhost:5432/pm"

    # Steps represent a sequence of tasks that will be executed as part of the job
    strategy:
      matrix:
        node-version: [16.x]

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Cache node modules
        uses: actions/cache@v2
        env:
          cache-name: cache-node-modules
        id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - run: yarn global add turbo
      - run: npx nps prepare.ci.api
      - run: npx nps build.ci.api
      - run: npx nps test.ci.api


================================================
FILE: .github/workflows/web.yaml
================================================
# This is a basic workflow to help you get started with Actions

name: web-ci

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [master]
    paths:
      - "apps/web/**"
  pull_request:
    branches: [master]
    paths:
      - "apps/web/**"

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    strategy:
      matrix:
        node-version: [16.x]

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node-version }}
      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Cache node modules
        uses: actions/cache@v2
        id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - run: yarn global add turbo
      - run: npx nps prepare.ci.web
      - run: npx nps build.ci.web
      - run: npx nps test.ci.web


================================================
FILE: .gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/
build

**/dist
**/.env

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2022 Ejaz Ahmed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# Turborepo (NestJS + Prisma + NextJS + Tailwind + Typescript + Jest) Starter

This is fullstack turborepo starter. It comes with the following features. 

- ✅ Turborepo 
- ✅ Nestjs 
    - ✅ Env Config with Validation  
    - ✅ Prisma 
- ✅ NextJS 
    - ✅ Tailwind 
    - ✅ Redux Toolkit Query 
- ✅ Testing using Jest 
- ✅ Github Actions 
- ✅ Reverse Proxy using Nginx 
- ✅ Docker Integration 
- ✅ Postgres Database 
- ✅ Package scripts using NPS 

## What's inside?

This turborepo uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package manager. It includes the following packages/apps:

### Apps and Packages

- `api`: a [NestJS](https://nestjs.com/) app
- `web`: a [Next.js](https://nextjs.org) app
- `ui`: a stub React component library used by `web`.
- `config`: `eslint`, `nginx` and `tailwind` (includes `eslint-config-next` and `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

### Utilities

This turborepo has some additional tools already setup for you:

- [Node Package Scripts](https://github.com/sezna/nps#readme) for automation scripts
- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting

## Setup
This starter kit is using turborepo and yarn workspaces for monorepo workflow.

### Prerequisites 
- Install nps by running 
```
npm i -g nps
```
- Make sure docker and docker-compose are
 installed. Refer to docs for your operating system.

### Configure Environment
- Frontend 
    - `cd apps/web && cp .env.example .env`
- Backend 
    - `cd apps/api && cp .env.example .env`

### Install Dependencies
Make sure you are at root of the project and just run 

```
nps prepare
```
### Build

To build all apps and packages, run the following command at the root of project:

```
nps build
```

### Develop

To develop all apps and packages, run the following command at the root of project:

```
nps dev
```
The app should be running at `http://localhost` with reverse proxy configured.


## Other available commands
Run `nps` in the terminal to see list of all available commands. 


================================================
FILE: apps/api/.eslintrc.js
================================================
module.exports = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: 'tsconfig.json',
    sourceType: 'module',
    tsconfigRootDir: __dirname,
  },
  plugins: ['@typescript-eslint/eslint-plugin'],
  extends: [
    'plugin:@typescript-eslint/recommended',
    'plugin:prettier/recommended',
  ],
  root: true,
  env: {
    node: true,
    jest: true,
  },
  ignorePatterns: ['.eslintrc.js'],
  rules: {
    '@typescript-eslint/interface-name-prefix': 'off',
    '@typescript-eslint/explicit-function-return-type': 'off',
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
  },
};


================================================
FILE: apps/api/.prettierrc
================================================
{
  "singleQuote": true,
  "trailingComma": "all"
}

================================================
FILE: apps/api/Dockerfile
================================================
FROM node:16-alpine AS builder
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=api --docker

# Add lockfile and package.json's of isolated subworkspace
FROM node:16-alpine AS installer
RUN apk update
WORKDIR /app
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
COPY --from=builder /app/turbo.json ./turbo.json
COPY --from=builder /app/apps/api/prisma ./prisma
RUN yarn install --frozen-lockfile
RUN yarn prisma generate 


FROM node:16-alpine AS sourcer
WORKDIR /app
COPY --from=installer /app/ .
COPY --from=builder /app/out/full/ .
COPY .gitignore .gitignore
RUN yarn turbo run build --scope=api --include-dependencies --no-deps

FROM node:16-alpine as runner
WORKDIR /app
COPY --from=sourcer /app/ .
CMD [ "node", "apps/api/dist/main.js" ]


================================================
FILE: apps/api/README.md
================================================
<p align="center">
  <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

  <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
    <p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
  <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
    <a href="https://opencollective.com/nest#sponsor"  target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
  <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
  <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
  [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Installation

```bash
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).


================================================
FILE: apps/api/nest-cli.json
================================================
{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src"
}


================================================
FILE: apps/api/package.json
================================================
{
  "name": "api",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "dev": "nest build --webpack --webpackPath webpack-hmr.config.js --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch --runInBand",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json --runInBand",
    "test:ci": "jest --ci --runInBand"
  },
  "dependencies": {
    "@nestjs/common": "^10.1.3",
    "@nestjs/config": "^3.0.0",
    "@nestjs/core": "^10.1.3",
    "@nestjs/platform-express": "^10.1.3",
    "@nestjs/swagger": "^7.1.6",
    "@prisma/client": "^5.1.0",
    "joi": "^17.9.2",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^5.0.1",
    "rxjs": "^7.8.1",
    "swagger-ui-express": "^5.0.0"
  },
  "devDependencies": {
    "@nestjs/cli": "^10.1.11",
    "@nestjs/schematics": "^10.0.1",
    "@nestjs/testing": "^10.1.3",
    "@types/express": "^4.17.17",
    "@types/jest": "^29.5.3",
    "@types/node": "^20.4.5",
    "@types/supertest": "^2.0.12",
    "@typescript-eslint/eslint-plugin": "^6.2.1",
    "@typescript-eslint/parser": "^6.2.1",
    "eslint": "^8.46.0",
    "eslint-config-prettier": "^8.9.0",
    "eslint-plugin-prettier": "^5.0.0",
    "jest": "^29.6.2",
    "prettier": "^3.0.0",
    "prisma": "^5.1.0",
    "run-script-webpack-plugin": "^0.2.0",
    "source-map-support": "^0.5.21",
    "supertest": "^6.3.3",
    "ts-jest": "^29.1.1",
    "ts-loader": "^9.4.4",
    "ts-node": "^10.9.1",
    "tsconfig": "*",
    "tsconfig-paths": "^4.2.0",
    "typescript": "^5.1.6",
    "webpack": "^5.88.2",
    "webpack-node-externals": "^3.0.0"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}


================================================
FILE: apps/api/prisma/migrations/20220307034109_initial_migrate/migration.sql
================================================
-- CreateTable
CREATE TABLE "User" (
    "id" SERIAL NOT NULL,
    "email" TEXT NOT NULL,
    "name" TEXT,

    CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");


================================================
FILE: apps/api/prisma/migrations/migration_lock.toml
================================================
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"

================================================
FILE: apps/api/prisma/schema.prisma
================================================
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
}


================================================
FILE: apps/api/src/app.controller.spec.ts
================================================
import { Test, TestingModule } from '@nestjs/testing';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PersistenceModule } from './persistence/persistence.module';

describe('AppController', () => {
  let appController: AppController;

  beforeEach(async () => {
    const app: TestingModule = await Test.createTestingModule({
      imports: [PersistenceModule],
      controllers: [AppController],
      providers: [AppService],
    }).compile();

    appController = app.get<AppController>(AppController);
  });

  describe('root', () => {
    it('should return "Hello World!"', async () => {
      expect(await appController.getHello()).toEqual({
        message: 'Hello World',
      });
    });
  });
});


================================================
FILE: apps/api/src/app.controller.ts
================================================
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  async getHello(): Promise<{ message: string }> {
    return await this.appService.getHello();
  }
}


================================================
FILE: apps/api/src/app.module.ts
================================================
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { validationSchemaForEnv } from './config/environment-variables';
import { PersistenceModule } from './persistence/persistence.module';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      validationSchema: validationSchemaForEnv,
    }),
    PersistenceModule,
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}


================================================
FILE: apps/api/src/app.service.ts
================================================
import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
  async getHello(): Promise<{ message: string }> {
    return { message: 'Hello World' };
  }
}


================================================
FILE: apps/api/src/config/environment-variables.ts
================================================
import * as Joi from 'joi';

export interface EnvironmentVariables {
  DATABASE_URL: string;
}

export const validationSchemaForEnv = Joi.object<EnvironmentVariables, true>({
  DATABASE_URL: Joi.string().required(),
});


================================================
FILE: apps/api/src/main.ts
================================================
import { Logger } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';

declare const module: any;
async function bootstrap() {
  const logger = new Logger('EntryPoint');
  const app = await NestFactory.create(AppModule);

  const config = new DocumentBuilder()
    .setTitle('Leaves Tracker')
    .setDescription('Api Docs for leaves tracker')
    .setVersion('1.0')
    .build();

  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup('docs', app, document);

  const PORT = 5002;

  await app.listen(PORT);

  if (module.hot) {
    module.hot.accept();
    module.hot.dispose(() => app.close());
  }
  logger.log(`Server running on http://localhost:${PORT}`);
}
bootstrap();


================================================
FILE: apps/api/src/persistence/persistence.module.ts
================================================
import { Module } from '@nestjs/common';
import { PrismaService } from './prisma/prisma.service';

@Module({
  providers: [PrismaService],
  exports: [PrismaService],
})
export class PersistenceModule {}


================================================
FILE: apps/api/src/persistence/prisma/prisma.service.spec.ts
================================================
import { Test, TestingModule } from '@nestjs/testing';
import { PrismaService } from './prisma.service';

describe('PrismaService', () => {
  let service: PrismaService;

  beforeEach(async () => {
    const module: TestingModule = await Test.createTestingModule({
      providers: [PrismaService],
    }).compile();

    service = module.get<PrismaService>(PrismaService);
  });

  it('should be defined', () => {
    expect(service).toBeDefined();
  });
});


================================================
FILE: apps/api/src/persistence/prisma/prisma.service.ts
================================================
import { Injectable, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';

@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
  async onModuleInit() {
    await this.$connect();
  }
}


================================================
FILE: apps/api/test/app.e2e-spec.ts
================================================
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';

describe('AppController (e2e)', () => {
  let app: INestApplication;

  beforeEach(async () => {
    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [AppModule],
    }).compile();

    app = moduleFixture.createNestApplication();
    await app.init();
  });

  it('/ (GET)', () => {
    return request(app.getHttpServer())
      .get('/')
      .expect(200)
      .expect('Hello World!');
  });
});


================================================
FILE: apps/api/test/jest-e2e.json
================================================
{
  "moduleFileExtensions": ["js", "json", "ts"],
  "rootDir": ".",
  "testEnvironment": "node",
  "testRegex": ".e2e-spec.ts$",
  "transform": {
    "^.+\\.(t|j)s$": "ts-jest"
  }
}


================================================
FILE: apps/api/tsconfig.build.json
================================================
{
  "extends": "./tsconfig.json",
  "exclude": [
    "node_modules",
    "../../node_modules",
    "test",
    "dist",
    "**/*spec.ts"
  ]
}


================================================
FILE: apps/api/tsconfig.json
================================================
{
  "extends": "tsconfig/nestjs.json",
  "compilerOptions": {
    "outDir": "./dist",
    "baseUrl": "./"
  }
}


================================================
FILE: apps/api/webpack-hmr.config.js
================================================
/* eslint-disable @typescript-eslint/no-var-requires */
const nodeExternals = require('webpack-node-externals');
const { RunScriptWebpackPlugin } = require('run-script-webpack-plugin');

module.exports = function (options, webpack) {
  return {
    ...options,
    entry: ['webpack/hot/poll?100', options.entry],
    externals: [
      nodeExternals({
        allowlist: ['webpack/hot/poll?100'],
        modulesDir: '../../node_modules',
      }),
    ],
    plugins: [
      ...options.plugins,
      new webpack.HotModuleReplacementPlugin(),
      new webpack.WatchIgnorePlugin({
        paths: [/\.js$/, /\.d\.ts$/],
      }),
      new RunScriptWebpackPlugin({ name: options.output.filename }),
    ],
  };
};


================================================
FILE: apps/web/.eslintrc.js
================================================
module.exports = require("config/eslint-preset");


================================================
FILE: apps/web/Dockerfile
================================================
FROM node:16-alpine AS builder
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
COPY . .
# Only Take packages that are needed to compile this app
RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM node:16-alpine AS installer
RUN apk update
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
COPY --from=builder /app/turbo.json ./turbo.json
RUN yarn install --frozen-lockfile


FROM node:16-alpine AS sourcer
RUN apk update
WORKDIR /app
COPY --from=installer /app/ .
COPY --from=builder /app/out/full/ .
COPY .gitignore .gitignore
RUN yarn turbo run build --scope=web --include-dependencies --no-deps

FROM node:16-alpine as runner
WORKDIR /app
COPY --from=sourcer /app/ .
WORKDIR /app/apps/web/
CMD [ "npm", "start" ]


================================================
FILE: apps/web/README.md
================================================
## Getting Started

First, run the development server:

```bash
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.


================================================
FILE: apps/web/jest.config.js
================================================
const nextJest = require("next/jest");

const createJestConfig = nextJest({
  // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
  dir: "./",
});

// Add any custom config to be passed to Jest
const customJestConfig = {
  // Add more setup options before each test is run
  // setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
  // if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
  moduleDirectories: ["node_modules", "<rootDir>/"],
  testEnvironment: "jest-environment-jsdom",
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
module.exports = createJestConfig(customJestConfig);


================================================
FILE: apps/web/jest.setup.js
================================================
// Optional: configure or set up a testing framework before each test.
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js`

// Used for __tests__/testing-library.js
// Learn more: https://github.com/testing-library/jest-dom
import "@testing-library/jest-dom/extend-expect";


================================================
FILE: apps/web/next-env.d.ts
================================================
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.


================================================
FILE: apps/web/next.config.js
================================================
const withTM = require("next-transpile-modules")(["ui"]);

module.exports = withTM({
  reactStrictMode: true,
});


================================================
FILE: apps/web/package.json
================================================
{
  "name": "web",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:ci": "jest --ci"
  },
  "dependencies": {
    "@reduxjs/toolkit": "^1.9.5",
    "next": "13.4.12",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-redux": "^8.1.2",
    "ui": "*"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "14.4.3",
    "@types/node": "^20.4.5",
    "@types/react": "18.2.18",
    "autoprefixer": "^10.4.14",
    "config": "*",
    "eslint": "8.46.0",
    "jest": "^29.6.2",
    "jest-environment-jsdom": "^29.6.2",
    "next-transpile-modules": "10.0.1",
    "postcss": "^8.4.27",
    "tailwindcss": "^3.3.3",
    "tsconfig": "*",
    "typescript": "^5.1.6"
  }
}


================================================
FILE: apps/web/pages/_app.tsx
================================================
import type { AppProps } from "next/app";
import { Provider } from "react-redux";
import store from "../src/store";
import "../src/styles/global.css";

function MyApp({ Component, pageProps }: AppProps) {
  return (
    <Provider store={store}>
      <Component {...pageProps} />;
    </Provider>
  );
}

export default MyApp;


================================================
FILE: apps/web/pages/index.tsx
================================================
import { Button } from "ui";
import { useHelloQuery } from "../src/store/services/api";

export default function Web() {
  const { data } = useHelloQuery();

  return (
    <div>
      <h1>{data?.message}</h1>
      <Button />
    </div>
  );
}


================================================
FILE: apps/web/postcss.config.js
================================================
module.exports = require("config/postcss.config");


================================================
FILE: apps/web/src/common/.gitkeep
================================================


================================================
FILE: apps/web/src/screens/admin/.gitkeep
================================================


================================================
FILE: apps/web/src/screens/auth/login/login.test.tsx
================================================
import { render } from "@testing-library/react";
import { LoginScreen } from "./login";

test("render login component", () => {
  render(<LoginScreen />);
});


================================================
FILE: apps/web/src/screens/auth/login/login.tsx
================================================
import { Button } from "ui";

export function LoginScreen() {
  return (
    <div>
      Login Screen <Button />
    </div>
  );
}


================================================
FILE: apps/web/src/screens/common/.gitkeep
================================================


================================================
FILE: apps/web/src/screens/employee/.gitkeep
================================================


================================================
FILE: apps/web/src/store/index.ts
================================================
import { configureStore } from "@reduxjs/toolkit";
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";

import { api } from "./services/api";

export function makeStore() {
  return configureStore({
    reducer: {
      [api.reducerPath]: api.reducer,
    },

    middleware: (getDefaultMiddleware) =>
      getDefaultMiddleware().concat(api.middleware),
  });
}

const store = makeStore();

export type RootState = ReturnType<typeof store.getState>;

export type AppDispatch = typeof store.dispatch;

export const useAppDispatch = () => useDispatch<AppDispatch>();

export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

export default store;


================================================
FILE: apps/web/src/store/services/api.ts
================================================
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const api = createApi({
  reducerPath: "baseApi",
  baseQuery: fetchBaseQuery({
    baseUrl: "api",
  }),
  tagTypes: [],
  endpoints: (builder) => ({
    hello: builder.query<{ message: string }, void>({
      query: () => ({
        url: "/",
      }),
    }),
  }),
});

export const { useHelloQuery } = api;


================================================
FILE: apps/web/src/styles/global.css
================================================
@tailwind base;
@tailwind components;
@tailwind utilities;


================================================
FILE: apps/web/tailwind.config.js
================================================
module.exports = require("config/tailwind.config");


================================================
FILE: apps/web/tsconfig.json
================================================
{
  "extends": "tsconfig/nextjs.json",
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "jest.setup.js"],
  "exclude": ["node_modules"]
}


================================================
FILE: docker-compose.yml
================================================
version: "3.8"

services:
  reverse-proxy:
    image: nginx:latest
    container_name: nginx_container
    ports:
      - 80:80
    depends_on:
      - postgres
    volumes:
      - ./packages/config/nginx.conf:/etc/nginx/nginx.conf
    extra_hosts:
      - "host.docker.internal:host-gateway"

  postgres:
    image: postgres:15
    environment:
      - POSTGRES_DB=mydb
      - POSTGRES_USER=test
      - POSTGRES_PASSWORD=test
    volumes:
      - db_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"

volumes:
  db_data:


================================================
FILE: package-scripts.js
================================================
const path = require("path");

const apiPath = path.resolve(__dirname, "apps/api");
const webPath = path.resolve(__dirname, "apps/web");

const ciApiPath = path.resolve(__dirname, "out/apps/api");
const ciWebPath = path.resolve(__dirname, "out/apps/web");

module.exports = {
  scripts: {
    prepare: {
      default: `nps prepare.web prepare.api`,
      web: `yarn`,
      api: `nps prepare.docker prisma.migrate.dev`,
      docker: "docker compose up -d",
      ci: {
        web: `npx turbo prune --scope=web && cd out && yarn install --frozen-lockfile`,
        api: `npx turbo prune --scope=api && cd out && yarn install --frozen-lockfile && nps prisma.generate`,
      },
    },
    test: {
      default: `nps test.web test.api`,
      web: `cd ${webPath} && yarn test`,
      api: `cd ${apiPath} && yarn test`,
      ci: {
        default: `nps test.ci.web test.ci.api`,
        web: `cd ${ciWebPath} && yarn test:ci`,
        api: `cd ${ciApiPath} && yarn test:ci`,
      },
      watch: {
        default: `nps test.watch.web test.watch.api`,
        web: `cd ${webPath} && yarn test:watch`,
        api: `cd ${apiPath} && yarn test:watch`,
      },
    },
    prisma: {
      generate: `cd ${apiPath} && npx prisma generate`,
      studio: `cd ${apiPath} && npx prisma studio`,
      migrate: {
        dev: `cd ${apiPath} && npx prisma migrate dev`,
      },
    },
    build: {
      default: "npx turbo run build",
      ci: {
        web: "cd out && npm run build",
        api: "cd out && npm run build",
      },
    },
    docker: {
      build: {
        default: "nps docker.build.web docker.build.api",
        web: `docker build -t web . -f ${webPath}/Dockerfile`,
        api: `docker build -t api . -f ${apiPath}/Dockerfile`,
      },
    },
    dev: "npx turbo run dev",
  },
};


================================================
FILE: package.json
================================================
{
  "name": "turborepo-basic-shared",
  "version": "0.0.0",
  "private": true,
  "workspaces": [
    "apps/*",
    "packages/*"
  ],
  "scripts": {
    "build": "turbo run build",
    "dev": "turbo run dev --parallel",
    "lint": "turbo run lint",
    "format": "prettier --write \"**/*.{ts,tsx,md}\""
  },
  "devDependencies": {
    "prettier": "^3.0.0",
    "prisma": "^5.1.0",
    "turbo": "1.10.12"
  },
  "engines": {
    "npm": ">=7.0.0",
    "node": ">=14.0.0"
  },
  "packageManager": "yarn@1.22.17"
}


================================================
FILE: packages/config/eslint-preset.js
================================================
module.exports = {
  extends: ["next", "prettier"],
  settings: {
    next: {
      rootDir: ["apps/*/", "packages/*/"],
    },
  },
  rules: {
    "@next/next/no-html-link-for-pages": "off",
    "react/jsx-key": "off",
  },
};


================================================
FILE: packages/config/nginx.conf
================================================
events {

}

http {

    server {
        listen 80;
        server_name localhost;

        location /api/ {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://host.docker.internal:5002/;

            proxy_http_version 1.1;
            proxy_set_header Connection "upgrade";
            proxy_set_header Upgrade $http_upgrade;
        }

        location /_next/webpack-hmr {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;


            proxy_pass http://host.docker.internal:3000;

            proxy_http_version 1.1;
            proxy_set_header Connection "upgrade";
            proxy_set_header Upgrade $http_upgrade;
        }

        location / {
            proxy_pass http://host.docker.internal:3000;
        }

    }

}


================================================
FILE: packages/config/package.json
================================================
{
  "name": "config",
  "version": "0.0.0",
  "main": "index.js",
  "license": "MIT",
  "files": [
    "eslint-preset.js"
  ],
  "dependencies": {
    "eslint-config-next": "^13.4.12",
    "eslint-config-prettier": "^8.9.0",
    "eslint-plugin-react": "7.33.1"
  }
}


================================================
FILE: packages/config/postcss.config.js
================================================
module.exports = {
  plugins: {
    tailwindcss: {},
    autoprefixer: {},
  },
};


================================================
FILE: packages/config/tailwind.config.js
================================================
module.exports = {
  content: [
    "../../packages/ui/**/*.{js,ts,jsx,tsx}",
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};


================================================
FILE: packages/tsconfig/README.md
================================================
# `tsconfig`

These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.


================================================
FILE: packages/tsconfig/base.json
================================================
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Default",
  "compilerOptions": {
    "composite": false,
    "declaration": true,
    "declarationMap": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "inlineSources": false,
    "isolatedModules": true,
    "moduleResolution": "node",
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "preserveWatchOutput": true,
    "skipLibCheck": true,
    "strict": true
  },
  "exclude": ["node_modules"]
}


================================================
FILE: packages/tsconfig/nestjs.json
================================================
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "./base.json",
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2017",
    "sourceMap": true,
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": false,
    "noFallthroughCasesInSwitch": false
  }
}


================================================
FILE: packages/tsconfig/nextjs.json
================================================
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Next.js",
  "extends": "./base.json",
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "incremental": true,
    "esModuleInterop": true,
    "module": "esnext",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "include": ["src", "next-env.d.ts"],
  "exclude": ["node_modules"]
}


================================================
FILE: packages/tsconfig/package.json
================================================
{
  "name": "tsconfig",
  "version": "0.0.0",
  "private": true,
  "main": "index.js",
  "files": [
    "base.json",
    "nextjs.json",
    "react-library.json"
  ]
}


================================================
FILE: packages/tsconfig/react-library.json
================================================
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "React Library",
  "extends": "./base.json",
  "compilerOptions": {
    "lib": ["ES2015"],
    "module": "ESNext",
    "target": "ES6",
    "jsx": "react-jsx"
  }
}


================================================
FILE: packages/ui/components/Button/Button.tsx
================================================
export const Button = () => {
  return <button className="text-lg bg-red-500">boo</button>;
};


================================================
FILE: packages/ui/index.tsx
================================================
export * from "./components/Button/Button";


================================================
FILE: packages/ui/package.json
================================================
{
  "name": "ui",
  "version": "0.0.0",
  "main": "./index.tsx",
  "types": "./index.tsx",
  "license": "MIT",
  "devDependencies": {
    "@types/react": "^18.2.18",
    "@types/react-dom": "^18.2.7",
    "config": "*",
    "tsconfig": "*",
    "typescript": "^5.1.6"
  }
}


================================================
FILE: packages/ui/tsconfig.json
================================================
{
  "extends": "tsconfig/react-library.json",
  "include": ["."],
  "exclude": ["dist", "build", "node_modules"]
}


================================================
FILE: turbo.json
================================================
{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"],
      "outputs": ["dist/**", ".next/**"]
    },
    "lint": {
      "outputs": []
    },
    "dev": {
      "cache": false
    },
    "test:ci": {
      "cache": false
    }
  }
}
Download .txt
gitextract_s_o25e31/

├── .dockerignore
├── .github/
│   └── workflows/
│       ├── api.yaml
│       └── web.yaml
├── .gitignore
├── LICENSE
├── README.md
├── apps/
│   ├── api/
│   │   ├── .eslintrc.js
│   │   ├── .prettierrc
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── nest-cli.json
│   │   ├── package.json
│   │   ├── prisma/
│   │   │   ├── migrations/
│   │   │   │   ├── 20220307034109_initial_migrate/
│   │   │   │   │   └── migration.sql
│   │   │   │   └── migration_lock.toml
│   │   │   └── schema.prisma
│   │   ├── src/
│   │   │   ├── app.controller.spec.ts
│   │   │   ├── app.controller.ts
│   │   │   ├── app.module.ts
│   │   │   ├── app.service.ts
│   │   │   ├── config/
│   │   │   │   └── environment-variables.ts
│   │   │   ├── main.ts
│   │   │   └── persistence/
│   │   │       ├── persistence.module.ts
│   │   │       └── prisma/
│   │   │           ├── prisma.service.spec.ts
│   │   │           └── prisma.service.ts
│   │   ├── test/
│   │   │   ├── app.e2e-spec.ts
│   │   │   └── jest-e2e.json
│   │   ├── tsconfig.build.json
│   │   ├── tsconfig.json
│   │   └── webpack-hmr.config.js
│   └── web/
│       ├── .eslintrc.js
│       ├── Dockerfile
│       ├── README.md
│       ├── jest.config.js
│       ├── jest.setup.js
│       ├── next-env.d.ts
│       ├── next.config.js
│       ├── package.json
│       ├── pages/
│       │   ├── _app.tsx
│       │   └── index.tsx
│       ├── postcss.config.js
│       ├── src/
│       │   ├── common/
│       │   │   └── .gitkeep
│       │   ├── screens/
│       │   │   ├── admin/
│       │   │   │   └── .gitkeep
│       │   │   ├── auth/
│       │   │   │   └── login/
│       │   │   │       ├── login.test.tsx
│       │   │   │       └── login.tsx
│       │   │   ├── common/
│       │   │   │   └── .gitkeep
│       │   │   └── employee/
│       │   │       └── .gitkeep
│       │   ├── store/
│       │   │   ├── index.ts
│       │   │   └── services/
│       │   │       └── api.ts
│       │   └── styles/
│       │       └── global.css
│       ├── tailwind.config.js
│       └── tsconfig.json
├── docker-compose.yml
├── package-scripts.js
├── package.json
├── packages/
│   ├── config/
│   │   ├── eslint-preset.js
│   │   ├── nginx.conf
│   │   ├── package.json
│   │   ├── postcss.config.js
│   │   └── tailwind.config.js
│   ├── tsconfig/
│   │   ├── README.md
│   │   ├── base.json
│   │   ├── nestjs.json
│   │   ├── nextjs.json
│   │   ├── package.json
│   │   └── react-library.json
│   └── ui/
│       ├── components/
│       │   └── Button/
│       │       └── Button.tsx
│       ├── index.tsx
│       ├── package.json
│       └── tsconfig.json
└── turbo.json
Download .txt
SYMBOL INDEX (19 symbols across 12 files)

FILE: apps/api/prisma/migrations/20220307034109_initial_migrate/migration.sql
  type "User" (line 2) | CREATE TABLE "User" (
  type "User" (line 11) | CREATE UNIQUE INDEX "User_email_key" ON "User"("email")

FILE: apps/api/src/app.controller.ts
  class AppController (line 5) | class AppController {
    method constructor (line 6) | constructor(private readonly appService: AppService) {}
    method getHello (line 9) | async getHello(): Promise<{ message: string }> {

FILE: apps/api/src/app.module.ts
  class AppModule (line 19) | class AppModule {}

FILE: apps/api/src/app.service.ts
  class AppService (line 4) | class AppService {
    method getHello (line 5) | async getHello(): Promise<{ message: string }> {

FILE: apps/api/src/config/environment-variables.ts
  type EnvironmentVariables (line 3) | interface EnvironmentVariables {

FILE: apps/api/src/main.ts
  function bootstrap (line 7) | async function bootstrap() {

FILE: apps/api/src/persistence/persistence.module.ts
  class PersistenceModule (line 8) | class PersistenceModule {}

FILE: apps/api/src/persistence/prisma/prisma.service.ts
  class PrismaService (line 5) | class PrismaService extends PrismaClient implements OnModuleInit {
    method onModuleInit (line 6) | async onModuleInit() {

FILE: apps/web/pages/_app.tsx
  function MyApp (line 6) | function MyApp({ Component, pageProps }: AppProps) {

FILE: apps/web/pages/index.tsx
  function Web (line 4) | function Web() {

FILE: apps/web/src/screens/auth/login/login.tsx
  function LoginScreen (line 3) | function LoginScreen() {

FILE: apps/web/src/store/index.ts
  function makeStore (line 6) | function makeStore() {
  type RootState (line 19) | type RootState = ReturnType<typeof store.getState>;
  type AppDispatch (line 21) | type AppDispatch = typeof store.dispatch;
Condensed preview — 70 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (42K chars).
[
  {
    "path": ".dockerignore",
    "chars": 42,
    "preview": "**/node_modules\n**/.next\n**/dist\n**/.turbo"
  },
  {
    "path": ".github/workflows/api.yaml",
    "chars": 1793,
    "preview": "# This is a basic workflow to help you get started with Actions\n\nname: api-ci\n\n# Controls when the workflow will run\non:"
  },
  {
    "path": ".github/workflows/web.yaml",
    "chars": 1666,
    "preview": "# This is a basic workflow to help you get started with Actions\n\nname: web-ci\n\n# Controls when the workflow will run\non:"
  },
  {
    "path": ".gitignore",
    "chars": 397,
    "preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n.pnp\n"
  },
  {
    "path": "LICENSE",
    "chars": 1067,
    "preview": "MIT License\n\nCopyright (c) 2022 Ejaz Ahmed\n\nPermission is hereby granted, free of charge, to any person obtaining a copy"
  },
  {
    "path": "README.md",
    "chars": 2238,
    "preview": "# Turborepo (NestJS + Prisma + NextJS + Tailwind + Typescript + Jest) Starter\n\nThis is fullstack turborepo starter. It c"
  },
  {
    "path": "apps/api/.eslintrc.js",
    "chars": 663,
    "preview": "module.exports = {\n  parser: '@typescript-eslint/parser',\n  parserOptions: {\n    project: 'tsconfig.json',\n    sourceTyp"
  },
  {
    "path": "apps/api/.prettierrc",
    "chars": 51,
    "preview": "{\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}"
  },
  {
    "path": "apps/api/Dockerfile",
    "chars": 846,
    "preview": "FROM node:16-alpine AS builder\nRUN apk update\n# Set working directory\nWORKDIR /app\nRUN yarn global add turbo\nCOPY . .\nRU"
  },
  {
    "path": "apps/api/README.md",
    "chars": 3338,
    "preview": "<p align=\"center\">\n  <a href=\"http://nestjs.com/\" target=\"blank\"><img src=\"https://nestjs.com/img/logo_text.svg\" width=\""
  },
  {
    "path": "apps/api/nest-cli.json",
    "chars": 64,
    "preview": "{\n  \"collection\": \"@nestjs/schematics\",\n  \"sourceRoot\": \"src\"\n}\n"
  },
  {
    "path": "apps/api/package.json",
    "chars": 2413,
    "preview": "{\n  \"name\": \"api\",\n  \"version\": \"0.0.1\",\n  \"description\": \"\",\n  \"author\": \"\",\n  \"private\": true,\n  \"license\": \"UNLICENSE"
  },
  {
    "path": "apps/api/prisma/migrations/20220307034109_initial_migrate/migration.sql",
    "chars": 230,
    "preview": "-- CreateTable\nCREATE TABLE \"User\" (\n    \"id\" SERIAL NOT NULL,\n    \"email\" TEXT NOT NULL,\n    \"name\" TEXT,\n\n    CONSTRAI"
  },
  {
    "path": "apps/api/prisma/migrations/migration_lock.toml",
    "chars": 126,
    "preview": "# Please do not edit this file manually\n# It should be added in your version-control system (i.e. Git)\nprovider = \"postg"
  },
  {
    "path": "apps/api/prisma/schema.prisma",
    "chars": 338,
    "preview": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator clien"
  },
  {
    "path": "apps/api/src/app.controller.spec.ts",
    "chars": 765,
    "preview": "import { Test, TestingModule } from '@nestjs/testing';\nimport { AppController } from './app.controller';\nimport { AppSer"
  },
  {
    "path": "apps/api/src/app.controller.ts",
    "chars": 308,
    "preview": "import { Controller, Get } from '@nestjs/common';\nimport { AppService } from './app.service';\n\n@Controller()\nexport clas"
  },
  {
    "path": "apps/api/src/app.module.ts",
    "chars": 570,
    "preview": "import { Module } from '@nestjs/common';\nimport { ConfigModule } from '@nestjs/config';\nimport { AppController } from '."
  },
  {
    "path": "apps/api/src/app.service.ts",
    "chars": 182,
    "preview": "import { Injectable } from '@nestjs/common';\n\n@Injectable()\nexport class AppService {\n  async getHello(): Promise<{ mess"
  },
  {
    "path": "apps/api/src/config/environment-variables.ts",
    "chars": 220,
    "preview": "import * as Joi from 'joi';\n\nexport interface EnvironmentVariables {\n  DATABASE_URL: string;\n}\n\nexport const validationS"
  },
  {
    "path": "apps/api/src/main.ts",
    "chars": 830,
    "preview": "import { Logger } from '@nestjs/common';\nimport { NestFactory } from '@nestjs/core';\nimport { AppModule } from './app.mo"
  },
  {
    "path": "apps/api/src/persistence/persistence.module.ts",
    "chars": 204,
    "preview": "import { Module } from '@nestjs/common';\nimport { PrismaService } from './prisma/prisma.service';\n\n@Module({\n  providers"
  },
  {
    "path": "apps/api/src/persistence/prisma/prisma.service.spec.ts",
    "chars": 460,
    "preview": "import { Test, TestingModule } from '@nestjs/testing';\nimport { PrismaService } from './prisma.service';\n\ndescribe('Pris"
  },
  {
    "path": "apps/api/src/persistence/prisma/prisma.service.ts",
    "chars": 253,
    "preview": "import { Injectable, OnModuleInit } from '@nestjs/common';\nimport { PrismaClient } from '@prisma/client';\n\n@Injectable()"
  },
  {
    "path": "apps/api/test/app.e2e-spec.ts",
    "chars": 630,
    "preview": "import { Test, TestingModule } from '@nestjs/testing';\nimport { INestApplication } from '@nestjs/common';\nimport * as re"
  },
  {
    "path": "apps/api/test/jest-e2e.json",
    "chars": 183,
    "preview": "{\n  \"moduleFileExtensions\": [\"js\", \"json\", \"ts\"],\n  \"rootDir\": \".\",\n  \"testEnvironment\": \"node\",\n  \"testRegex\": \".e2e-sp"
  },
  {
    "path": "apps/api/tsconfig.build.json",
    "chars": 143,
    "preview": "{\n  \"extends\": \"./tsconfig.json\",\n  \"exclude\": [\n    \"node_modules\",\n    \"../../node_modules\",\n    \"test\",\n    \"dist\",\n "
  },
  {
    "path": "apps/api/tsconfig.json",
    "chars": 112,
    "preview": "{\n  \"extends\": \"tsconfig/nestjs.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./dist\",\n    \"baseUrl\": \"./\"\n  }\n}\n"
  },
  {
    "path": "apps/api/webpack-hmr.config.js",
    "chars": 715,
    "preview": "/* eslint-disable @typescript-eslint/no-var-requires */\nconst nodeExternals = require('webpack-node-externals');\nconst {"
  },
  {
    "path": "apps/web/.eslintrc.js",
    "chars": 50,
    "preview": "module.exports = require(\"config/eslint-preset\");\n"
  },
  {
    "path": "apps/web/Dockerfile",
    "chars": 884,
    "preview": "FROM node:16-alpine AS builder\nRUN apk update\n# Set working directory\nWORKDIR /app\nRUN yarn global add turbo\nCOPY . .\n# "
  },
  {
    "path": "apps/web/README.md",
    "chars": 1369,
    "preview": "## Getting Started\n\nFirst, run the development server:\n\n```bash\nyarn dev\n```\n\nOpen [http://localhost:3000](http://localh"
  },
  {
    "path": "apps/web/jest.config.js",
    "chars": 751,
    "preview": "const nextJest = require(\"next/jest\");\n\nconst createJestConfig = nextJest({\n  // Provide the path to your Next.js app to"
  },
  {
    "path": "apps/web/jest.setup.js",
    "chars": 300,
    "preview": "// Optional: configure or set up a testing framework before each test.\n// If you delete this file, remove `setupFilesAft"
  },
  {
    "path": "apps/web/next-env.d.ts",
    "chars": 201,
    "preview": "/// <reference types=\"next\" />\n/// <reference types=\"next/image-types/global\" />\n\n// NOTE: This file should not be edite"
  },
  {
    "path": "apps/web/next.config.js",
    "chars": 114,
    "preview": "const withTM = require(\"next-transpile-modules\")([\"ui\"]);\n\nmodule.exports = withTM({\n  reactStrictMode: true,\n});\n"
  },
  {
    "path": "apps/web/package.json",
    "chars": 940,
    "preview": "{\n  \"name\": \"web\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"dev\": \"next dev\",\n    \"build\": \"next bui"
  },
  {
    "path": "apps/web/pages/_app.tsx",
    "chars": 327,
    "preview": "import type { AppProps } from \"next/app\";\nimport { Provider } from \"react-redux\";\nimport store from \"../src/store\";\nimpo"
  },
  {
    "path": "apps/web/pages/index.tsx",
    "chars": 245,
    "preview": "import { Button } from \"ui\";\nimport { useHelloQuery } from \"../src/store/services/api\";\n\nexport default function Web() {"
  },
  {
    "path": "apps/web/postcss.config.js",
    "chars": 51,
    "preview": "module.exports = require(\"config/postcss.config\");\n"
  },
  {
    "path": "apps/web/src/common/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "apps/web/src/screens/admin/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "apps/web/src/screens/auth/login/login.test.tsx",
    "chars": 159,
    "preview": "import { render } from \"@testing-library/react\";\nimport { LoginScreen } from \"./login\";\n\ntest(\"render login component\", "
  },
  {
    "path": "apps/web/src/screens/auth/login/login.tsx",
    "chars": 131,
    "preview": "import { Button } from \"ui\";\n\nexport function LoginScreen() {\n  return (\n    <div>\n      Login Screen <Button />\n    </d"
  },
  {
    "path": "apps/web/src/screens/common/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "apps/web/src/screens/employee/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "apps/web/src/store/index.ts",
    "chars": 692,
    "preview": "import { configureStore } from \"@reduxjs/toolkit\";\nimport { TypedUseSelectorHook, useDispatch, useSelector } from \"react"
  },
  {
    "path": "apps/web/src/store/services/api.ts",
    "chars": 394,
    "preview": "import { createApi, fetchBaseQuery } from \"@reduxjs/toolkit/query/react\";\n\nexport const api = createApi({\n  reducerPath:"
  },
  {
    "path": "apps/web/src/styles/global.css",
    "chars": 59,
    "preview": "@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"
  },
  {
    "path": "apps/web/tailwind.config.js",
    "chars": 52,
    "preview": "module.exports = require(\"config/tailwind.config\");\n"
  },
  {
    "path": "apps/web/tsconfig.json",
    "chars": 143,
    "preview": "{\n  \"extends\": \"tsconfig/nextjs.json\",\n  \"include\": [\"next-env.d.ts\", \"**/*.ts\", \"**/*.tsx\", \"jest.setup.js\"],\n  \"exclud"
  },
  {
    "path": "docker-compose.yml",
    "chars": 536,
    "preview": "version: \"3.8\"\n\nservices:\n  reverse-proxy:\n    image: nginx:latest\n    container_name: nginx_container\n    ports:\n      "
  },
  {
    "path": "package-scripts.js",
    "chars": 1805,
    "preview": "const path = require(\"path\");\n\nconst apiPath = path.resolve(__dirname, \"apps/api\");\nconst webPath = path.resolve(__dirna"
  },
  {
    "path": "package.json",
    "chars": 511,
    "preview": "{\n  \"name\": \"turborepo-basic-shared\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"workspaces\": [\n    \"apps/*\",\n    \"pack"
  },
  {
    "path": "packages/config/eslint-preset.js",
    "chars": 228,
    "preview": "module.exports = {\n  extends: [\"next\", \"prettier\"],\n  settings: {\n    next: {\n      rootDir: [\"apps/*/\", \"packages/*/\"],"
  },
  {
    "path": "packages/config/nginx.conf",
    "chars": 893,
    "preview": "events {\n\n}\n\nhttp {\n\n    server {\n        listen 80;\n        server_name localhost;\n\n        location /api/ {\n          "
  },
  {
    "path": "packages/config/package.json",
    "chars": 267,
    "preview": "{\n  \"name\": \"config\",\n  \"version\": \"0.0.0\",\n  \"main\": \"index.js\",\n  \"license\": \"MIT\",\n  \"files\": [\n    \"eslint-preset.js"
  },
  {
    "path": "packages/config/postcss.config.js",
    "chars": 83,
    "preview": "module.exports = {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n};\n"
  },
  {
    "path": "packages/config/tailwind.config.js",
    "chars": 210,
    "preview": "module.exports = {\n  content: [\n    \"../../packages/ui/**/*.{js,ts,jsx,tsx}\",\n    \"./pages/**/*.{js,ts,jsx,tsx}\",\n    \"."
  },
  {
    "path": "packages/tsconfig/README.md",
    "chars": 106,
    "preview": "# `tsconfig`\n\nThese are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.\n"
  },
  {
    "path": "packages/tsconfig/base.json",
    "chars": 521,
    "preview": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"Default\",\n  \"compilerOptions\": {\n    \"composite\": "
  },
  {
    "path": "packages/tsconfig/nestjs.json",
    "chars": 583,
    "preview": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"extends\": \"./base.json\",\n  \"compilerOptions\": {\n    \"module\":"
  },
  {
    "path": "packages/tsconfig/nextjs.json",
    "chars": 568,
    "preview": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"Next.js\",\n  \"extends\": \"./base.json\",\n  \"compilerO"
  },
  {
    "path": "packages/tsconfig/package.json",
    "chars": 167,
    "preview": "{\n  \"name\": \"tsconfig\",\n  \"version\": \"0.0.0\",\n  \"private\": true,\n  \"main\": \"index.js\",\n  \"files\": [\n    \"base.json\",\n   "
  },
  {
    "path": "packages/tsconfig/react-library.json",
    "chars": 234,
    "preview": "{\n  \"$schema\": \"https://json.schemastore.org/tsconfig\",\n  \"display\": \"React Library\",\n  \"extends\": \"./base.json\",\n  \"com"
  },
  {
    "path": "packages/ui/components/Button/Button.tsx",
    "chars": 95,
    "preview": "export const Button = () => {\n  return <button className=\"text-lg bg-red-500\">boo</button>;\n};\n"
  },
  {
    "path": "packages/ui/index.tsx",
    "chars": 44,
    "preview": "export * from \"./components/Button/Button\";\n"
  },
  {
    "path": "packages/ui/package.json",
    "chars": 274,
    "preview": "{\n  \"name\": \"ui\",\n  \"version\": \"0.0.0\",\n  \"main\": \"./index.tsx\",\n  \"types\": \"./index.tsx\",\n  \"license\": \"MIT\",\n  \"devDep"
  },
  {
    "path": "packages/ui/tsconfig.json",
    "chars": 115,
    "preview": "{\n  \"extends\": \"tsconfig/react-library.json\",\n  \"include\": [\".\"],\n  \"exclude\": [\"dist\", \"build\", \"node_modules\"]\n}\n"
  },
  {
    "path": "turbo.json",
    "chars": 244,
    "preview": "{\n  \"pipeline\": {\n    \"build\": {\n      \"dependsOn\": [\"^build\"],\n      \"outputs\": [\"dist/**\", \".next/**\"]\n    },\n    \"lin"
  }
]

About this extraction

This page contains the full source code of the ejazahm3d/fullstack-turborepo-starter GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 70 files (34.4 KB), approximately 11.7k tokens, and a symbol index with 19 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!