-
Notifications
You must be signed in to change notification settings - Fork 1
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
18 changed files
with
2,327 additions
and
340 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 |
---|---|---|
@@ -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" | ||
} | ||
} |
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,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 |
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,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 |
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 |
---|---|---|
@@ -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. |
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.