-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
621 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: ['20.17.0'] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
|
||
# https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.npm | ||
${{ github.workspace }}/.next/cache | ||
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | ||
restore-keys: | | ||
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | ||
- run: npm ci | ||
- run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: "Code Quality Analysis" | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze (${{ matrix.language }}) | ||
|
||
runs-on: 'ubuntu-latest' | ||
permissions: | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- language: javascript-typescript | ||
build-mode: none | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
build-mode: ${{ matrix.build-mode }} | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
name: ESLint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
eslint: | ||
name: Run eslint scanning | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
security-events: write | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
strategy: | ||
matrix: | ||
service: ["backend", "frontend"] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
**/package-lock.json | ||
- name: Install ESLint | ||
run: | | ||
npm install eslint | ||
npm install @microsoft/[email protected] | ||
- name: Run ESLint | ||
run: npx eslint apps/${{ matrix.service }}/ | ||
--config apps/${{ matrix.service }}/.eslintrc.json | ||
--format @microsoft/eslint-formatter-sarif | ||
--output-file apps/${{ matrix.service }}/eslint-results.sarif | ||
continue-on-error: true | ||
|
||
- name: Upload analysis results to GitHub | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: apps/${{ matrix.service }}/eslint-results.sarif | ||
wait-for-processing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
title: 'Quickstart' | ||
--- | ||
|
||
At the moment it is necessary to build the project locally - some dependencies | ||
like redis and postgres can run as docker containers, but there is no docker | ||
container for Postiz just yet. | ||
|
||
## Prerequisites | ||
|
||
To run the project you need to have multiple things: | ||
|
@@ -17,25 +21,29 @@ To run the project you need to have multiple things: | |
|
||
A complete guide of how to install NodeJS can be found [here](https://nodejs.org/en/download/). | ||
|
||
### PostgreSQL (or any other SQL database) | ||
### PostgreSQL (or any other SQL database) & Redis | ||
|
||
Make sure you have PostgreSQL installed on your machine. | ||
|
||
Make sure you have PostgreSQL installed on your machine.<br /> | ||
If you don't, you can install [Docker](https://www.docker.com/products/docker-desktop) and run: | ||
#### Option A) Postgres and Redis as Single containers | ||
|
||
```bash | ||
You can install [Docker](https://www.docker.com/products/docker-desktop) and run: | ||
|
||
```bash Terminal | ||
docker run -e POSTGRES_USER=root -e POSTGRES_PASSWORD=your_password --name postgres -p 5432:5432 -d postgres | ||
docker run --name redis -p 6379:6379 -d redis | ||
``` | ||
|
||
### Redis | ||
#### Option B) Postgres and Redis as docker-compose | ||
|
||
Make sure you have Redis installed on your machine.<br /> | ||
If you don't, you can install [Docker](https://www.docker.com/products/docker-desktop) and run: | ||
Download the [docker-compose.yaml file here](https://raw.githubusercontent.com/gitroomhq/postiz-app/main/docker-compose.dev.yaml), | ||
or grab it from the repository in the next step. | ||
|
||
```bash | ||
docker run --name redis -p 6379:6379 -d redis | ||
```bash Terminal | ||
docker compose -f "docker-compose.dev.yaml" up | ||
``` | ||
|
||
## Installation | ||
## Build Postiz | ||
|
||
<Steps> | ||
<Step title="Clone the repository"> | ||
|
@@ -44,11 +52,11 @@ git clone https://github.com/gitroomhq/gitroom | |
``` | ||
</Step> | ||
|
||
<Step title="Copy environment variables"> | ||
<Step title="Set environment variables"> | ||
Copy the `.env.example` file to `.env` and fill in the values | ||
|
||
```bash .env | ||
DATABASE_URL="postgres database URL" | ||
DATABASE_URL="postgres database URL i.g. postgresql://postiz-local:[email protected]:5432/postiz-db-local" | ||
REDIS_URL="redis database URL" | ||
JWT_SECRET="random string for your JWT secret, make it long" | ||
FRONTEND_URL="By default: http://localhost:4200" | ||
|
@@ -73,21 +81,15 @@ CLOUDFLARE_BUCKET_URL="Cloudflare R2 Backet URL" | |
NX_ADD_PLUGINS=false | ||
IS_GENERAL="true" # required for now | ||
``` | ||
|
||
</Step> | ||
|
||
<Step title="Install the dependencies"> | ||
|
||
```bash Terminal | ||
npm install | ||
``` | ||
</Step> | ||
|
||
<Step title="Setup postgres & redis via docker compose"> | ||
```bash Terminal | ||
docker compose -f "docker-compose.dev.yaml" up | ||
``` | ||
</Step> | ||
|
||
<Step title="Generate the prisma client and run the migrations"> | ||
```bash Terminal | ||
npm run prisma-db-push | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.