Skip to content

Commit 6ebdf70

Browse files
authored
feat: add redis and helpers (#345)
1 parent 078a2f7 commit 6ebdf70

30 files changed

Lines changed: 12681 additions & 244 deletions

.env.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
SITE_URL=http://localhost:3000
2+
NEXT_PUBLIC_SITE_URL=http://localhost:3000
3+
NEXT_PUBLIC_API_URL=http://localhost:3333
4+
USOS_APPS_URL=https://apps.usos.pwr.edu.pl
5+
USOS_CONSUMER_KEY=
6+
USOS_CONSUMER_SECRET=
7+
8+
FORMS_LINK=
9+
FORMS_FIELD_EMAIL=
10+
FORMS_FIELD_TITLE=
11+
FORMS_FIELD_DESCRIPTION=
12+
GITHUB_TOKEN=
13+
14+
DATABASE_URL=postgresql://planer:planer@localhost:5432/planer
15+
REDIS_URL=redis://localhost:6379
16+
BETTER_AUTH_SECRET=secret
17+
BETTER_AUTH_URL=http://localhost:3000

.github/workflows/frontend_ci.yaml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,11 @@ name: CI
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ["main", "beta"]
66
pull_request:
7-
branches: ["main"]
7+
branches: ["main", "beta"]
88

99
jobs:
10-
commitlint:
11-
name: Commitlint
12-
if: github.event_name == 'pull_request'
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Check out
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Install
21-
uses: ./.github/composite-actions/install
22-
23-
- name: Run commitlint check
24-
run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }}
25-
2610
lint:
2711
runs-on: ubuntu-latest
2812
steps:

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
.pnp.js
88
.yarn/install-state.gz
99

10-
# pnpm
11-
pnpm-lock.yaml
12-
1310
# testing
1411
/coverage
1512

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,15 @@ services:
1111
volumes:
1212
- db-data:/var/lib/postgresql/data
1313

14+
redis:
15+
image: redis:7-alpine
16+
restart: always
17+
ports:
18+
- 6379:6379
19+
volumes:
20+
- redis-data:/data
21+
command: redis-server --save 60 1 --loglevel warning
22+
1423
volumes:
1524
db-data:
25+
redis-data:

drizzle.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import "dotenv/config";
22
import { defineConfig } from "drizzle-kit";
33

4+
// eslint-disable-next-line import/no-default-export
45
export default defineConfig({
56
out: "./drizzle",
67
schema: "./src/db/schema/index.ts",
78
dialect: "postgresql",
8-
dbCredentials: { url: process.env.DATABASE_URL! },
9+
dbCredentials: { url: process.env.DATABASE_URL ?? "" },
910
});

eslint.config.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
// import { solvro } from "@solvro/config/eslint";
2-
// export default solvro({
3-
// rules: {
4-
// "jsx-a11y/label-has-associated-control": [
5-
// "error",
6-
// {
7-
// labelComponents: ["Label"],
8-
// labelAttributes: ["label"],
9-
// controlComponents: ["Checkbox"],
10-
// depth: 3,
11-
// },
12-
// ],
13-
// },
14-
// });
15-
import nextVitals from "eslint-config-next/core-web-vitals";
16-
import nextTs from "eslint-config-next/typescript";
17-
import { defineConfig, globalIgnores } from "eslint/config";
1+
import { solvro } from "@solvro/config/eslint";
182

19-
const eslintConfig = defineConfig([
20-
...nextVitals,
21-
...nextTs,
22-
// Override default ignores of eslint-config-next.
23-
globalIgnores([
24-
// Default ignores of eslint-config-next:
25-
".next/**",
26-
"out/**",
27-
"build/**",
28-
"next-env.d.ts",
29-
]),
30-
]);
3+
export default solvro({
4+
rules: {
5+
"jsx-a11y/label-has-associated-control": [
6+
"error",
7+
{
8+
labelComponents: ["Label"],
9+
labelAttributes: ["label"],
10+
controlComponents: ["Checkbox"],
11+
depth: 3,
12+
},
13+
],
14+
},
15+
});
16+
// import nextVitals from "eslint-config-next/core-web-vitals";
17+
// import nextTs from "eslint-config-next/typescript";
18+
// import { defineConfig, globalIgnores } from "eslint/config";
3119

32-
export default eslintConfig;
20+
// const eslintConfig = defineConfig([
21+
// ...nextVitals,
22+
// ...nextTs,
23+
// // Override default ignores of eslint-config-next.
24+
// globalIgnores([
25+
// // Default ignores of eslint-config-next:
26+
// ".next/**",
27+
// "out/**",
28+
// "build/**",
29+
// "next-env.d.ts",
30+
// ]),
31+
// ]);
32+
33+
// export default eslintConfig;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"framer-motion": "^12.35.0",
5454
"html-to-image": "^1.11.11",
5555
"input-otp": "^1.4.2",
56+
"ioredis": "^5.10.1",
5657
"jotai": "^2.9.3",
5758
"jotai-family": "^1.0.1",
5859
"lucide-react": "^0.426.0",
@@ -75,7 +76,7 @@
7576
"zod": "^4.3.6"
7677
},
7778
"devDependencies": {
78-
"@solvro/config": "^2.0.7",
79+
"@solvro/config": "^2.3.0",
7980
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
8081
"@types/crypto-js": "^4.2.2",
8182
"@types/node": "^20.17.10",

0 commit comments

Comments
 (0)