Skip to content

Commit

Permalink
Merge pull request #2 from Firebird1029/brandon
Browse files Browse the repository at this point in the history
Work on MVP
  • Loading branch information
Firebird1029 authored Mar 23, 2024
2 parents 5dda041 + d4603b3 commit fa03387
Show file tree
Hide file tree
Showing 39 changed files with 8,889 additions and 153 deletions.
38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/jsx-curly-brace-presence": "off",
"react/prop-types": "off",
"no-unused-vars": "warn",
"no-console": "warn",
"import/no-extraneous-dependencies": "off",
"no-plusplus": "off",
"import/extensions": "off",
"import/no-unresolved": "off"
},
"overrides": [
{
"files": ["route.js"],
"rules": {
"import/prefer-default-export": "off"
}
}
]
}
12 changes: 8 additions & 4 deletions .github/workflows/lint-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install
- name: Run Lint script
run: npm run lint
- name: Install frontend modules
run: npm ci
- name: Lint frontend
run: npm run lint:prod
- name: Install backend modules
run: cd api && pip install -r requirements.txt && pip install pylint
- name: Lint backend
run: cd api && python -m pylint *.py
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[Github Actions] lint files"
148 changes: 27 additions & 121 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,133 +1,39 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# nyc test coverage
.nyc_output
# testing
/coverage

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# next.js
/.next/
/out/

# Bower dependency directory (https://bower.io/)
bower_components
# production
/build

# node-waf configuration
.lock-wscript
# misc
.DS_Store
*.pem

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Dependency directories
node_modules/
jspm_packages/
# local env files
.env*.local

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# vercel
.vercel

# TypeScript cache
# typescript
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
next-env.d.ts

# Custom
.DS_Store
.eslintcache
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# README

## Installation & Setup

To install the backend Python packages:

```bash
cd api && pip install -r requirements.txt && cd -
```

To install the frontend NPM packages:

```bash
npm install
```

You will need a `.env.local` in the root directory and a `.env` in the `api/` folder with the relevant Supabase environment variables in each file.

## Local Development

To start the frontend and backend locally together, simply run `npm run dev`. Ctrl+C will kill both processes.

### Backend

To run the local backend server individually: `npm run flask-dev`.

To lint the backend code: `python -m pylint *.py`.

To access the local backend server: `http://127.0.0.1:5328/api/ping`.

However, Next.js redirects API calls to the web app to the Python backend server, so the API is also accessible at: `http://localhost:3000/api/ping`. This is configured at `next.config.mjs`.

### Frontend

To run the local frontend application individually: `npm run next-dev`.

To lint the frontend code: `npm run lint`.

To access the local frontend application: `localhost:3000`.

## Misc

To save a Python package to `api/requirements.txt`, use `pigar`: `pip install pigar` then `pigar generate`. Do not use `pip freeze`.

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).

<!--
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `app/page.js`. 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. -->
Loading

0 comments on commit fa03387

Please sign in to comment.