Skip to content

Commit

Permalink
Migrate project to SvelteKit
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldiekmeier committed May 1, 2023
1 parent ddb7467 commit 5100758
Show file tree
Hide file tree
Showing 35 changed files with 1,330 additions and 5,011 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/config
/dist
/.svelte-kit
/build
/node_modules
.env.local
35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,27 @@

List the latest albums of your followed artists in chronological order.

![Screenshot](https://raw.githubusercontent.com/danieldiekmeier/spotify-latest-releases/master/screenshot.jpg)
![Screenshot](https://raw.githubusercontent.com/danieldiekmeier/spotify-latest-releases/main/screenshot.jpg)

## Installation

You can install this on your own server, if you want.

Before you start, you should register an application with Spotify, by going here: https://developer.spotify.com/my-applications/#!/applications. This is where you get your `clientId` and `clientSecret`, and where you have to enter your `redirectUri`.
Before you start, you should register an application with Spotify, by going here: https://developer.spotify.com/dashboard. This is where you get your `clientId` and `clientSecret`, and where you have to enter your `redirectUri`.

1. Clone
2. Run `yarn` to install the dependencies
3. Create `config/index.js` and `config/client.js`, with following contents:
2. Run `pnpm i` (or `npm i`) to install the dependencies
3. You have to pass these three environment variables to the app:

```js
// index.js
const clientConfig = require('./client')
```env
PUBLIC_CLIENT_ID=YOUR_CLIENT_ID
PUBLIC_REDIRECT_URI=http://localhost:5173/callback
module.exports = Object.assign({
port: 5000,
clientSecret: <client_secret>
}, clientConfig)
CLIENT_SECRET=YOUR_CLIENT_SECRET
```

```js
// client.js
module.exports = {
clientId: <client_id>,
redirectUri: <your_redirect_url>
}
```

4. Run `yarn build`
5. Run `node src/app.js`
6. Go to `localhost:5000` to see the app.
(The easiest way to do this locally is to create a `.env.local` file in the root of the project.)

Make sure you have Node >= 7.6 installed.
4. Run `pnpm build` to build the SvelteKit app
5. Run `node build`
6. Go to `localhost:3000` to see the app. (You can change the port by setting the `PORT` environment variable.)
3 changes: 3 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./.svelte-kit/tsconfig.json",
}
58 changes: 14 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
{
"name": "spotify-releases",
"version": "1.0.0",
"main": "index.js",
"version": "2.0.0",
"private": true,
"type": "module",
"license": "MIT",
"scripts": {
"webpack:serve": "webpack-dev-server --hot",
"build": "rm -rf ./dist && NODE_ENV=production webpack -p"
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"browsers": [
"last 3 versions",
"ie >= 10"
]
}
}
]
]
"dev": "vite dev",
"build": "vite build"
},
"dependencies": {
"axios": "^0.16.1",
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.4.0",
"babili-webpack-plugin": "^0.0.11",
"bluebird": "^3.5.0",
"compression-webpack-plugin": "^0.4.0",
"css-loader": "^0.28.1",
"html-webpack-plugin": "^2.28.0",
"koa": "^2.2.0",
"koa-router": "^7.1.1",
"koa-static": "^3.0.0",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"qs": "^6.4.0",
"rupture": "^0.6.2",
"spotify-web-api-node": "^2.4.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue": "^2.3.2",
"vue-loader": "^12.0.3",
"vue-template-compiler": "^2.3.2",
"webpack": "^2.5.0",
"webpack-dev-server": "^2.4.5"
"svelte": "^3.58.0",
"svelte-kit-cookie-session": "^3.4.1",
"zod": "^3.21.4"
},
"devDependencies": {
"@sveltejs/adapter-node": "^1.2.4",
"@sveltejs/kit": "^1.15.9",
"@sveltejs/vite-plugin-svelte": "^2.1.1",
"vite": "^4.3.3"
}
}

0 comments on commit 5100758

Please sign in to comment.