ChrisWSchultz / points-list

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

points-list

API

The API was built using the Django Rest Framework. https://www.django-rest-framework.org/

Poetry was used to create a virtual environment for the python side: https://python-poetry.org/

Start a shell & install the dependencies:

> cd points-list/api
> poetry shell
> poetry install

If needed, run migrations:

> python manage.py migrate

Create an .env file from .env.example:

> cd points-list/api/app
> cp .env.example .env

Fill in the database connection data, secret key, debug variables.

To generate a token for the .env SECRET_KEY:

> python -c "import secrets; print(secrets.token_urlsafe(128))"

Start the dev server:

> python manage.py runserver

WWW

Create a .env from the .env.example:

> cd points-list/www
> cp .env.example .env

Update the base URL as needed.

Install node_modules:

> cd points-list/www
> yarn install

Run dev server:

> yarn run dev

DB

Django requires psycopg2 the poetry dependencies include the binary build, but this is not recommended for production.

Assume a PostgresQL DB with the following table:

CREATE TABLE point (
id SERIAL PRIMARY KEY,
name text NOT NULL,
x integer NOT NULL,
y integer NOT NULL
);

About

License:MIT License


Languages

Language:Vue 40.4%Language:Python 34.2%Language:JavaScript 22.5%Language:HTML 1.3%Language:Shell 1.3%Language:CSS 0.2%