Skip to content

Commit

Permalink
refactor(nextjs): replace mono-repo with nextjs approach
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmaynes committed Nov 25, 2023
1 parent c119662 commit 551974d
Show file tree
Hide file tree
Showing 99 changed files with 13,592 additions and 7,937 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": [
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": "error"
}
}
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ on:
- main

jobs:
deploy:
ship_it:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Setup Node
uses: actions/setup-node@v3
fetch-depth: '0'
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"
- name: 🚀 Deploy 🚀
run: make deploy
env:
API_HOST: ${{ secrets.API_HOST }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
46 changes: 39 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
# Macos
# 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

# Editors
.vscode/
.idea/
.fleet/
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Node
node_modules/
# local env files
.env*.local

# vercel
.vercel

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

# Generated
public/career
.lighthouseci

# Editors
.idea/
2 changes: 1 addition & 1 deletion api/.prettierrc.json → .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"singleQuote": true,
"trailingComma": "es5",
"semi": false
}
}
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}
40 changes: 20 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
install:
yarn install
cd e2e && make install
npm install

dev_api:
cd api && make dev
dev:
npm run dev

dev_web:
cd web && make dev
.PHONY: build
build:
npm run build

start_api:
cd api && make start
start: build
npm run start

start_web:
cd web && make start
lint:
npm run lint

start:
yarn $@
lint_fix:
npm run lint:fix

dev:
yarn $@
performance:
chmod +x ./script/$@.sh
./script/$@.sh "3000"

test: lint build

.PHONY: e2e
e2e:
cd e2e && make test
deploy: install test

deploy: install e2e
cd api && make $@
cd web && make $@
clean:
rm -rf node_modules/ .next/
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# Image Analyzer App

> a monorepo for a web app that analyzes images using MobileNet (in-browser) and ChatGPT (Cloudflare Workers)
# Web Playground
> a NextJS playground for my small web apps
## Requirements

- [GNU Make](https://www.gnu.org/software/make)
- [Nodejs](https://nodejs.org/en/)
- [Yarn](https://yarnpkg.com/)

## Usage

To install project dependencies, run the following command:
```bash
make install
```
```

To start the application, run the following command:
```bash
make start
```

To run `e2e` tests, run the following command:
To run all tests, run the following command:
```bash
make e2e
make test
```

To deploy the application, run the following command:
```bash
make deploy
```

## TODOS

- [ ] Migrate [stockjs](https://github.com/tjmaynes/gists/tree/main/javascript/stockjs) app to web-playground
- [ ] Migrate [tic-tac-toe](https://github.com/tjmaynes/gists/tree/main/javascript/tic-tac-toe) app to web-playground
1 change: 0 additions & 1 deletion api/.eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions api/.eslintrc.json

This file was deleted.

29 changes: 0 additions & 29 deletions api/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion api/.node-version

This file was deleted.

2 changes: 0 additions & 2 deletions api/.tool-versions

This file was deleted.

23 changes: 0 additions & 23 deletions api/Makefile

This file was deleted.

52 changes: 0 additions & 52 deletions api/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions api/jest.config.json

This file was deleted.

Loading

0 comments on commit 551974d

Please sign in to comment.