Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @sutne
* @sutne
3 changes: 2 additions & 1 deletion .github/workflows/lint-and-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
cache: npm

- name: Install Dependencies
run: npm ci
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.env
.DS_Store
.vscode/*
!.vscode/tasks.json
.vscode
node_modules
.vercel
19 changes: 19 additions & 0 deletions .mise/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tools]
node = "24"
python = "3.13"

[env]
_.file = ".env"

[task_config]
includes = [
".mise/tasks/general.toml",
".mise/tasks/scripts.toml",
".mise/tasks/vercel.toml",
]

[settings]
experimental = true

[hooks]
postinstall = ["mise run install-dependencies"]
16 changes: 16 additions & 0 deletions .mise/tasks/general.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[install-dependencies]
description = "Install dependencies"
run = ["npm install"]

[serve]
description = "Serve api with hot reloading on changes"
depends = "install-dependencies"
run = "npx vercel dev"

[clean]
description = "Remove all untracked or safe to remove files"
run = "git clean -fdx -e .env -e .vercel"

[format]
description = "Format all files"
run = ["mise fmt", "npm run check"]
3 changes: 3 additions & 0 deletions .mise/tasks/scripts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[get-playstation-refresh-token]
description = "Run .ts script to retreive PSN refresh token."
run = "npx ts-node scripts/get_playstation_refresh_token.ts"
15 changes: 15 additions & 0 deletions .mise/tasks/vercel.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[env-upload]
description = "Upload all local .env variables to Vercel"
run = "python scripts/sync-env.py"

[env-upload-psn]
description = "Upload local PLAYSTATION_REFRESH_TOKEN from .env to Vercel"
run = "python scripts/sync-env.py PLAYSTATION_REFRESH_TOKEN"

[env-download]
description = "Download current .env production variables from Vercel"
run = "npx vercel pull --environment=production"

[deploy]
description = "Deploy current local api to Vercel (also done in ci on push to main)"
run = "npx vercel deploy --prod"
2 changes: 1 addition & 1 deletion .vercelignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ scripts
.prettierrc
package-lock.json
README.md
temp*
temp*
77 changes: 0 additions & 77 deletions .vscode/tasks.json

This file was deleted.

31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,37 @@

Some basic endpoints hosted at [vercel][api] that I use for my personal projects.

## Development

### Configuration

To setup the dev environment, perform the following:

1. Install [mise][mise], make sure to also:
- add auto-activation for your shell
- add autocompletion (if it wasn't done automatically)
2. `mise install`
3. `mise run env-download`
1. When prompted, sign in link this repo to the `personal-api` vercel project.
2. rename the created: `.vercel/.env.production.local` to `.env`
3. (optional) remove all variables that don't start with:
- `SPOTIFY_`
- `GITHUB_`
- `PLAYSTATION_`

### Running

Once the dev environment is configured, launch the api with:

```sh
mise serve
```

> To show all available commands write `mise run` and hit **tab**.



[on-push-main-action]: https://github.com/sutne/personal-api/actions/workflows/on-push-main.yaml
[on-push-main-action-badge]: https://github.com/sutne/personal-api/actions/workflows/on-push-main.yaml/badge.svg
[api]: https://personal-sutne.vercel.app
[api]: https://personal-sutne.vercel.app
[mise]: https://mise.jdx.dev/getting-started.html
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down Expand Up @@ -29,4 +29,4 @@
"trailingCommas": "all"
}
}
}
}
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ <h4>Spotify</h4>
</a>
</p>
<h4>Github</h4>
<p>Repos:
<p>Repos:
<a href="/api/github/repos">
/api/github/repos
</a>
</p>
<p>
Languages:
Languages:
<a href="/api/github/languages">
/api/github/languages
</a>
</p>
<h4>Playstation</h4>
<p>
Profile:
Profile:
<a href="/api/playstation/profile">
/api/playstation/profile
</a>
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"scripts": {
"start": "vercel dev",
"deploy": "vercel deploy --prod",
"check": "biome check --write --unsafe --diagnostic-level=error",
"compile": "tsc --noEmit"
},
Expand Down