Getting Started & Installation
Make sure you moved the
pickbazar-react
folder to a generic folder likeDesktop,
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 directoryyarn
API (NestJs GraphQL)
- Go to
/api/graphql
directory and run below command.
# on api/graphql directoryyarnyarn 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)
- Go to
/api/rest
directory and run below command.
# on api/rest directoryyarnyarn 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.
- Go to
/admin/graphql
folder. - Copy the contents of
.env.template
into a new file called.env
- Run below command to start the server.
# on root directoryyarn dev:admin-gql# or# on admin/graphql directoryyarn dev
Admin(REST)
For starting the admin dashboard part with corresponding api data run below commands.
- Go to
/admin/rest
folder. - Copy the contents of
.env.template
into a new file called.env
- Run below command to start the server.
# on root directoryyarn dev:admin-rest# or# on admin/rest directoryyarn dev
Shop
For starting the shop part with corresponding api run below commands.
- Go to
/shop
folder. - Copy the contents of
.env.template
into a new file called.env
- Fill the
.env
file with your values like,NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=, SECRET=, GOOGLE_CLIENT_ID=, GOOGLE_CLIENT_SECRET=
- SET
FRAMEWORK_PROVIDER='yourProjectType'
in.env
file. ex: if you want to use rest thenFRAMEWORK_PROVIDER='rest'
orFRAMEWORK_PROVIDER='graphql'
- SET
tsconfig.json
. if you want to userest version
then copy the content fromtsconfig.rest.json
totsconfig.json
file or if you want to usegraphql version
then copy the content fromtsconfig.graphql.json
totsconfig.json
file. - Run below command to start the server.
# on root directoryyarn dev:shop-gqlyarn dev:shop-rest# or# on shop directoryyarn dev:restyarn 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)
- Go to
/api/graphql
folder. - Run
yarn build
- Run
yarn start:prod
- Go to
/admin/graphql
folder. - Run
yarn build
- 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)
- Go to
/api/rest
folder. - Run
yarn build
- Run
yarn start:prod
- Go to
/admin/rest
folder. - Run
yarn build
- 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)
- Go to
/api/graphql
folder. - Run
yarn build
- Run
yarn start:prod
- Go to
/shop
folder. - Run
yarn build:gql
- 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)
- Go to
/api/rest
folder. - Run
yarn build
- Run
yarn start:prod
- Go to
/shop
folder. - Run
yarn build:rest
- Run
yarn start
NOTE : API must be running for the above commands to work.
NOTE : .env
file must be filled with your values.