-
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.
Merge pull request #27 from Codespice1/develop
Merge changes into staging environment
- Loading branch information
Showing
45 changed files
with
12,985 additions
and
27 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,8 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
docker | ||
.git |
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,12 @@ | ||
# integrations | ||
STRIPE_KEY= | ||
|
||
# auth | ||
NEXTAUTH_URL= | ||
NEXTAUTH_SECRET= | ||
|
||
AUTH_GITHUB_ID= | ||
AUTH_GITHUB_SECRET= | ||
|
||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= |
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,9 @@ | ||
# integrations | ||
STRIPE_KEY= | ||
|
||
# auth | ||
NEXTAUTH_URL= | ||
NEXTAUTH_SECRET= | ||
|
||
GITHUB_ID= | ||
GITHUB_SECRET= |
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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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,44 @@ | ||
name: Main workflow | ||
|
||
on: | ||
[push] | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.14.0' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the Next.js application | ||
env: | ||
STRIPE_KEY: ${{ secrets.STRIPE_KEY }} | ||
NEXTAUTH_URL: ${{secrets.NEXTAUTH_URL}} | ||
NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}} | ||
AUTH_GITHUB_ID: ${{secrets.AUTH_GITHUB_ID}} | ||
AUTH_GITHUB_SECRET: ${{secrets.AUTH_GITHUB_SECRET}} | ||
GOOGLE_CLIENT_ID: ${{secrets.GOOGLE_CLIENT_ID}} | ||
GOOGLE_CLIENT_SECRET: ${{secrets.GOOGLE_CLIENT_SECRET}} | ||
run: npm run build --if-present | ||
|
||
- name: Code linting | ||
run: npm run lint | ||
|
||
- name: Run tests and collect coverage | ||
run: npm run test | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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,41 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
.env.staging | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
.vscode/tasks.json | ||
/certificates/* | ||
cypress.env.json |
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,26 @@ | ||
## Contributing | ||
- Fork the repository. | ||
- Create a new branch (git checkout -b feature-branch). | ||
- Commit your changes (git commit -am 'Add some feature'). | ||
- Push to the branch (git push origin feature-branch). | ||
- Create a new Pull Request. | ||
|
||
## Git Workflow | ||
|
||
1. **Branch Types**: | ||
- **Feature**: For new features (`feature/#id-short-description`). | ||
- **Hotfix**: For bug fixes and performance improvements. | ||
- **Bugfix**: | ||
- **Release**: | ||
|
||
2. **Commit Messages**: | ||
- Include the issue ID and a brief description (`#1: Adds sign-up functionality`). | ||
|
||
3. **Branch Hierarchy**: | ||
- **Main**: Stable code, deployed to users. | ||
- **Staging**: Pre-release testing environment. | ||
- **Develop**: Latest code for development. | ||
|
||
4. **Branch Naming Conventions**: | ||
- Format: `<username>/feature/<#id-task>-<short-descrip | ||
- Example: `D-Antonelli/feature/#1-user-authentication` |
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,39 +1,36 @@ | ||
# Finance Accumulator | ||
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). | ||
|
||
Finance Accumulator is a comprehensive full-stack application designed to help businesses manage and track their income and expenses by integrating with popular financial services such as Stripe, PayPal, and Shopify. | ||
## Getting Started | ||
|
||
## Contributing | ||
- Fork the repository. | ||
- Create a new branch (git checkout -b feature-branch). | ||
- Commit your changes (git commit -am 'Add some feature'). | ||
- Push to the branch (git push origin feature-branch). | ||
- Create a new Pull Request. | ||
First, run the development server: | ||
|
||
## Git Workflow | ||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
1. **Branch Types**: | ||
- **Feature**: For new features (`feature/#id-short-description`). | ||
- **Hotfix**: For bug fixes and performance improvements. | ||
- **Bugfix**: | ||
- **Release**: | ||
|
||
2. **Commit Messages**: | ||
- Include the issue ID and a brief description (`#1: Adds sign-up functionality`). | ||
|
||
3. **Branch Hierarchy**: | ||
- **Main**: Stable code, deployed to users. | ||
- **Staging**: Pre-release testing environment. | ||
- **Develop**: Latest code for development. | ||
|
||
4. **Branch Naming Conventions**: | ||
- Format: `<username>/feature/<#id-task>-<short-descrip | ||
- Example: `D-Antonelli/feature/#1-user-authentication` | ||
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. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
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. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
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,8 @@ | ||
coverage: | ||
status: | ||
project: #add everything under here, more options at https://docs.codecov.com/docs/commit-status | ||
default: | ||
# basic | ||
target: auto #default | ||
threshold: 0% | ||
base: auto |
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,11 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
chromeWebSecurity: false, | ||
|
||
e2e: { | ||
setupNodeEvents(on, config) { | ||
return require('./cypress/plugins/index.ts')(on, config) | ||
}, | ||
}, | ||
}); |
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,48 @@ | ||
// default set-up from next-auth documentation. needs some fixes | ||
|
||
describe("Login page", () => { | ||
before(() => { | ||
cy.log(`Visiting login page`); | ||
cy.visit("http://localhost:3000"); | ||
}); | ||
|
||
it("Login with Google", () => { | ||
const username: string = Cypress.env("GOOGLE_USER"); | ||
const password: string = Cypress.env("GOOGLE_PW"); | ||
const loginUrl: string = Cypress.env("SITE_NAME"); | ||
const cookieName: string = Cypress.env("COOKIE_NAME"); | ||
|
||
const socialLoginOptions = { | ||
username, | ||
password, | ||
loginUrl, | ||
headless: true, | ||
logs: true, | ||
isPopup: true, | ||
loginSelector: `a[href="${Cypress.env("SITE_NAME")}/api/auth/signin/google"]`, | ||
postLoginSelector: ".test-stripe", | ||
}; | ||
|
||
return cy.task("GoogleSocialLogin", socialLoginOptions).then((result: any) => { | ||
const {cookies} = result; | ||
|
||
cy.clearCookies(); | ||
|
||
const cookie = cookies.filter((cookie: any) => cookie.name === cookieName).pop(); | ||
if (cookie) { | ||
cy.setCookie(cookie.name, cookie.value, { | ||
domain: cookie.domain, | ||
expiry: cookie.expires, | ||
httpOnly: cookie.httpOnly, | ||
path: cookie.path, | ||
secure: cookie.secure, | ||
}); | ||
|
||
// remove the two lines below if you need to stay logged in | ||
// for your remaining tests | ||
cy.visit("/api/auth/signout"); | ||
cy.get("form").submit(); | ||
} | ||
}); | ||
}); | ||
}); |
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,5 @@ | ||
describe('template spec', () => { | ||
it('passes', () => { | ||
cy.visit('https://example.cypress.io') | ||
}) | ||
}) |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,7 @@ | ||
const { GoogleSocialLogin } = require("cypress-social-logins").plugins | ||
|
||
module.exports = (on: any, config: any) => { | ||
on("task", { | ||
GoogleSocialLogin: GoogleSocialLogin, | ||
}) | ||
} |
Binary file added
BIN
+131 KB
...ess/screenshots/google-login.cy.ts/Login page -- Login with Google (failed).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************** | ||
// This example commands.ts shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
// | ||
// declare global { | ||
// namespace Cypress { | ||
// interface Chainable { | ||
// login(email: string, password: string): Chainable<void> | ||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
// } | ||
// } | ||
// } |
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,20 @@ | ||
// *********************************************************** | ||
// This example support/e2e.ts is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
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,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": ["cypress", "node"] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
Oops, something went wrong.