Git Product home page Git Product logo

oplui's Introduction

Online Product Listing UI

This is a simple tool built with React and Chakra UI that uses the Open AI chat completion API to extract the best keywords from any given text.

How to use

Get the source

$ git clone https://github.com/vatsaaa/oplui.git

OR

Download the source code without from here

Local

Install dependencies

$ npm install

Rename .env.example to .env and add your API key. You can get your key at OpenAI API.

VITE_OPL_API_KEY='ADD_YOUR_KEY_HERE'

Important: Your API key is not secure as there is no backend. If you decide to use this tool in production, you should add a backend to it and store the API key there.

Run in dev mode:

Start local API (only for dev mode)

$ echo "VITE_DEV=true" >> .env

Provision a fresh database

$ node tools/createMockDb.js 

Start local API

$ node tools/apiServer.js

Start the UI:

$ npm run dev

Open this link with your browser to see the result.

Check for production mode readiness

Build for production:

$ npm run build

Preview production distributable

npm run preview

Containers

Build production container

$ docker build -f Dockerfile.prd -t opl-ui-img-0107052023 .

Run production container

$ docker run --rm -d -p 3000:80 opl-ui-img-0107052023

Build development container

$ docker build -f Dockerfile.dev -t opl-ui-img-0107052023 .

Application is server here

Run development server

$ docker run --rm -v $(pwd)/src:/app/src:ro -d -p 3000:5173 opl-ui-img-06052023

**For windows

  1. Consider using Power Shell and replace $(pwd) with %cd%
  2. If for any reason you cannot, replace $(pwd)/src with the absolute path of src folder
  3. Replace / with \ as needed
  4. Use this run command docker run --rm -e CHOKIDAR_USEPOLLING=true -v $(pwd)/src:/app/src:ro -d -p 3000:5173 opl-ui-img-06052023 **

Now, you can edit files on your local and they will be reflected in the container and on your running local instance.

Handy docker commands

Attach to a running server

docker exec -i -t <container-name-or-id> <shell-executable>

-i: keep STDIN (standard input) open -t: attach a pseudo-TTY (terminal) to the container's shell

Some docker flags explained

Application is served here

-v: is bind mount volume mapping -p: port forwarding from local to container :ro - is read-only, which prevents container saving files to your directory -e: flag can be used to pass environment variables --env-file : pass environment variables from a file

Chakra UI

Chakra UI crash course

License

MIT License

References

Working with axios Dockerize your React app CI/CD workflow on GitHub for React app Container Security https://www.kinetica.com/blog/gpus-transformed-xva-pricing-risk-calculations/ https://financialit.net/news/cloud/hsbc-counterparty-credit-risk-and-valuation-adjustments-google-cloud-case-study https://www.linkedin.com/pulse/blueprint-enterprise-architecture-richard-moran/ https://blog.protiviti.com/2018/07/02/blueprint-change-capability-reference-architecture-can-help-map-road-organizational-transformation-part-1-2/ https://www.leanix.net/en/wiki/ea/reference-architecture Implementing the Strategy Pattern using LLMs 5 Tools for Effortless Data Science How Large Language Models Will Revolutionize Software Engineering Chatbot with Langchain and Pinecone Chunking Strategies

oplui's People

Contributors

vatsaaa 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.