Skip to content

Commit

Permalink
boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed May 20, 2024
1 parent 90b3cda commit 33f4006
Show file tree
Hide file tree
Showing 30 changed files with 19,169 additions and 103 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/static.yml

This file was deleted.

38 changes: 29 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ concurrency:
cancel-in-progress: true

jobs:
run-base-tests:
run-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
python-version: "3.11"
node-version: "20"

- name: Restore cache
id: restore-cache
Expand All @@ -37,14 +37,34 @@ jobs:
path: |
${{ env.pythonLocation }}
.mypy_cache/
key: python-requirements-${{ env.pythonLocation }}-${{ github.event.pull_request.base.sha || github.sha }}
node_modules/
key: tests-${{ github.event.pull_request.base.sha || github.sha }}
restore-keys: |
python-requirements-${{ env.pythonLocation }}
python-requirements-
tests-
- name: Install Node package
working-directory: frontend
run: |
npm install
- name: Run tests
working-directory: frontend
run: |
npm test -- --watchAll=false
- name: Build frontend
run: |
npm run build
working-directory: frontend

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install package
- name: Install Python package
run: |
pip install --upgrade --upgrade-strategy eager --extra-index-url https://download.pytorch.org/whl/cpu -e '.[dev]'
pip install --upgrade --upgrade-strategy eager -e '.[dev]'
- name: Run static checks
run: |
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# store

This is the code for our online store. This is a simple store for buying and selling humanoid robots.

## Frontend

To develop just the frontend, see the [frontend README](../frontend/README.md).

## Full

To develop the full stack, start FastAPI and React in separate terminals:

### FastAPI

Serve the FastAPI application in development mode:

```bash
fastapi dev 'store/app/main.py'
```

### React

Automatically rebuild the React frontend code when a file is changed:

```bash
cd frontend
npm watch
```
23 changes: 23 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
25 changes: 25 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frontend

This is the frontend of the project, which builds a static website using React.

## Setup

Install requirements:

```bash
cd frontend # This directory
nvm use 20.10.0
npm install
```

Start server:

```bash
npm start
```

Build static files:

```bash
npm run build
```
5 changes: 5 additions & 0 deletions frontend/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["src"],
"ext": "js,jsx,ts,tsx,css,html",
"exec": "npm run build"
}
Loading

0 comments on commit 33f4006

Please sign in to comment.