CodeWithAloha / uipa

Helping submit, track, and share public records requests in Hawaii
http://uipa.org
MIT License
10 stars 6 forks source link

Document Development Pathway #47

Open tyliec opened 7 months ago

tyliec commented 7 months ago

Objective

The primary objective of this task is to outline the development pathway for contributors to UIPA.org. This document will serve as a guide, providing clear steps, best practices, and essential information to facilitate a smooth and efficient development process.

source froide-env/bin/activate # to activate the python virtualenv
python3 manage.py runserver
docker-compose up
vite dev

Tasks

Related Items

Parent Epic: https://github.com/CodeWithAloha/uipa/issues/44

tyliec commented 5 months ago

There are three main things that people have to stand up in order to start developing UIPA. These things are:

  1. The Databases (Elasticsearch & Postgres)
  2. The Backend (Django development server)
  3. The Frontend (vite)

At the end of setting up your development environment, you should have three terminal windows running each of these separately.

The Databases

Prerequisites

Instructions

The databases can be stood up together with one command using the provided docker-compose.yml

After running docker-compose up successfully, the output in your terminal should look something like:

Image

The Backend

Prerequisites

Instructions

To run the Django development server, we need to run the following commands:

# Installing dev-dependencies
pip install -r requirements-test.txt 

# To initialise the database:
python manage.py migrate --skip-checks

# Create a superuser
python manage.py createsuperuser

# Create and populate search index
python manage.py search_index --create
python manage.py search_index --populate

# Run the Django development server
python manage.py runserver

After running these, you should see something like this in your terminal:

Image

The Frontend

Prerequisites

Instructions

# Install the dependencies
yarn install

# Run the front-end server (vite)
yarn dev

After performing these steps, the application should be available at http://127.0.0.1:8000/ and look like:

Image

tyliec commented 5 months ago

Created a PR adding this documentation to the README

tyliec commented 5 months ago

Even though https://github.com/CodeWithAloha/uipa/pull/63 has been merged, gonna work with @avenmia to have a Windows version of the dev instructions since #63 focuses on Mac development.

tyliec commented 5 months ago

@all-contributors please add @avenmia for windows uipa dev instructions!

allcontributors[bot] commented 5 months ago

@tyliec

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

tyliec commented 5 months ago

@all-contributors please add @avenmia for doc

allcontributors[bot] commented 5 months ago

@tyliec

I've put up a pull request to add @avenmia! :tada: