Skip to content

Commit

Permalink
Add cspell and pr check (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
borisno2 authored Dec 26, 2023
1 parent ebeb2dd commit ca7b7e7
Show file tree
Hide file tree
Showing 16 changed files with 901 additions and 37 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test on PR

on:
push:
branches:
- main
- dev
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: corepack enable

- uses: actions/setup-node@main
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- run: pnpm install
- run: pnpm lint
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ Emily is a String and Theatre teacher in Bendigo, Victoria, Australia. Her Drama

## What it does (function)

The project allows students and their parents/guardians to view the timetable, check fees, see class availability and enrol through the Student Portal/Dashboard. Once enroled they click enrol in their dashboard, the enrolment is set to `Pending`, then Emily can confirm thier enrolment by setting its status to `Enroled`. Once the status is set to `Enroled` a confirmation email is sent to the account owner with the time and start date pulled from the `Lesson` and `Term`.
The project allows students and their parents/guardians to view the timetable, check fees, see class availability and enroll through the Student Portal/Dashboard. Once enrolled they click enroll in their dashboard, the enrolment is set to `Pending`, then Emily can confirm their enrolment by setting its status to `Enroled`. Once the status is set to `Enroled` a confirmation email is sent to the account owner with the time and start date pulled from the `Lesson` and `Term`.

We use Xero for book keeping, we can generate invoices for the Term which creates them in Xero ready to send.
We use Xero for bookkeeping, we can generate invoices for the Term which creates them in Xero ready to send.

## Tech Stack

I wanted to try something new, have a super easy deployment experience, and not have the headache of looking after servers.

With that in mind I went with the following
With that in mind, I went with the following

### Keystone - In Next using `getContext`

This was a fairly obvoius choice for me, I spend my work days developing so know if farily well, it also provides a pretty awesome backend application framework. With the new `getContext` API I also don't need to run a server anymore. I am still using Apollo Server, but deployed through the frontend NextJS app.
This was a fairly obvious choice for me, I spend my work days developing so know it fairly well, and it also provides a pretty awesome backend application framework. With the new `getContext` API, I also don't need to run a server any more. I am still using Apollo Server but deployed through the frontend NextJS app.

### NextJS `/app` Directory

As I said I was keen on trying something new, the app directory/server side react components along with `getContext` make page building and data fetching much more straight forward.
As I said I was keen on trying something new, the app directory/server side react components along with `getContext` make page building and data fetching much more straightforward.

### NextAuth

Expand All @@ -33,10 +33,10 @@ PlanetScale offers a pretty generous free tier and their schema branching was so
### Others to note

- Tailwind both some UI components and CSS
- Inngest - starting to play around with backgrounding tasks, expecially for generating invoices based on events (not completely impletmented yet).
- Inngest - starting to play around with backgrounding tasks, especially for generating invoices based on events (not completely implemented yet).

# Give it a Go.

You can see the dev environment on Vercel at [emily-calder.vercel.app](https://emily-calder.vercel.app) - it does only have test data - feel free to register and give it a go. The production site is at [www.emilycalder.com.au](https://www.emilycalder.com.au) - feel free to check it out, but please don't enrol unless you are interested in having lessons in Bendigo (and get the bill for it).
You can see the dev environment on Vercel at [emily-calder.vercel.app](https://emily-calder.vercel.app) - it does only have test data - feel free to register and give it a go. The production site is at [www.emilycalder.com.au](https://www.emilycalder.com.au) - feel free to check it out, but please don't enroll unless you are interested in having lessons in Bendigo (and get the bill for it).

You can try it out on Dev by cloing the repo and running `pnpm install` and `pnpm dev` which will start two nextjs dev servers, one hosting the main site including the GraphQL API on port `3000` and one hosting the Keystone Admin UI on port `4000`, the Keystone UI is proxied through the frontend at `/admin`.
You can try it out on Dev by cloning the repo and running `pnpm install` and `pnpm dev` which will start two nextjs dev servers, one hosting the main site including the GraphQL API on port `3000` and one hosting the Keystone Admin UI on port `4000`, the Keystone UI is proxied through the frontend at `/admin`.
23 changes: 23 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./project-words.txt",
"addWords": true
}
],
"language": "en-GB",
"languageId": "typescript",
"dictionaries": ["project-words"],
"ignorePaths": [
"node_modules",
"/project-words.txt",
"/pnpm-lock.yaml",
"*.css",
"/tailwind.config.js",
"__generated__",
"dist"
]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"postinstall": "keystone build --no-ui --frozen && ts-gql build",
"seed-data": "tsx seed-data.ts",
"ts-gql:build": "ts-gql build",
"ts-gql:watch": "ts-gql watch"
"ts-gql:watch": "ts-gql watch",
"lint": "eslint --ext .ts,.tsx . && cspell '**' && tsc --noEmit"
},
"dependencies": {
"@apollo/server": "^4.9.5",
Expand Down Expand Up @@ -79,6 +80,7 @@
"@types/node": "^20.10.5",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"cspell": "^8.2.3",
"eslint": "8.56.0",
"eslint-config-next": "14.0.4",
"prettier": "^3.1.1",
Expand Down
Loading

0 comments on commit ca7b7e7

Please sign in to comment.