Skip to content

Commit

Permalink
fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Tussies committed Dec 5, 2023
2 parents b6d2f8d + dafccad commit 0e057e4
Show file tree
Hide file tree
Showing 18 changed files with 2,327 additions and 340 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"plugins": ["unused-imports"],
"rules": {
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "warn",
"unused-imports/no-unused-vars": "warn"
}
}
58 changes: 58 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Test

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
WORKFLOW_NODE_VERSION: 20.x

jobs:
test:
name: Test

runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
name: Use Node.js ${{ env.WORKFLOW_NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.WORKFLOW_NODE_VERSION }}
-
name: pnpm install
run: npm install -g pnpm
-
run: pnpm install --frozen-lockfile
-
run: pnpm test

build:
name: Build docker container

runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GitHub Container Registry
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build Docker image (and push on main)
uses: docker/[email protected]
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/cthit/chalmers.it:latest
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Linting

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
WORKFLOW_NODE_VERSION: 20.x

jobs:
run-linters:
name: Execute linters
runs-on: ubuntu-latest

steps:
-
uses: actions/checkout@v3
-
name: Use Node.js ${{ env.WORKFLOW_NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.WORKFLOW_NODE_VERSION }}
-
name: pnpm install
run: npm install -g pnpm
-
run: pnpm install prettier
-
run: pnpm install --frozen-lockfile
-
name: ESLint
uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
filter_mode: file
level: warning
tool_name: ESLint
-
name: Prettier
uses: EPMatt/reviewdog-action-prettier@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
filter_mode: file
level: warning
tool_name: Prettier
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# chalmers.it
A to-be rewrite of [chalmersit-rails](https://github.com/cthit/chalmersit-rails)
An ongoing rewrite of [chalmersit-rails](https://github.com/cthit/chalmersit-rails) in Next.js

## Suggestions
Suggestions are very welcome, and if you wish to create one, please create an issue and tag it with the `suggestion` label.
## Suggestions and Contributions
Suggestions are very welcome, and if you wish to create one, please create an issue using one of the templates.
Contributions are also welcome, feel free to create a pull request with your changes.

# Building and running

## Prerequisites
A few things are required to run the project:
1. [Node.js](https://nodejs.org/en/) v20 for running the web server
2. Docker for running other services
3. pnpm (installed with `npm install -g pnpm`)

## Running in development
1. Install packages with `pnpm install`
2. Start services by running `docker-compose -f docker-compose.dev.yml up -d`
3. Set up the database by running `pnpm prisma generate` and `pnpm prisma db push`
4. Run `pnpm run dev` to start the development server

## Production use

The easiest to run the project in production mode is to use the docker-compose file in the root of the project.
This will start all the services needed, and expose the web server on port 3000.

The project can also be compiled into a minimized file structure, which can be run with just Node.
This is done by running `pnpm run build`, which will build the project to `.next/standalone`.
Services will however be needed to be started separately.
The project is also compiled this way when building the docker image.
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,30 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"test": "jest"
},
"dependencies": {
"@prisma/client": "^5.4.2",
"ansis": "^1.5.6",
"colorette": "^2.0.20",
"next": "13.5.4",
"next": "14.0.3",
"jest": "^29.7.0",
"next-logger": "^3.0.2",
"next-themes": "^0.2.1",
"pino": "^8.16.0",
"pino-pretty": "^10.2.3",
"react": "^18.2",
"react-dom": "^18.2",
"react": "^18",
"react-dom": "^18",
"react-icons": "^4.12.0"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18.2",
"@types/react-dom": "^18.2",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "13.5.4",
"eslint-config-next": "14.0.3",
"eslint-plugin-unused-imports": "^3.0.0",
"prisma": "^5.4.2",
"sass": "^1.69.1",
"typescript": "^5"
Expand Down
Loading

0 comments on commit 0e057e4

Please sign in to comment.