Skip to content

Commit 64bc038

Browse files
committed
Update local development documentation
Signed-off-by: nikhil <nikhilkalra124421@gmail.com>
1 parent 807b070 commit 64bc038

1 file changed

Lines changed: 108 additions & 25 deletions

File tree

docs/installation.rst

Lines changed: 108 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -262,26 +262,109 @@ And visit the web UI at: http://localhost/project/
262262
Local development
263263
-----------------
264264

265+
**ScanCode.io** local development now uses Docker Compose for a simplified, containerized workflow.
266+
This approach eliminates the need to install PostgreSQL, Redis, and other dependencies locally.
267+
268+
Quick Start
269+
^^^^^^^^^^^
270+
271+
**Clone the repository and get started in 3 steps**::
272+
273+
git clone https://github.com/aboutcode-org/scancode.io.git && cd scancode.io
274+
make envfile
275+
make run
276+
277+
The app will be running at http://localhost:8001 with **hot reload on code changes**.
278+
279+
What's Included
280+
^^^^^^^^^^^^^^^
281+
282+
The Docker-based development stack includes:
283+
284+
* **PostgreSQL 17** - Database
285+
* **Redis** - Cache and job queue
286+
* **Django Runserver** - Development web server with auto-reload
287+
* **RQ Worker** - Background job processing
288+
* **Volume mounts** - Live code synchronization (changes detected automatically)
289+
290+
All services run in containers, so no local installation of PostgreSQL, Redis, or system
291+
dependencies is required.
292+
293+
Common Development Tasks
294+
^^^^^^^^^^^^^^^^^^^^^^^^^
295+
296+
**Run the development server** (with hot reload)::
297+
298+
make run
299+
300+
**Open a bash shell in the web container**::
301+
302+
make bash
303+
304+
**Run the test suite**::
305+
306+
make test
307+
308+
**Run tests excluding slow/integration tests**::
309+
310+
make fasttest
311+
312+
**Create new database migrations**::
313+
314+
make migrations
315+
316+
**Apply database migrations**::
317+
318+
make migrate
319+
320+
**Restart the worker service**::
321+
322+
make restart-worker
323+
324+
**Access Django management commands**::
325+
326+
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec web ./manage.py COMMAND
327+
265328
Supported Platforms
266329
^^^^^^^^^^^^^^^^^^^
267330

268-
**ScanCode.io** has been tested and is supported on the following operating systems:
331+
The Docker-based development workflow is supported on:
332+
333+
#. **Linux** - All distributions (Debian, Ubuntu, Fedora, etc.)
334+
#. **macOS** - 10.14 and later (Intel and Apple Silicon)
335+
#. **Windows** - via Docker Desktop or WSL2
336+
337+
.. tip::
338+
On **Windows**, ensure Docker Desktop is running with WSL2 backend enabled.
339+
Docker Compose will handle all dependencies automatically.
269340

270-
#. **Debian-based** Linux distributions
271-
#. **macOS** 10.14 and up
341+
Pre-installation Checklist
342+
^^^^^^^^^^^^^^^^^^^^^^^^^^
343+
344+
For Docker-based development, you only need:
345+
346+
* **Docker**: Download from https://www.docker.com/products/docker-desktop/
347+
* **Docker Compose**: Usually bundled with Docker Desktop (v2.0 or later)
348+
* **Git**: Most recent release from https://git-scm.com/
272349

273350
.. warning::
274-
On **Windows** ScanCode.io can **only** be :ref:`run_with_docker`.
275-
Alternatively, you can run a local checkout with the Docker compose stack using the
276-
dedicated command::
351+
On **Windows**, ensure that git ``autocrlf`` configuration is set to
352+
``false`` before cloning the repository::
353+
354+
git config --global core.autocrlf false
277355

278-
make run-docker-dev
356+
.. note::
357+
You do **NOT** need to install Python, PostgreSQL, Redis, or system dependencies
358+
when using the Docker-based workflow. All services run in containers.
279359

360+
Legacy: Local Development with Virtualenv
361+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
280362

281-
Pre-installation Checklist
282-
^^^^^^^^^^^^^^^^^^^^^^^^^^
363+
.. warning::
364+
The virtualenv-based local development setup is no longer the recommended approach.
365+
Please use the Docker-based workflow above.
283366

284-
Before you install ScanCode.io, make sure you have the following prerequisites:
367+
If you need to set up a local virtualenv-based environment (not recommended), you will need:
285368

286369
* **Python: versions 3.12 to 3.14** found at https://www.python.org/downloads/
287370
* **Git**: most recent release available at https://git-scm.com/
@@ -290,14 +373,14 @@ Before you install ScanCode.io, make sure you have the following prerequisites:
290373

291374
.. _system_dependencies:
292375

293-
System Dependencies
294-
^^^^^^^^^^^^^^^^^^^
376+
System Dependencies (Virtualenv setup only)
377+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
295378

296-
In addition to the above pre-installation checklist, there might be some OS-specific
297-
system packages that need to be installed before installing ScanCode.io.
379+
If you choose to use the legacy virtualenv-based setup, several OS-specific
380+
system packages may be needed before installing ScanCode.io.
298381

299382
On **Linux**, several **system packages are required** by the ScanCode toolkit.
300-
Make sure those are installed before attempting the ScanCode.io installation::
383+
Make sure those are installed before attempting the installation::
301384

302385
sudo apt-get install \
303386
build-essential python3-dev libssl-dev libpq-dev \
@@ -341,8 +424,8 @@ For the Android deploy to develop pipeline, `jadx <https://github.com/skylot/jad
341424

342425
brew install jadx
343426

344-
Clone and Configure
345-
^^^^^^^^^^^^^^^^^^^
427+
Clone and Configure (Virtualenv setup only)
428+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
346429

347430
* Clone the `ScanCode.io GitHub repository <https://github.com/aboutcode-org/scancode.io>`_::
348431

@@ -379,8 +462,8 @@ Clone and Configure
379462
source .venv/bin/activate
380463
pip install android-inspector
381464

382-
Database
383-
^^^^^^^^
465+
Database (Virtualenv setup only)
466+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
384467

385468
**PostgreSQL** is the preferred database backend and should always be used on
386469
production servers.
@@ -416,26 +499,26 @@ production servers.
416499
<https://docs.djangoproject.com/en/dev/ref/databases/#sqlite-notes>`_
417500
for more details.
418501

419-
Tests
420-
^^^^^
502+
Tests (Virtualenv setup only)
503+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
421504

422505
You can validate your ScanCode.io installation by running the tests suite::
423506

424507
make test
425508

426-
Web Application
427-
^^^^^^^^^^^^^^^
509+
Web Application (Virtualenv setup only)
510+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
428511

429512
A web application is available to create and manage your projects from a browser;
430513
you can start the local webserver and access the app with::
431514

432-
make run
515+
make runserver
433516

434517
Then open your web browser and visit: http://localhost:8001/ to access the web
435518
application.
436519

437520
.. warning::
438-
``make run`` is provided as a simplified way to run the application with one
521+
``make runserver`` is provided as a simplified way to run the application with one
439522
**major caveat**: pipeline runs will be **executed synchronously** on HTTP requests
440523
and will leave your browser connection or API calls opened during the pipeline
441524
execution. See also the :ref:`scancodeio_settings_async` setting.

0 commit comments

Comments
 (0)