Skip to content

Commit 0d4537c

Browse files
Merge pull request #1969 from gustavomm19/refactor-common
Refactor of services, hooks and Checkout
2 parents 5cb9a20 + 1bffecd commit 0d4537c

File tree

127 files changed

+3398
-6487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3398
-6487
lines changed

.cursor/rules/auth.mdc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
The authentication of the user is managed through the [AuthContext.jsx](mdc:src/context/AuthContext.jsx). This context provides the basic functions to login, logout and validate the current session.
7+
8+
9+
To get information regarding the authentication and the user we use the [useAuth.js](mdc:src/hooks/useAuth.js) hook, which consumes from the AuthContext.

.cursor/rules/components.mdc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
##Components
7+
All of our components are in the folder @/src/components. The files and folders names must be created using PascalCase.
8+
9+
###Icons
10+
We have an Icon component inside the components folder. The Icon has a set of icons inside that folder, which are svg components that can be customized with props (width, height, style, color, etc.).
11+
12+
###UI Library
13+
Our UI library is Chakra UI. Whe should always use Chakra to build our pages and our components.
14+
There are some chakra components that are customized with our own styling, so we should use those instead of the ones from chakra:
15+
- src/components/Text
16+
- src/components/Heading
17+
18+
###Styling
19+
We have all of our colors defined on the theme.js file inside the styles folder. We must always use the color variables declared in that file.
20+
21+
We also have the useStyle hook which has color modes declared with our defined colors. The object hexColor can be used with the icons, since the icons dont support the color variables natively through strings.

.cursor/rules/good-practices.mdc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
##Promises
7+
When using promises we wont use the chaining event syntax, we will use async/await and try/catch to avoid the callback hell.
8+
9+
##Linting
10+
11+
We are using ESLint to improve the higene of our code. Make sure to follow its recommendations and fix linting errors if they arise.

.cursor/rules/lib.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
In the lib folder we are storing functions that reuse calls to the API and dont involve hooks.

.cursor/rules/services.mdc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
##Breathecode
7+
The service breathecode is the api from where we will consume most of our data. Every time we want to communicate with breathecode, it must be done using the service declared in the [breathecode.js](mdc:src/services/breathecode.js) file in the services folder. Internally, the breathecode service is separated by modules, which corresponds to the modules of the api.
8+
9+
##Rigobot
10+
Rigobot is another api from where we will consume some data ocasionally. This service is also structured by modules inside the file [rigobot.js](mdc:src/services/rigobot.js).

.cursor/rules/subscriptions.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
The subscriptions of the user are managed through the hook [useSubscriptions.js](mdc:src/hooks/useSubscriptions.js) and they are loaded after the user is authenticated.

.cursor/rules/utils.mdc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
In the utils folder we will only store pure functions that are reused in may sections of the project

.github/workflows/cypress.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

bun.lockb

45.7 KB
Binary file not shown.

cypress.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)