Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/infrastructure/babel…
Browse files Browse the repository at this point in the history
…/traverse-7.23.2
  • Loading branch information
eric-bach authored May 22, 2024
2 parents 0d0b518 + 97d3e8f commit 7db6167
Show file tree
Hide file tree
Showing 149 changed files with 12,929 additions and 59,688 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:

steps:
- name: ⬇️ Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚒️ Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20

- name: 👀 Env
run: |
Expand All @@ -44,6 +44,7 @@ jobs:
deploy-dev:
name: Deploy Dev
runs-on: ubuntu-latest
environment: dev
needs: [unit-tests]
permissions:
actions: write
Expand All @@ -58,12 +59,12 @@ jobs:
uses: actions/checkout@v3

- name: ⚒️ Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20

- name: 🔑 Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_SERVICE_ROLE_DEV }}
aws-region: us-east-1
Expand All @@ -83,16 +84,13 @@ jobs:
- name: 📥 Install Frontend
uses: ./.github/actions/frontend

- name: 🗒️ Create aws-exports.js
run: |
touch aws-exports.js
echo const awsmobile = { aws_project_region: \'${{ secrets.CDK_DEFAULT_REGION }}\', aws_cognito_region: \'${{ secrets.CDK_DEFAULT_REGION }}\', aws_user_pools_id: \'${{secrets.COGNITO_USERPOOL_ID_DEV}}\', aws_user_pools_web_client_id: \'${{ secrets.COGNITO_WEB_CLIENT_ID_DEV }}\', mandatorySignIn: true, aws_appsync_graphqlEndpoint: \'${{ secrets.APPSYNC_ENDPOINT_DEV }}\', aws_appsync_region: \'${{ secrets.CDK_DEFAULT_REGION }}\', aws_appsync_authenticationType: \'AMAZON_COGNITO_USER_POOLS\' } >> aws-exports.js
echo export default awsmobile >> aws-exports.js
working-directory: frontend/app

- name: 🗒️ Create constants.ts
- name: 🗒️ Create .env
run: |
touch constants.ts
touch .env
echo NEXT_PUBLIC_USER_POOL_ID=${{ secrets.USER_POOL_ID }} >> .env
echo NEXT_PUBLIC_USER_POOL_CLIENT_ID=${{ secrets.USER_POOL_CLIENT_ID }} >> .env
echo NEXT_PUBLIC_APPSYNC_API_ENDPOINT=${{ secrets.APPSYNC_API_ENDPOINT }} >> .env
echo NEXT_PUBLIC_APPSYNC_REGION=${{ secrets.REGION }} >> .env
working-directory: frontend

- name: 🏗 Build Frontend
Expand All @@ -109,9 +107,9 @@ jobs:
run: npm run deploy dev
working-directory: infrastructure

- name: 🚀 Deploy Frontend
run: npx sst deploy --stage dev
working-directory: frontend
# - name: 🚀 Deploy Frontend
# run: npx sst deploy --stage dev
# working-directory: frontend

integration-tests:
name: Integration Tests
Expand All @@ -120,12 +118,12 @@ jobs:

steps:
- name: ⬇️ Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: ⚒️ Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20

- name: 👀 Env
run: |
Expand Down
61 changes: 41 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,46 @@ cdk.out
.env*
aws-exports.js

# Remix
!remix.config.js
!remix.env.d.ts
!plugin-remix.js
**/.cache
**/public/build
**/frontend*/server

# SST
/frontend/.cache
/frontend/.sst
/frontend/build
/frontend/prod.config
!frontend/sst-env.d.ts

!.eslintrc.js
!webpack.*.js
!jest.config.js
!.env.example

cypress.*.json
**/cypress/videos/
**/coverage/

# dependencies
/.pnp
.pnp.js

# 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
.env*.local
!.env.example

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Tailwind
!tailwind.config.js
!next.config.js
!postcss.config.js
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,12 @@ The Pecuniary application consists of the CDK backend and React frontend, each o
aws sso login --profile PROFILE_NAME
```

3. Deploy the backend
3. Deploy the backend and frontend

```
$ npm run deploy dev PROFILE_NAME
```

4. Deploy the frontend (using SST)

```
$ npx sst dev
```

## Deployment via GitHub Actions

1. Create an AWS role that can be assumed by GitHub Actions
Expand Down
27 changes: 27 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
X Add authentication middleware - https://www.youtube.com/watch?v=Y3o4or23V-0
X Style Auth pages
X Style verify email
X nextjs_template branch - https://github.com/Siumauricio/nextui-dashboard-template?tab=readme-ov-file
X Add unprotected landing page without navbar/sidebar
X Build out landing page
X Clean out route names (make components/home components/dashboard so app/home can be there)
X Add update password
X Add reset password - https://github.com/alexrusin/nextjs-cognito-auth/tree/5-reset-password-end
X Add resend verification email
X Clean up dashboard template
X Call AppSync APIs

- Fix github actions
- Deploy to AWS
- AWS Amplify Console - ttps://medium.com/@stk.devtest/a-beginners-guide-to-hosting-next-js-14-on-aws-amplify-db455631d56b
- SST v2 CDK - https://docs.sst.dev/start/nextjs
- SST v3 ION
- (optional) Switch to using Amplify UI Authenticator component - https://github.com/focusOtter/fullstack-nextjs-cdk-starter/tree/main

##### References

- Auth
- https://github.com/focusOtter/fullstack-nextjs-cdk-starter/tree/main
- https://github.com/alexrusin/nextjs-cognito-auth/tree/5-reset-password-end
- Dashboard Template
- https://github.com/Siumauricio/nextui-dashboard-template?tab=readme-ov-file
2 changes: 2 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_USER_POOL_ID=
NEXT_PUBLIC_USER_POOL_CLIENT_ID=
4 changes: 0 additions & 4 deletions frontend/.eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
39 changes: 39 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/



# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
/.github/
21 changes: 21 additions & 0 deletions frontend/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Mauricio Siu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
89 changes: 51 additions & 38 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,71 @@
# Welcome to Remix!
# NextJS and NextUI Dashboard Template Starter

- [Remix Docs](https://remix.run/docs)
You can deploy here directly to vercel [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/Siumauricio/nextui-dashboard-template)

## Development

From your terminal:
V1 Version Stitches https://v1-nextui-dashboard-template.vercel.app/
V1 Code: https://github.com/Siumauricio/nextui-dashboard-template/tree/v1

```sh
npm run dev
```
This is a template for NextJS and NextUI.

This starts your app in development mode, rebuilding assets on file changes.
[NextJS](https://nextjs.org/)
[NextUI](https://nextui.org/)

## Deployment
You can see the demo here: https://nextui-dashboard-template.vercel.app/
For improve this template, you can create a pull request or open an issue here [Issues](https://github.com/Siumauricio/nextui-dashboard-template/issues) or [Pull Request](
https://github.com/Siumauricio/nextui-dashboard-template/pulls)

First, build your app for production:
### Dark Mode
![Dashboard Dark Mode](./public/dark.png)

```sh
npm run build
```
### Light Mode
![Dashboard Light Mode](./public/light.png)

Then run the app in production mode:

```sh
npm start
```

Now you'll need to pick a host to deploy it to.
- Dark Mode Support
- Full Responsive
- Home Page with Charts
- Accounts Page
- More pages coming soon...

### DIY
```
├── components
│ ├── accounts # Accounts components
│ ├── charts # Charts components
│ ├── breadcrumb # component
| ├── home # Home components
| ├── layout # Layout components
| ├── navbar # Navbar components
| ├── sidebar # Sidebar components
| ├── table # Table components
| ├── styles # Some reusable components
| ├── icons # Icons
| ├── hooks # Hooks
├── app # Documentation files
│ ├── accounts # Accounts route
| ├── page.tsx # Accounts page
│ ├── page.tsx # Entry point for the app
│ ├── layout.tsx # Layout applied to all application pages
│ ├── providers.tsx # Theme provider
│ ├── more... # Soon
└──
```

If you're familiar with deploying node applications, the built-in Remix app server is production-ready.
## For Run

Make sure to deploy the output of `remix build`
Install dependencies

- `build/`
- `public/build/`

### Using a Template
```bash
npm install
```

When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over relevant code/assets from your current app to the new project that's pre-configured for your target server.
Start the server

Most importantly, this means everything in the `app/` directory, but if you've further customized your current application outside of there it may also include:

- Any assets you've added/updated in `public/`
- Any updated versions of root files such as `.eslintrc.js`, etc.

```sh
cd ..
# create a new project, and pick a pre-configured host
npx create-remix@latest
cd my-new-remix-app
# remove the new project's app (not the old one!)
rm -rf app
# copy your app over
cp -R ../my-old-remix-app/app app
```bash
npm run dev
```

Now you can visit https://localhost:3000 in your browser.
Loading

0 comments on commit 7db6167

Please sign in to comment.