This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore!: migrate to Yarn v4 BREAKING CHANGE: modern Yarn is required since this commit * feat: personalized fallback userpics * fix: use single prisma instance * feat: add member balances
- Loading branch information
1 parent
46cff8a
commit d3fe2e1
Showing
22 changed files
with
5,710 additions
and
3,455 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,10 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{js,json,yml}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 |
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 +1,3 @@ | ||
* text eol=lf | ||
* text eol=lf | ||
/.yarn/releases/** binary | ||
/.yarn/plugins/** binary |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
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,34 +1,21 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
# Swynca | ||
|
||
## Getting Started | ||
Shiny Ultra Brand New Accounting & Members Management. | ||
|
||
First, run the development server: | ||
README is TBD. | ||
|
||
```bash | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. | ||
|
||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. | ||
|
||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. | ||
## Installation | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
This is Next.js project with modern Yarn as package manager. | ||
Current Node.js LTS release is required. | ||
|
||
## Learn More | ||
```shell | ||
# If you don't have Yarn v2 installed, run: | ||
corepack enable | ||
yarn set version stable | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
# Install deps | ||
yarn install | ||
``` | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. | ||
**TODO:** configuration, SSO, all the stuff. Currently, reach to @imcatwhocode or @shatie for instructions. |
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 |
---|---|---|
|
@@ -49,5 +49,6 @@ | |
"pretty-quick": "^3.1.3", | ||
"prisma": "^5.5.2", | ||
"tailwindcss": "^3.3.5" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
29 changes: 29 additions & 0 deletions
29
prisma/migrations/20231203003914_add_member_transactions/migration.sql
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,29 @@ | ||
-- CreateEnum | ||
CREATE TYPE "MemberTransactionDeposit" AS ENUM ('MAGIC', 'DONATE', 'TOPUP'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "MemberTransactionWithdrawal" AS ENUM ('MAGIC', 'MEMBERSHIP'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "MemberTransaction" ( | ||
"id" TEXT NOT NULL, | ||
"type" "TransactionType" NOT NULL, | ||
"amount" DECIMAL(18,2) NOT NULL, | ||
"comment" TEXT, | ||
"date" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"subjectId" TEXT NOT NULL, | ||
"actorId" TEXT, | ||
"source" "MemberTransactionDeposit", | ||
"target" "MemberTransactionWithdrawal", | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"deleted" TIMESTAMP(3), | ||
|
||
CONSTRAINT "MemberTransaction_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "MemberTransaction" ADD CONSTRAINT "MemberTransaction_actorId_fkey" FOREIGN KEY ("actorId") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "MemberTransaction" ADD CONSTRAINT "MemberTransaction_subjectId_fkey" FOREIGN KEY ("subjectId") REFERENCES "Member"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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
2 changes: 1 addition & 1 deletion
2
src/app/(protected)/finance/_components/create-transaction/action.ts
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
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,17 @@ | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
const prismaClientSingleton = () => { | ||
return new PrismaClient(); | ||
}; | ||
|
||
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>; | ||
|
||
const globalForPrisma = globalThis as unknown as { | ||
prisma: PrismaClientSingleton | undefined; | ||
}; | ||
|
||
const prisma = globalForPrisma.prisma ?? prismaClientSingleton(); | ||
|
||
export default prisma; | ||
|
||
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma; |
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.