Getting Started & Installation
Make sure you moved the
pickbazar-reactfolder 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/graphqldirectory 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/restdirectory 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/graphqlfolder. - Copy the contents of
.env.templateinto 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/restfolder. - Copy the contents of
.env.templateinto 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
/shopfolder. - Copy the contents of
.env.templateinto a new file called.env - Fill the
.envfile with your values like,NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=, SECRET=, GOOGLE_CLIENT_ID=, GOOGLE_CLIENT_SECRET= - SET
FRAMEWORK_PROVIDER='yourProjectType'in.envfile. ex: if you want to use rest thenFRAMEWORK_PROVIDER='rest'orFRAMEWORK_PROVIDER='graphql' - SET
tsconfig.json. if you want to userest versionthen copy the content fromtsconfig.rest.jsontotsconfig.jsonfile or if you want to usegraphql versionthen copy the content fromtsconfig.graphql.jsontotsconfig.jsonfile. - 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/graphqlfolder. - Run
yarn build - Run
yarn start:prod - Go to
/admin/graphqlfolder. - 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/restfolder. - Run
yarn build - Run
yarn start:prod - Go to
/admin/restfolder. - 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/graphqlfolder. - Run
yarn build - Run
yarn start:prod - Go to
/shopfolder. - 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/restfolder. - Run
yarn build - Run
yarn start:prod - Go to
/shopfolder. - 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.