-
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.
[Release 1.2.0] - Adding new features and bug fixes π (#9)
At this pull request, we have made a lot of improvements in all the app. - [x] Added new docs to readme - [x] Added mainly features. - [x] And much more!
- Loading branch information
Showing
10 changed files
with
109 additions
and
49 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 |
---|---|---|
|
@@ -39,4 +39,7 @@ next-env.d.ts | |
.env | ||
|
||
# docker | ||
.postgres-data | ||
.postgres-data | ||
|
||
# IDES | ||
.idea |
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,36 +1,47 @@ | ||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). | ||
# π Jupiter finance, seu gerenciador de finanΓ§as inteligente. | ||
|
||
## Getting Started | ||
O Jupiter Finance foi desenvolvido com auxilio da full stack week, do Felipe Rocha, e sofreu algumas mudanΓ§as para tornΓ‘-lo ΓΊnico e feito com carinho por mim, Wesley. π | ||
|
||
First, run the development server: | ||
--- | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
## π Funcionalidades | ||
|
||
- [x] VocΓͺ pode adicionar transaçáes com base na sua data atual, transaçáes futuras (com o date picker), e adicionar transaçáes da datas passadas. | ||
- [x] VocΓͺ pode deletar transaçáes | ||
- [x] VocΓͺ pode editar transaçáes (nome, valor, data, etc) | ||
- [x] Validaçáes de seguranΓ§a adicionadas, vocΓͺ pode obter os dados apenas se vocΓͺ estiver autenticado, e se aqueles dados forem seus. | ||
- [ ] Dashboard pra gerenciar usuÑrios, orgs, webhooks, e mais. (Apenas pra desenvolvimento e pra administração apenas, em produção.) | ||
- [ ] Adicionar novos meios de autenticação além do clerk (auth js, por exemplo). | ||
- [x] Adicionar logs de clicks, page views, web records, e mais, usando o PostHog. | ||
- [ ] Adicionar WebHooks do discord, etc | ||
- [ ] Adicionar organizaçáes no login (originalmente clerk, deve ser implementado do zero se for auth js. A logica deve ser feita o mais genΓ©rica o possΓvel em caso do uso de outros mΓ©todos de login.). | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
--- | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
## π Como contribuir | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. | ||
Para contribuir, vocΓͺ pode clonar o repositΓ³rio e seguir os seguintes passos: | ||
|
||
## Learn More | ||
### 1. Clonando repositΓ³rio | ||
|
||
```bash | ||
git clone https://github.com/neopromic/jupiter-finance.git | ||
``` | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
### 2. Obtendo variΓ‘veis de ambiente de desenvolvimento | ||
|
||
- [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. | ||
- 1. Primeiro, vocΓͺ deve ter o docker instalado em sua mΓ‘quina, ou criar um banco de testes grΓ‘tis na [neon](https://neon.tech). | ||
- 2. Em seu `.env`, cole a string de conexΓ£o obtida no [neon.tech](https://neon.tech), ou use `"postgresql://postgres:password@localhost:5432/finance-ai"` do docker. | ||
- 3. Caso prefira usar o docker, suba o container (pois o docker compose jΓ‘ estΓ‘ configurado no projeto), usando `docker compose up -d`. | ||
- 4. Crie um projeto no clerk, e obtenha as credenciais. | ||
- 5. Crie uma conta no PostHog e adicione as credenciais. | ||
- Pronto! Credenciais adicionadas! π | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! | ||
### 3. Crie uma branch nova e comece a contribuir! | ||
|
||
## Deploy on Vercel | ||
- 1. Crie uma nova branch (`git branch feat/name-of-the-feat && git checkout feat/name-of-the-feat`) | ||
- 2. Quando for fazer Pull Request, envie pra comparação com a branch de **`dev`**(desenvolvimento)! Nós lançamos primeiro na dev, e depois fazemos merge na main, quando tiver um bom número de mudanças. | ||
|
||
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. | ||
--- | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. | ||
#### Criado por Wesley Souza, com carinho. π |
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
23 changes: 23 additions & 0 deletions
23
app/(authenticated)/transactions/_components/delete-transaction-button.tsx
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,23 @@ | ||
import { deleteTransaction } from "@/app/_actions/delete-transactions"; | ||
import { Button } from "@/app/_components/ui/button"; | ||
import { TrashIcon } from "lucide-react"; | ||
|
||
interface IDeleteTransactionsButtonProps { | ||
transactionId: string; | ||
} | ||
|
||
const DeleteTransactionButton = ({ | ||
transactionId, | ||
}: IDeleteTransactionsButtonProps) => { | ||
const handleClick = async () => { | ||
await deleteTransaction({ transactionId }); | ||
}; | ||
|
||
return ( | ||
<Button variant="ghost" size="icon" onClick={handleClick}> | ||
<TrashIcon size={16} /> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default DeleteTransactionButton; |
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 @@ | ||
"use server"; | ||
|
||
import { db } from "@/app/_lib/prisma"; | ||
import { auth } from "@clerk/nextjs/server"; | ||
import { revalidatePath } from "next/cache"; | ||
|
||
interface IDeleteTransactions { | ||
transactionId: string; | ||
} | ||
|
||
export const deleteTransaction = async ({ | ||
transactionId, | ||
}: IDeleteTransactions) => { | ||
const { userId } = await auth(); | ||
|
||
if (!userId) { | ||
throw new Error("", { | ||
cause: "You need log-in account to delete transactions.", | ||
}); | ||
} | ||
|
||
await db.transactions.delete({ | ||
where: { | ||
id: transactionId, | ||
userId, | ||
}, | ||
}); | ||
revalidatePath("/transactions"); | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
{ | ||
"name": "finance-ai", | ||
"name": "jupiter-finance", | ||
"version": "1.1.0", | ||
"private": true, | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Wesley Souza", | ||
"url": "https://dev-wesleysouza.vercel.app/" | ||
}, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "prisma generate && prisma migrate deploy && next build", | ||
|
@@ -113,4 +118,4 @@ | |
"@semantic-release/github" | ||
] | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.