Skip to content

Commit

Permalink
Update README and package.json for better indicators in setup for win…
Browse files Browse the repository at this point in the history
…dows
  • Loading branch information
sabaimran committed Jun 18, 2024
1 parent db370e7 commit 727fe15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
20 changes: 16 additions & 4 deletions src/interface/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@ This is a [Next.js](https://nextjs.org/) project.

## Getting Started

First, run the development server:
First, install the dependencies:

```bash
yarn install
```

In case you run into any dependency linking issues, you can try running:

```bash
yarn add next
```

### Run the development server:

```bash
yarn dev
```

Make sure the `rewrites` in `next.config.js` are set up correctly for your environment. The rewrites are used to proxy requests to the API server.
Make sure the `rewrites` in `next.config.mjs` are set up correctly for your environment. The rewrites are used to proxy requests to the API server.

```js
rewrites: async () => {
Expand All @@ -27,9 +39,9 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

You can start editing the page by modifying any of the `.tsx` pages. The page auto-updates as you edit the file.

## Testing built files
### Testing built files

We've setup a utility command for building and serving the built files. This is useful for testing the production build locally. You'll have to uncomment and comment out the appropriate lines in the `next.config.js` file to enable the export feature. See the comments in the file for more information.
We've setup a utility command for building and serving the built files. This is useful for testing the production build locally.

1. Exporting code
To build the files once and serve them, run:
Expand Down
6 changes: 3 additions & 3 deletions src/interface/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"start": "next start",
"lint": "next lint",
"collectstatic": "bash -c 'pushd ../../../ && source .venv/bin/activate && python3 src/khoj/manage.py collectstatic --noinput && deactivate && popd'",
"windowscollectstatic": "Set-Location ..\\..\\..; .\\.venv\\Scripts\\Activate.ps1; python .\\src\\khoj\\manage.py collectstatic --noinput; Deactivate; Set-Location -",
"cicollectstatic": "bash -c 'pushd ../../../ && python3 src/khoj/manage.py collectstatic --noinput && popd'",
"export": "yarn build && cp -r out/ ../../khoj/interface/built && yarn collectstatic",
"windowsexport": "yarn build; Copy-Item -Recurse -Path .\\out\\ -Destination ..\\..\\khoj\\interface\\built; yarn windowscollectstatic",
"ciexport": "yarn build && cp -r out/ ../../khoj/interface/built && yarn cicollectstatic",
"watch": "nodemon --watch . --ext js,jsx,ts,tsx,css --ignore 'out/**/*' --exec 'yarn export'",
"windowswatch": "nodemon --watch . --ext js,jsx,ts,tsx,css --ignore 'out/**/*' --exec 'yarn windowsexport'"
"windowswatch": "nodemon --watch . --ext js,jsx,ts,tsx,css --ignore 'out/**/*' --exec 'yarn windowsexport'",
"windowscollectstatic": "cd ..\\..\\.. && .\\.venv\\Scripts\\Activate.bat && py .\\src\\khoj\\manage.py collectstatic --noinput && .\\.venv\\Scripts\\deactivate.bat && cd ..",
"windowsexport": "yarn build && xcopy out ..\\..\\khoj\\interface\\built /E /Y && yarn windowscollectstatic"
},
"dependencies": {
"@types/katex": "^0.16.7",
Expand Down

0 comments on commit 727fe15

Please sign in to comment.