Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
nb-programmer committed Nov 2, 2024
1 parent 87baf41 commit 274aa08
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Note that this is a template project. You will need to make changes to this appl

## Development setup

### Prerequisites

1. (Optional) Install Pyenv ([Linux](https://github.com/pyenv/pyenv), [Windows](https://github.com/pyenv-win/pyenv-win)) and the [Python installation](.python-version) needed for this project:
```shell
pyenv install
Expand All @@ -18,38 +20,47 @@ pyenv install
> [!IMPORTANT]
> You should **NOT** install poetry into your virtual environment as stated in their docs, as this may mess with your dependencies.
3. Create a virtual environment:
### Setup

1. Create a virtual environment:
```shell
# Note: For POSIX, pyenv can create a named virtual environment which you can use instead.
# For Windows, pyenv-win exists, but doesn't have this feature afaik.

# Create a local virtual environment (inside .venv/)
python3 -m venv .venv

# Activate it:

# Windows
./.venv/Scripts/activate

# POSIX
source ./.venv/bin/activate
```

4. [Windows] Run the `scripts/dev-setup.bat` script:
2. Create development environment and install dependencies (pre-made script does it):

```shell
# [Windows] Run the `scripts/dev-setup.bat` script:
./scripts/dev-setup.bat
```

4. [POSIX] Run the `scripts/dev-setup.sh` shell script using any bash-compatible shell:
```shell
# [POSIX] Run the `scripts/dev-setup.sh` shell script using any bash-compatible shell:
bash ./scripts/dev-setup.sh
```

5. Create a `.env` file from the given example and edit it:
> [!NOTE]
> This scripts does the following:
> Creates a `dev/` folder needed to save log files and other persistent files used by the app, installs the requirements of the app using poetry, installs `pre-commit` hooks to this repository and also runs the pre-commit hooks.
3. Create a `.env` file from the given example and edit it:
```shell
cp .env.example .env

# Open the new .env file in your favourite editor and make the required changes
```

6. Run the dev server using `F5` key in VSCode. You can also use the `dev-launch` shell script:
4. Run the dev server using `F5` key in VSCode. You can also use the `dev-launch` shell script:
```shell
# Windows
./scripts/dev-launch.bat
Expand All @@ -58,7 +69,7 @@ cp .env.example .env
bash ./scripts/dev-launch.sh
```

7. You can also run the cli script:
5. You can also run the cli script:
```shell
sample-fastapi --help
```

0 comments on commit 274aa08

Please sign in to comment.