Skip to content

Commit b67eb6f

Browse files
committed
add local development docs page
1 parent a158d5b commit b67eb6f

3 files changed

Lines changed: 95 additions & 45 deletions

File tree

docs/local-development.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Local Development
2+
3+
This page covers working on Yamtrack from source.
4+
5+
## Prerequisites
6+
7+
- Python 3.12
8+
- Docker
9+
- Redis
10+
11+
## 1. Clone the repository
12+
13+
```bash
14+
git clone https://github.com/FuzzyGrim/Yamtrack.git
15+
cd Yamtrack
16+
```
17+
18+
## 2. Start Redis
19+
20+
If you do not already have Redis running locally, start it with Docker:
21+
22+
```bash
23+
docker run -d --name redis -p 6379:6379 --restart unless-stopped redis:8-alpine
24+
```
25+
26+
## 3. Create a virtual environment
27+
28+
```bash
29+
python -m venv venv
30+
venv/bin/python -m pip install -U -r requirements-dev.txt
31+
venv/bin/pre-commit install
32+
```
33+
34+
## 4. Configure environment values
35+
36+
Create a `.env` file in the repository root:
37+
38+
```bash
39+
TMDB_API=API_KEY
40+
MAL_API=API_KEY
41+
IGDB_ID=IGDB_ID
42+
IGDB_SECRET=IGDB_SECRET
43+
STEAM_API_KEY=STEAM_API_SECRET
44+
BGG_API_TOKEN=BGG_API_TOKEN
45+
SECRET=SECRET
46+
DEBUG=True
47+
```
48+
49+
See [Environment Variables](env-variables.md) for the full list of supported settings.
50+
51+
## 5. Prepare the database
52+
53+
```bash
54+
cd src
55+
../venv/bin/python manage.py migrate
56+
```
57+
58+
## 6. Run the app
59+
60+
Run the Django development server:
61+
62+
```bash
63+
cd src
64+
../venv/bin/python manage.py runserver
65+
```
66+
67+
Run the Celery worker with the scheduler in another terminal:
68+
69+
```bash
70+
cd src
71+
../venv/bin/celery -A config worker --beat --scheduler django --loglevel DEBUG
72+
```
73+
74+
Run Tailwind in another terminal:
75+
76+
```bash
77+
cd src
78+
../venv/bin/tailwindcss -i ./static/css/input.css -o ./static/css/tailwind.css --watch
79+
```
80+
81+
Open the development server at:
82+
83+
```text
84+
http://localhost:8000
85+
```
86+
87+
## Documentation
88+
89+
Install the docs dependencies with the development requirements, then serve the current checkout:
90+
91+
```bash
92+
venv/bin/mkdocs serve --livereload
93+
```

docs/setup.md

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Setup
22

3-
This page covers running Yamtrack with Docker and setting up a local development environment.
3+
This page covers running Yamtrack with Docker.
44

55
## Docker
66

@@ -85,50 +85,6 @@ services:
8585
8686
If you see `403 Forbidden` behind a proxy, check that `URLS` exactly matches the public URL you use in the browser.
8787

88-
## Local Development
89-
90-
For development, clone the repository and change directory to it:
91-
92-
```bash
93-
git clone https://github.com/FuzzyGrim/Yamtrack.git
94-
cd Yamtrack
95-
```
96-
97-
Install Redis or start a Redis container:
98-
99-
```bash
100-
docker run -d --name redis -p 6379:6379 --restart unless-stopped redis:8-alpine
101-
```
102-
103-
Create a `.env` file in the repository root:
104-
105-
```bash
106-
TMDB_API=API_KEY
107-
MAL_API=API_KEY
108-
IGDB_ID=IGDB_ID
109-
IGDB_SECRET=IGDB_SECRET
110-
STEAM_API_KEY=STEAM_API_SECRET
111-
BGG_API_TOKEN=BGG_API_TOKEN
112-
SECRET=SECRET
113-
DEBUG=True
114-
```
115-
116-
Then install dependencies and run the app:
117-
118-
```bash
119-
python -m pip install -U -r requirements-dev.txt
120-
pre-commit install
121-
cd src
122-
python manage.py migrate
123-
python manage.py runserver & celery -A config worker --beat --scheduler django --loglevel DEBUG & tailwindcss -i ./static/css/input.css -o ./static/css/tailwind.css --watch
124-
```
125-
126-
Open the development server at:
127-
128-
```text
129-
http://localhost:8000
130-
```
131-
13288
## Troubleshooting
13389

13490
Check the Yamtrack container logs:

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ edit_uri: edit/dev/docs/
1111
nav:
1212
- Home: index.md
1313
- Setup: setup.md
14+
- Local Development: local-development.md
1415
- Environment Variables: env-variables.md
1516
- Media Imports: media-imports.md
1617
- Social Auth: social-auth.md

0 commit comments

Comments
 (0)