mirror of
https://github.com/p-stream/backend.git
synced 2026-03-11 17:55:35 +00:00
Fresh Start
This commit is contained in:
parent
e9fa3b2d58
commit
76344624b0
22 changed files with 0 additions and 334 deletions
1
.docker/development/.gitignore
vendored
1
.docker/development/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
||||||
config.env
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
# how to use docker development?
|
|
||||||
|
|
||||||
## How to setup?
|
|
||||||
1. have docker installed
|
|
||||||
2. create a `config.env` in `/.docker/development`. inspire its contents from `example.config.env`
|
|
||||||
|
|
||||||
## how to run?
|
|
||||||
1. while in directory `/.docker/development` run `docker compose up -d`
|
|
||||||
1.1 if running first time in docker, make sure you have no node_modules folder present in `/`.
|
|
||||||
|
|
||||||
## not working? try this:
|
|
||||||
1. while in directory `/.docker/development` run `docker compose down -v`
|
|
||||||
2. remove `node_modules` directory in `/` if it exists
|
|
||||||
3. remove `.env` and `config.json` file in `/` if any of them exist
|
|
||||||
4. while in directory `/.docker/development` run `docker compose up -d --build`
|
|
||||||
|
|
||||||
## how to stop?
|
|
||||||
1. while in directory `/.docker/development` run `docker compose down`
|
|
||||||
> NOTE: if you want also delete all saved data for a full reset, run `docker compose down -v` instead
|
|
||||||
|
|
||||||
## how do I access the terminal for the backend service?
|
|
||||||
make sure the docker services are running, then run `docker attach mw_backend-1`.
|
|
||||||
this will appear to show nothing at first, but all new logs will show up,
|
|
||||||
and anything you type in the terminal now affect the backend service.
|
|
||||||
> Warning: doing CTRL+C will shut down the backend service, it will not kick your terminal back to its original shell.
|
|
||||||
|
|
||||||
## how do I read logs?
|
|
||||||
1. while in directory `/.docker/development` run `docker compose ps`
|
|
||||||
2. note the name of the service you want to see the logs of
|
|
||||||
3. while in directory `/.docker/development` run `docker compose logs <NAME>`. fill in the name of the service without the brackets.
|
|
||||||
|
|
||||||
## Exposed ports
|
|
||||||
- http://localhost:8081 - backend API
|
|
||||||
- http://localhost:8082 - postgres web UI
|
|
||||||
- postgres://localhost:5432 - postgres
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
name: "mw_backend"
|
|
||||||
|
|
||||||
services:
|
|
||||||
# required services
|
|
||||||
postgres:
|
|
||||||
image: postgres
|
|
||||||
ports:
|
|
||||||
- '5432:5432'
|
|
||||||
environment:
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
volumes:
|
|
||||||
- 'postgres_data:/var/lib/postgresql/data'
|
|
||||||
redis:
|
|
||||||
image: redis
|
|
||||||
|
|
||||||
# custom services
|
|
||||||
backend:
|
|
||||||
stdin_open: true
|
|
||||||
tty: true
|
|
||||||
build:
|
|
||||||
dockerfile: ./dev.Dockerfile
|
|
||||||
context: ../../
|
|
||||||
volumes:
|
|
||||||
- '../../:/app'
|
|
||||||
env_file:
|
|
||||||
- './config.env'
|
|
||||||
ports:
|
|
||||||
- '8081:8080'
|
|
||||||
depends_on:
|
|
||||||
- postgres
|
|
||||||
environment:
|
|
||||||
- WAIT_HOSTS=postgres:5432
|
|
||||||
|
|
||||||
# util services
|
|
||||||
pgweb:
|
|
||||||
image: sosedoff/pgweb
|
|
||||||
ports:
|
|
||||||
- "8082:8081"
|
|
||||||
links:
|
|
||||||
- postgres:postgres
|
|
||||||
environment:
|
|
||||||
- PGWEB_DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
|
|
||||||
depends_on:
|
|
||||||
- postgres
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
postgres_data:
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
MWB_USE_PRESETS=dev,dockerdev
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
node_modules
|
|
||||||
.env
|
|
||||||
config.json
|
|
||||||
dist
|
|
||||||
.git
|
|
||||||
.vscode
|
|
||||||
.docker
|
|
||||||
.pnpm-store
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
|
|
||||||
33
.eslintrc.js
33
.eslintrc.js
|
|
@ -1,33 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
},
|
|
||||||
root: true,
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'plugin:prettier/recommended',
|
|
||||||
],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
parserOptions: {
|
|
||||||
sourceType: 'module',
|
|
||||||
},
|
|
||||||
plugins: ['@typescript-eslint'],
|
|
||||||
ignorePatterns: ['src/db/migrations/**/*'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/interface-name-prefix': 'off',
|
|
||||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-empty-interface': 'off',
|
|
||||||
'@typescript-eslint/no-inferrable-types': 'off',
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{
|
|
||||||
varsIgnorePattern: '^_',
|
|
||||||
destructuredArrayIgnorePattern: '^_',
|
|
||||||
argsIgnorePattern: '^_',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +0,0 @@
|
||||||
* text=auto eol=lf
|
|
||||||
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
|
@ -1 +0,0 @@
|
||||||
* @movie-web/project-leads
|
|
||||||
1
.github/CODE_OF_CONDUCT.md
vendored
1
.github/CODE_OF_CONDUCT.md
vendored
|
|
@ -1 +0,0 @@
|
||||||
Please visit the [main document at primary repository](https://github.com/movie-web/movie-web/blob/dev/.github/CODE_OF_CONDUCT.md).
|
|
||||||
1
.github/CONTRIBUTING.md
vendored
1
.github/CONTRIBUTING.md
vendored
|
|
@ -1 +0,0 @@
|
||||||
Please visit the [main document at primary repository](https://github.com/movie-web/movie-web/blob/dev/.github/CONTRIBUTING.md).
|
|
||||||
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: FifthWit
|
|
||||||
14
.github/SECURITY.md
vendored
14
.github/SECURITY.md
vendored
|
|
@ -1,14 +0,0 @@
|
||||||
# Security Policy
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
The movie-web maintainers only support the latest version of movie-web published at https://movie-web.app.
|
|
||||||
This published version is equivalent to the master branch.
|
|
||||||
|
|
||||||
Support is not provided for any forks or mirrors of movie-web.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
There are two ways you can contact the movie-web maintainers to report a vulnerability:
|
|
||||||
- Email [security@movie-web.app](mailto:security@movie-web.app)
|
|
||||||
- Report the vulnerability in the [movie-web Discord server](https://discord.movie-web.app)
|
|
||||||
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
|
|
@ -1,6 +0,0 @@
|
||||||
This pull request resolves #XXX
|
|
||||||
|
|
||||||
- [ ] I have read and agreed to the [code of conduct](https://github.com/movie-web/movie-web/blob/dev/.github/CODE_OF_CONDUCT.md).
|
|
||||||
- [ ] I have read and complied with the [contributing guidelines](https://github.com/movie-web/movie-web/blob/dev/.github/CONTRIBUTING.md).
|
|
||||||
- [ ] What I'm implementing was assigned to me and is an [approved issue](https://github.com/movie-web/movie-web/issues?q=is%3Aopen+is%3Aissue+label%3Aapproved). For reference, please take a look at our [GitHub projects](https://github.com/movie-web/movie-web/projects).
|
|
||||||
- [ ] I have tested all of my changes.
|
|
||||||
71
.github/workflows/linting_testing.yml
vendored
71
.github/workflows/linting_testing.yml
vendored
|
|
@ -1,71 +0,0 @@
|
||||||
name: Linting and Testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- dev
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
linting:
|
|
||||||
name: Run Linters
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Install packages
|
|
||||||
run: pnpm i
|
|
||||||
|
|
||||||
- name: Run ESLint
|
|
||||||
run: pnpm run lint
|
|
||||||
|
|
||||||
building:
|
|
||||||
name: Build project
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@v2
|
|
||||||
with:
|
|
||||||
version: 8
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Install packages
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build Project
|
|
||||||
run: pnpm build
|
|
||||||
|
|
||||||
docker:
|
|
||||||
name: Build docker
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
81
.github/workflows/release.yml
vendored
81
.github/workflows/release.yml
vendored
|
|
@ -1,81 +0,0 @@
|
||||||
name: Deploying
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: package-version
|
|
||||||
uses: martinbeentjes/npm-get-version-action@main
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ steps.package-version.outputs.current-version }}
|
|
||||||
release_name: Backend v${{ steps.package-version.outputs.current-version }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
registry:
|
|
||||||
name: Push to registry
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
env:
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Docker buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: package-version
|
|
||||||
uses: martinbeentjes/npm-get-version-action@main
|
|
||||||
|
|
||||||
- name: Log into registry ${{ env.REGISTRY }}
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract Docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}},value=v${{ steps.package-version.outputs.current-version }}
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: build-and-push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
context: .
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
node_modules
|
|
||||||
.env
|
|
||||||
config.json
|
|
||||||
dist
|
|
||||||
.pnpm-store
|
|
||||||
1
.npmrc
1
.npmrc
|
|
@ -1 +0,0 @@
|
||||||
shamefully-hoist=true
|
|
||||||
1
.nvmrc
1
.nvmrc
|
|
@ -1 +0,0 @@
|
||||||
20
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
trailingComma: 'all',
|
|
||||||
singleQuote: true
|
|
||||||
};
|
|
||||||
3
.vscode/extensions.json
vendored
3
.vscode/extensions.json
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"recommendations": ["dbaeumer.vscode-eslint", "editorconfig.editorconfig"]
|
|
||||||
}
|
|
||||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
|
||||||
"eslint.format.enable": true,
|
|
||||||
"[json]": {
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue