PickBazar React Documentation
WelcomeHow It WorksInstallationAPI (NestJs GraphQL)API (NestJs REST)Admin(GraphQL)Admin(REST)ShopOnly For Windows UsersAdmin(GraphQL)Admin(REST)Shop(GraphQL)Shop(REST)
Features
Available ScriptsCustomizationStyles and Assets
Back-End Integration
Deployment
Settings
TranslationNew PageFAQSupportVersions

Getting Started & Installation

Make sure you moved the pickbazar-react folder to a generic folder like Desktop, Document, or your specific code folder. Otherwise, the top folder name causes several path issues in generating the schema or installing npm packages.

For getting started with the template you have to follow the below procedure. First navigate to the root directory. Then run below command for getting started with specific part.

# on root directory
yarn

API (NestJs GraphQL)

  1. Go to /api/graphql directory and run below command.
# on api/graphql directory
yarn
yarn start:dev

NOTE : This will start the server at http://localhost:4000 for graphql api and you can access it from browser at http://localhost:4000/graphql(for graphql playground).

API (NestJs REST)

  1. Go to /api/rest directory and run below command.
# on api/rest directory
yarn
yarn start:dev

NOTE : This will start the server at http://localhost:5000/api/ for rest api and you can access it from browser at http://localhost:5000/docs(for rest swagger doc).

Admin(GraphQL)

For starting the admin dashboard part with corresponding api data run below commands.

  1. Go to /admin/graphql folder.
  2. Copy the contents of .env.template into a new file called .env
  3. Run below command to start the server.
# on root directory
yarn dev:admin-gql
# or
# on admin/graphql directory
yarn dev

Admin(REST)

For starting the admin dashboard part with corresponding api data run below commands.

  1. Go to /admin/rest folder.
  2. Copy the contents of .env.template into a new file called .env
  3. Run below command to start the server.
# on root directory
yarn dev:admin-rest
# or
# on admin/rest directory
yarn dev

Shop

For starting the shop part with corresponding api run below commands.

  1. Go to /shop folder.
  2. Copy the contents of .env.template into a new file called .env
  3. Fill the .env file with your values like, NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=, SECRET=, GOOGLE_CLIENT_ID=, GOOGLE_CLIENT_SECRET=
  4. SET FRAMEWORK_PROVIDER='yourProjectType' in .env file. ex: if you want to use rest then FRAMEWORK_PROVIDER='rest' or FRAMEWORK_PROVIDER='graphql'
  5. SET tsconfig.json. if you want to use rest version then copy the content from tsconfig.rest.json to tsconfig.json file or if you want to use graphql version then copy the content from tsconfig.graphql.json to tsconfig.json file.
  6. Run below command to start the server.
# on root directory
yarn dev:shop-gql
yarn dev:shop-rest
# or
# on shop directory
yarn dev:rest
yarn dev:gql

NOTE : API must be running for the above commands to work.

NOTE : .env file must be filled with your values.

Only For Windows Users

- Go to your specific project root and find `.graphql-let.yml`
- Replace the env variable `${NEXT_PUBLIC_GRAPHQL_API_ENDPOINT}` in schema field manually
- Provide your API url in the schema field.
- Also change the dev command at `package.json`
- Go to `shop/package.json` and `admin/package.json` file and change the scripts:
"codegen": "node -r dotenv/config $(yarn bin)/graphql-let",
to
"codegen": "graphql-let",

If you want to test your production build admin or shop in local environment then run the below commands.

Admin(GraphQL)

  1. Go to /api/graphql folder.
  2. Run yarn build
  3. Run yarn start:prod
  4. Go to /admin/graphql folder.
  5. Run yarn build
  6. Run yarn start

NOTE : API must be running for the above commands to work.

NOTE : .env file must be filled with your values.

Admin(REST)

  1. Go to /api/rest folder.
  2. Run yarn build
  3. Run yarn start:prod
  4. Go to /admin/rest folder.
  5. Run yarn build
  6. Run yarn start

NOTE : API must be running for the above commands to work.

NOTE : .env file must be filled with your values.

Shop(GraphQL)

  1. Go to /api/graphql folder.
  2. Run yarn build
  3. Run yarn start:prod
  4. Go to /shop folder.
  5. Run yarn build:gql
  6. Run yarn start

NOTE : API must be running for the above commands to work.

NOTE : .env file must be filled with your values.

Shop(REST)

  1. Go to /api/rest folder.
  2. Run yarn build
  3. Run yarn start:prod
  4. Go to /shop folder.
  5. Run yarn build:rest
  6. Run yarn start

NOTE : API must be running for the above commands to work.

NOTE : .env file must be filled with your values.