feat: init hacking instructions
ci/woodpecker/push/woodpecker Pipeline was successful Details

wip-payments
Aravinth Manivannan 2022-06-06 04:37:15 +05:30
parent 761e3beed9
commit 43d60e0765
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
2 changed files with 88 additions and 0 deletions

View File

@ -9,3 +9,7 @@
Customer workflow, Hostea admin interface and OIDC provider for Hostea
</div>
## Hacking
See [HACKING](./docs/HACKING.md)

84
docs/HACKING.md Normal file
View File

@ -0,0 +1,84 @@
# Development Setup
## Development Dependencies
1. Python `3.10.4`
2. Pip
3. Virtualenv
4. GNU make
5. PostgreSQL
6. (Optionally) Docker: used to spin up PostgreSQL instance
## Setup
1. Clone the project
```bash
git clone https://gitea.hostea.org/Hostea/dashboard.git && cd dashboard
```
2. Create `virtualenv` and activate environment
```bash
virtualenv venv && source venv/bin/activate
```
4. Setup local configuration:
i) Initialize configuration file by copying `.env-sample`
```bash
cp .env-sample .env
```
ii) Modify the contents of `.env`:
```bash
export DATABSE_URL=postgres://postgres:password@localhost:5432/postgres
export db=hostea-dashboard
```
iii) Load environment
```bash
source .env
```
3. Setup PostgreSQL
_We are using Docker but you are welcome to bring your own PostgreSQL
instance_
```bash
docker create --name $db \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 \
postgres && \
docker start $db
```
4. Install Dependencies
```bash
make env
```
5. Apply database migrations
```bash
make migrate
```
6. Create superuesr
```bash
python manage.py createsuperuser
```
And provide information requested
7. Launch development server
```bash
make
```