Removed obsolete backend dependencies
This commit is contained in:
1 parent
47db7abd6a
commit
a0a62c1c06
7 files changed
+112
-496
No files matched your search
@@ -1,75 +1,57 @@
|
||||
# Nuxt Minimal Starter
|
||||
# Music v2
|
||||
|
||||
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
||||
Music v2 is a Nuxt 4 application. Its Nitro server provides the API, authentication, database access, upload handling, and media routes alongside the frontend.
|
||||
|
||||
## Setup
|
||||
## Local setup
|
||||
|
||||
Make sure to install dependencies:
|
||||
Install dependencies and create a local environment file:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
```sh
|
||||
npm install
|
||||
|
||||
# pnpm
|
||||
pnpm install
|
||||
|
||||
# yarn
|
||||
yarn install
|
||||
|
||||
# bun
|
||||
bun install
|
||||
cp -n .env.example .env
|
||||
```
|
||||
|
||||
## Development Server
|
||||
For an existing local `.env`, update its values instead of replacing the file. Set `NUXT_MONGODB_URI` to a MongoDB connection string. Set `NUXT_UPLOAD_DIR` to a writable directory for uploaded artwork and audio. `NUXT_TOKEN_EXPIRE` is optional and defaults to `1h`.
|
||||
|
||||
Start the development server on `http://localhost:3000`:
|
||||
Run the app at <http://localhost:3000>:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
```sh
|
||||
npm run dev
|
||||
|
||||
# pnpm
|
||||
pnpm dev
|
||||
|
||||
# yarn
|
||||
yarn dev
|
||||
|
||||
# bun
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Production
|
||||
## Runtime configuration
|
||||
|
||||
Build the application for production:
|
||||
The private settings are declared in `nuxt.config.ts` and can be set with matching `NUXT_` environment variables:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
| Variable | Required | Description |
|
||||
| --- | --- | --- |
|
||||
| `NUXT_MONGODB_URI` | Yes | MongoDB connection URI. |
|
||||
| `NUXT_UPLOAD_DIR` | Yes for upload/media operations | Writable path where uploaded media is stored. Prefer an absolute path. |
|
||||
| `NUXT_TOKEN_EXPIRE` | No | Session lifetime accepted by `parse-duration`, such as `1h` or `7d`; defaults to `1h`. |
|
||||
|
||||
For a short migration window, the server also accepts the standalone backend names `MONGODB_URI`, `UPLOAD_DIR`, and `TOKEN_EXPIRE` as fallbacks. Prefer the `NUXT_` names for all new deployments. `VITE_PUBLIC_BACKEND` is no longer used: browser API requests are same-origin.
|
||||
|
||||
Nuxt loads `.env` while running its CLI for development and local production preview, but a built server does not load `.env`. Configure these variables in the production process manager or hosting environment. See the [Nuxt runtime config guide](https://nuxt.com/docs/4.x/guide/going-further/runtime-config) and [deployment guide](https://nuxt.com/docs/4.x/getting-started/deployment).
|
||||
|
||||
## Production deployment
|
||||
|
||||
Deploy the Nuxt server using the Node.js Nitro output:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
|
||||
# pnpm
|
||||
pnpm build
|
||||
|
||||
# yarn
|
||||
yarn build
|
||||
|
||||
# bun
|
||||
bun run build
|
||||
NODE_ENV=production node .output/server/index.mjs
|
||||
```
|
||||
|
||||
Locally preview production build:
|
||||
The server listens on port `3000` by default; Nitro also honors `PORT`/`NITRO_PORT` and `HOST`/`NITRO_HOST`. A reverse proxy may terminate TLS and forward requests to this server.
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm run preview
|
||||
The upload directory must be writable and persist across deployments/restarts, and all Nuxt instances serving the same library must see the same files. Static/serverless deployments without persistent writable storage are not suitable for the current upload and media routes. Install `ffmpeg` and `ffprobe` on the host and make them available on `PATH`; audio uploads are processed after they are received. Configure an ingress or reverse-proxy request size limit appropriate for audio uploads.
|
||||
|
||||
# pnpm
|
||||
pnpm preview
|
||||
`npm run generate` creates static output and cannot provide this backend, database, authentication, or upload functionality. Use the Node server deployment above.
|
||||
|
||||
# yarn
|
||||
yarn preview
|
||||
## Checks
|
||||
|
||||
# bun
|
||||
bun run preview
|
||||
```sh
|
||||
npx tsc --noEmit -p .nuxt/tsconfig.app.json
|
||||
npx tsc --noEmit -p .nuxt/tsconfig.server.json
|
||||
npm run build
|
||||
```
|
||||
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
Reference in new issue
Block a user