Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooling: introduce uv #14

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# sticker-map

Plak je kwak, en upload er een foto van.<br>
This webapp lets your members add all the locations they sticked a sticker of your association.

## Installation

Clone this repo. Then, copy `sample.env` to `.env`:
Clone this repo. Then, copy `sample.env` to `.env` and you just need to fill in any empty credentials. These can be found in our
Bitwarden. Then install the correct python version and the dependencies using [uv](https://docs.astral.sh/uv/getting-started/installation/).

```bash
cd sticker-map/
cp sample.env .env
uv sync
```

Now you just need to fill in any empty credentials. These can be found in our
Bitwarden.

The program uses a Postgres database. For this database to work you need to install Postgres locally on your machine.
Additionally, you need to install the PostGIS extension for Postgres locally. This can be done by opening the 'PgAdmin4' program and navigating to your database and then to the 'stickers' table.
Using the query tool on your 'stickers' table, execute the following query: 'CREATE EXTENSION postgis;'. This will install PostGIS locally.
Expand All @@ -22,5 +22,14 @@ Using the query tool on your 'stickers' table, execute the following query: 'CRE

Running this program works by running the flask app.
This can be done in two ways. Execute one of the following commands in your terminal:
1. 'flask --app server.py --debug run' or 'flask --app server.py run' - Find the url in the terminal output and open that in your browser. Instead of the IP address as a url you can also go to 'http://localhost:' and then the port number provided in the terminal output.
2. 'python server.py' - The url you can use to access the web app is 'http://localhost:' and then the 'port number' in the 'serve' function in the 'server.py' file.

```bash
uv run server.py

# Or

uv venv
flask --app server.py --debug run
# or
flask --app server.py run
```
2 changes: 0 additions & 2 deletions dependencies.md

This file was deleted.

13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "plakplaats"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = "==3.12.3"
dependencies = [
"flask>=3.1.0",
"psycopg2-binary>=2.9.10",
"python-dotenv>=1.0.1",
"requests>=2.32.3",
"waitress>=3.0.2",
]
Loading
Loading