GithubHelp home page GithubHelp logo

dukaan-app's Introduction

DUKAAN-APP

This is an e-commerce app with an admin dashboard and a user facing dashboard using Turborepo in a single monorepo.

Local Setup

Prerequisites

  • Mongo DB running either locally or on cloud.
  • A super secret key to be used for JWT signature

Steps

  1. Clone the repository locally.

    git clone [email protected]:Mnyu/dukaan-app.git
    
  2. Open the folder dukaan-app in VSCode.

  3. Inside apps -> api folder, create a copy of .env.example with file name as .env.

  4. In the .env file, replace the values of MONGO_URI, JWT_SECRET and JWT_LIFETIME as per your environment.
    Possible values for JWT_LIFETIME could be 60 or 1h or 1d

  5. Open new terminal in VSCode and run

    yarn install
    
  6. Build common package

    cd packages/common/
    yarn build
    
  7. Build store package

    cd ../store/
    yarn build
    
  8. Now run

    cd ../..
    yarn run dev
    
  9. Following statements should be visible in logs :
    Database connection successful.
    Server is listening on port 5000...

  10. Admin Dashboard : http://localhost:3000/
    User Dashboard : http://localhost:3001/


Known Issues :

  1. yarn run build - throws following error at dukaan-app level :
docs:build: ReferenceError: document is not defined
docs:build:     at getUrlBasedHistory (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/docs/.next/server/chunks/876.js:406:14)
docs:build:     at Object.createBrowserHistory (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/docs/.next/server/chunks/876.js:239:10)
docs:build:     at exports.modules.8292.e.BrowserRouter (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/docs/.next/server/chunks/876.js:20055:14758)
docs:build:     at Ue (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
docs:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
docs:build:     at Ve (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:123:155)
docs:build:     at Xe (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:122:289)
docs:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:350)
docs:build:     at Ue (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:118:191)
docs:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
web:build: ReferenceError: document is not defined
web:build:     at getUrlBasedHistory (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/web/.next/server/chunks/876.js:406:14)
web:build:     at Object.createBrowserHistory (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/web/.next/server/chunks/876.js:239:10)
web:build:     at exports.modules.8292.e.BrowserRouter (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/web/.next/server/chunks/876.js:20053:14758)
web:build:     at Ue (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
web:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
web:build:     at Ve (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:123:155)
web:build:     at Xe (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:122:289)
web:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:350)
web:build:     at Ue (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:118:191)
web:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
docs:build:
docs:build: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
docs:build: ReferenceError: document is not defined
docs:build:     at getUrlBasedHistory (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/docs/.next/server/chunks/876.js:406:14)
docs:build:     at Object.createBrowserHistory (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/docs/.next/server/chunks/876.js:239:10)
docs:build:     at exports.modules.8292.e.BrowserRouter (/Users/abhimgup/manyu/react/cohort/dukaan-app/apps/docs/.next/server/chunks/876.js:20055:14758)
docs:build:     at Ue (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:113:273)
docs:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)
docs:build:     at Ve (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:123:155)
docs:build:     at Xe (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:122:289)
docs:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:350)
docs:build:     at Ue (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:118:191)
docs:build:     at Z (/Users/abhimgup/manyu/react/cohort/dukaan-app/node_modules/next/dist/compiled/react-dom/cjs/react-dom-server.edge.production.min.js:120:91)



=========================================================================

TURBOREPO README

This is an official starter Turborepo.

Using this example

Run the following command:

npx create-turbo@latest

What's inside?

This Turborepo includes the following packages/apps:

Apps and Packages

  • docs: a Next.js app
  • web: another Next.js app
  • ui: a stub React component library shared by both web and docs applications
  • eslint-config-custom: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • tsconfig: tsconfig.jsons used throughout the monorepo

Each package/app is 100% TypeScript.

Utilities

This Turborepo has some additional tools already setup for you:

Build

To build all apps and packages, run the following command:

cd my-turborepo
pnpm build

Develop

To develop all apps and packages, run the following command:

cd my-turborepo
pnpm dev

Remote Caching

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

cd my-turborepo
npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

npx turbo link

Useful Links

Learn more about the power of Turborepo:

dukaan-app's People

Contributors

mnyu avatar turbobot-temp avatar

Stargazers

Pugazh avatar Faizan avatar Aman Kumar Gupta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.