79 lines
2.6 KiB
Markdown
79 lines
2.6 KiB
Markdown
---
|
|
sidebar_position: 2
|
|
---
|
|
|
|
# Getting Started
|
|
|
|
## Requirements
|
|
|
|
To use MycroForge, ensure you have the following dependencies installed:
|
|
|
|
- [**bash**](https://www.gnu.org/software/bash/)
|
|
- [**git**](https://git-scm.com/)
|
|
- [**Python 3.10**](https://www.python.org/downloads/release/python-3100/)
|
|
- [**Docker**](https://www.docker.com/)
|
|
- [**.NET 8**](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
|
|
- [**XCode Command Line Tools (MacOS only)**](https://mac.install.guide/commandlinetools/)
|
|
|
|
## Prior knowledge
|
|
|
|
Since this tool is meant to generate FastAPI & SQLAlchemy code, you should have decent knowledge of both frameworks. If not, then please follow the links below to learn more about them.
|
|
- [FastAPI](https://fastapi.tiangolo.com/)
|
|
- [SQLAlchemy](https://www.sqlalchemy.org/)
|
|
|
|
### Adding the Package Registry
|
|
|
|
Before installing MycroForge, add the package registry by running the following command:
|
|
|
|
```
|
|
dotnet nuget add source --name devdisciples https://git.devdisciples.com/api/packages/devdisciples/nuget/index.json
|
|
```
|
|
|
|
### Install
|
|
|
|
```
|
|
dotnet tool install -g MycroForge.CLI
|
|
```
|
|
|
|
### Uninstall
|
|
|
|
```
|
|
dotnet tool install -g MycroForge.CLI
|
|
```
|
|
|
|
### Windows
|
|
|
|
MycroForge is designed to run in a POSIX compliant environment. It has been tested on Windows using WSL2 with Ubuntu 22.04.03. So it is recommended to run MycroForge within the same or a similar WSL2 distribution for optimal performance.
|
|
|
|
### MacOS
|
|
|
|
#### Post install steps
|
|
After installing MycroForge, the dotnet CLI will show a message with some instructions to make the `m4g` command available in `zsh`.
|
|
It should look similar to the example below.
|
|
|
|
```sh
|
|
Tools directory '/Users/username/.dotnet/tools' is not currently on the PATH environment variable.
|
|
If you are using zsh, you can add it to your profile by running the following command:
|
|
|
|
cat << \EOF >> ~/.zprofile
|
|
# Add .NET Core SDK tools
|
|
export PATH="$PATH:/Users/username/.dotnet/tools"
|
|
EOF
|
|
|
|
And run zsh -l to make it available for current session.
|
|
|
|
You can only add it to the current session by running the following command:
|
|
|
|
export PATH="$PATH:/Users/username/.dotnet/tools"
|
|
```
|
|
|
|
### Known issues
|
|
|
|
#### FastAPI swagger blank screen (MacOS only)
|
|
|
|
If you see a blank screen when opening the FastAPI Swagger documentation, then make sure you've activated the Safari developer tools.
|
|
|
|
#### Database container doesn't start after running `m4g db run`
|
|
|
|
If the database, i.e. the mariadb container, doesn't successfully start after running `m4g db run` the first time, then try running it again. This often works, but yeah...it's hacky. However, at the time of writing it's unknown what causes this.
|