Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastapi react #2

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1
update_configs:
# Keep package.json (& lockfiles) up to date as soon as
# new versions are published to the npm registry
- package_manager: 'javascript'
directory: '{{cookiecutter.project_slug}}/frontend'
update_schedule: 'monthly'
# Keep Dockerfile up to date, batching pull requests weekly
- package_manager: 'python'
directory: '{{cookiecutter.project_slug}}/backend'
update_schedule: 'monthly'
33 changes: 33 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo python -m pip install --upgrade pip
sudo pip install cookiecutter
- name: Prettify code
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{ts,tsx,md}
- name: Black Code Formatter
uses: lgeiger/black-action@master
with:
args: '{{cookiecutter.project_slug}}/backend --check --line-length 79'
- name: Run tests
run: |
sudo ./scripts/test.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fastapi-react
node_modules/
package-lock.json
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

## Development

### Helper Scripts

You can use the helper script `scripts/dev-project.sh` to create a cookiecutter
project to test locally. Do this from outside of the root directory to avoid
accidentally commiting test builds. For example:

```bash
./fastapi-react/scripts/dev-project.sh
```

This will then create a `dev-fastapi-react` directory.

```bash
cd dev-fastapi-react
docker-compose up -d
```

When developing locally, there is also a helper script that will create a cookiecutter directory, build containers, and run tests all from within the root project directory. This can be kind of a tedious process with cookiecutter so this makes it somewhat less painful. From the root `fastapi-react` directory, simply run:

```bash
./scripts/test_local.sh
```

## Pull Requests

Use the general [feature branch
workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow)
for development. After a feature is complete, make a pull request and wait for 1
approval before merging.

Try to keep PRs as small and focused as possible. If you are making a big
breaking change in production and don't want to expose half finished
functionality to users, you can use [feature
flags](https://www.martinfowler.com/articles/feature-toggles.html) to work on
this incrementally. A big PR is much less likely to be approved

## Linting

Please run Black code formatter on the backend code and Prettier on the frontend
code. Take a look at [the Github action](.github/workflows/config.yml) for an example of this.

## Where to Start

Start by browsing through the [list of issues](https://github.com/Buuntu/fastapi-react/issues), particularly those flagged as [help wanted](https://github.com/Buuntu/fastapi-react/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Gabriel Abud

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