ctrl k
  • docs/Develop.md
    ■ ■ ■ ■ ■ ■
    1  - 
    2  -# Develop
    3  - 
    4  -For now Docker is a primary way of working on the repo.
    5  - 
    6  -<br>
    7  - 
    8  -## Installation
    9  - 
    10  -<br>
    11  - 
    12  -1. Create a virtual environment.
    13  -
    14  - ```sh
    15  - # Install the package if it's not installed
    16  - pip install virtualenv
    17  -
    18  - # Make it easier to manage python versions
    19  - virtualenv --upgrade-embed-wheels
    20  - virtualenv --python 3.8 venv
    21  - ```
    22  -
    23  - <br>
    24  - 
    25  -2. Activate the virtual environment.
    26  -
    27  - ```sh
    28  - # Windows ➞ venv\Scripts\activate
    29  - source venv/bin/activate
    30  - ```
    31  -
    32  - <br>
    33  - 
    34  -3. Install python packages.
    35  - 
    36  - ```sh
    37  - pip install \
    38  - --requirement requirements.txt
    39  - ```
    40  -
    41  - <br>
    42  - 
    43  -4. Install`pre-commit`hooks.
    44  - 
    45  - ```sh
    46  - pre-commit install --install-hooks
    47  - ````
    48  - 
    49  -<br>
    50  -<br>
    51  - 
    52  -## IDE
    53  - 
    54  -*IDE specific instructions.*
    55  - 
    56  -<br>
    57  - 
    58  -### VSCode
    59  - 
    60  -<br>
    61  - 
    62  -1. Copy`.code-workspace`file.
    63  - 
    64  - ```sh
    65  - cp \
    66  - configs/workspace.code-workspace.example \
    67  - kemono-2.code-workspace
    68  - ```
    69  -
    70  - <br>
    71  -
    72  -2. Install the recommended extensions.
    73  - 
    74  -<br>
    75  -<br>
    76  - 
    77  -## Docker
    78  - 
    79  -<br>
    80  - 
    81  -```sh
    82  -docker-compose --file docker-compose.dev.yml build
    83  -docker-compose --file docker-compose.dev.yml up
    84  -```
    85  - 
    86  -<br>
    87  - 
    88  -In a browser, visit[`http://localhost:5000/`]
    89  - 
    90  -<br>
    91  - 
    92  -### Database
    93  - 
    94  -<br>
    95  - 
    96  -1. Register an account.
    97  - 
    98  -2. Visit[`http://localhost:5000/development`]
    99  - 
    100  -3. Click either seeded or random generation.
    101  -
    102  - *This will start a mock import process,* <br>
    103  - *which will also populate the database.*
    104  - 
    105  -<br>
    106  - 
    107  -### Files
    108  - 
    109  -TBD
    110  - 
    111  -<br>
    112  - 
    113  -### Build
    114  - 
    115  -```sh
    116  -docker-compose build
    117  -docker-compose up --detach
    118  -```
    119  - 
    120  -<br>
    121  - 
    122  -In a browser, visit[`http://localhost:8000/`]
    123  - 
    124  -<br>
    125  -<br>
    126  - 
    127  -## Manual
    128  - 
    129  -> **TODO** : Write installation and setup instructions
    130  - 
    131  -<br>
    132  - 
    133  -This assumes you have`Python 3.8+`&`Node 12+`installed <br>
    134  -as well as a running **PostgreSQL** server with **Pgroonga**.
    135  - 
    136  -<br>
    137  - 
    138  -```sh
    139  -# Make sure your database is initialized
    140  -# cd to kemono directory
    141  - 
    142  -pip install virtualenv
    143  -virtualenv venv
    144  - 
    145  -# Windows ➞ venv\Scripts\activate
    146  -source venv/bin/activate
    147  - 
    148  -pip install \
    149  - --requirement requirements.txt
    150  - 
    151  -cd client \
    152  - && npm install \
    153  - && npm run build \
    154  - && cd ..
    155  - 
    156  -# Open .env + Configure
    157  -cp .env.example .env
    158  - 
    159  -# Open flask.cfg + Configure
    160  -cp flask.cfg.example flask.cfg
    161  - 
    162  -set FLASK_APP=server.py
    163  -set FLASK_ENV=development
    164  - 
    165  -flask run
    166  -```
    167  - 
    168  -<br>
    169  - 
    170  - 
    171  -<!----------------------------------------------------------------------------->
    172  - 
    173  -[`http://localhost:5000/development`]: http://localhost:5000/development
    174  -[`http://localhost:5000/`]: http://localhost:5000/
    175  -[`http://localhost:8000/`]: http://localhost:8000/
  • docs/develop.md
    ■ ■ ■ ■ ■ ■
     1 +# Develop
     2 + 
     3 +For now Docker is a primary way of working on the repo.
     4 + 
     5 +## Installation
     6 + 
     7 +Even if working with docker, you still have to install local dependencies
     8 +for IDE to be of help. Instructions assume Ubuntu 22 environment.
     9 + 
     10 +1. Install dependencies:
     11 + ```sh
     12 + sudo apt update
     13 + sudo apt install python3.9 python3.9-dev python3.9-distutils
     14 + ```
     15 +2. Create a virtual environment (requires `virtualenv` installed):
     16 + 
     17 + ```sh
     18 + pip install virtualenv
     19 + virtualenv --python 3.9 venv
     20 + ```
     21 + 
     22 +3. Activate the virtual environment.
     23 + 
     24 + ```sh
     25 + source venv/bin/activate
     26 + ```
     27 + 
     28 + On Windows the path is `venv\Scripts\activate`.<br>
     29 + You might need to use a different script if you use an exotic shell.
     30 + For example, `fish` would need `source venv/bin/activate.fish`
     31 + 
     32 +4. Install python packages.
     33 + 
     34 + ```sh
     35 + pip install --requirement requirements.txt
     36 + ```
     37 + 
     38 +5. Install`pre-commit`hooks.
     39 + 
     40 + ```sh
     41 + pre-commit install --install-hooks
     42 + ```
     43 + 
     44 +## IDE
     45 + 
     46 +IDE specific instructions.
     47 + 
     48 +### VSCode
     49 + 
     50 +1. Copy`.code-workspace`file.
     51 + 
     52 + ```sh
     53 + cp --interactive configs/workspace.code-workspace.example kemono-2.code-workspace
     54 + ```
     55 + 
     56 +2. Install the recommended extensions.
     57 + 
     58 +## Docker
     59 + 
     60 +```sh
     61 +cd docker
     62 +docker compose build
     63 +docker compose up
     64 +```
     65 + 
     66 +In a browser, visit[`http://localhost:5000/`](http://localhost:5000/)
     67 + 
     68 +### Build
     69 + 
     70 +```sh
     71 +docker-compose build
     72 +docker-compose up --detach
     73 +```
     74 + 
     75 +In a browser, visit[`http://localhost:8000/`](http://localhost:8000/)
     76 + 
     77 +## Manual
     78 + 
     79 +This assumes you have`Python 3.9+`&`Node 18+` installed
     80 +as well as a running **PostgreSQL** server with **Pgroonga**.
     81 + 
     82 +```sh
     83 +cd client \
     84 + && npm install \
     85 + && npm run build \
     86 + && cd ..
     87 +```
     88 + 
Page is in error, reload to recover