Skip to content

Commit 507aff8

Browse files
authored
Merge pull request #4 from BAMresearch/final_cleanup_add_hashlib
Final cleanup add hashlib
2 parents 6bfb322 + e6b03c8 commit 507aff8

File tree

19 files changed

+1119
-37
lines changed

19 files changed

+1119
-37
lines changed

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Application
2+
PROJECT_NAME=JSONed
3+
API_V1_STR=/api/v1
4+
5+
# MongoDB
6+
MONGO_DATABASE=jsoned_db
7+
MONGO_DATABASE_URI=mongodb://localhost:27017
8+
COLLECTION=schemas
9+
10+
# CORS (comma-separated or JSON list)
11+
BACKEND_CORS_ORIGINS=http://localhost,http://localhost:3000
12+
# or:
13+
# BACKEND_CORS_ORIGINS=["http://localhost","http://localhost:3000"]

.gitignore

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# added
2+
.MyNotes/
3+
.venv_jsoned
4+
5+
16
# Byte-compiled / optimized / DLL files
27
__pycache__/
38
*.py[codz]
@@ -182,9 +187,9 @@ cython_debug/
182187
.abstra/
183188

184189
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
190+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186191
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
192+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188193
# you could uncomment the following to ignore the entire vscode folder
189194
# .vscode/
190195

@@ -205,3 +210,8 @@ cython_debug/
205210
marimo/_static/
206211
marimo/_lsp/
207212
__marimo__/
213+
214+
# ignore dynamic version file
215+
_version.py
216+
# ignore VSCode launch configurations (debugging configurations which are user-specific)
217+
.vscode/launch.json

NOTICE

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
11
# jsoned
2-
A full-stack application to visualize and edit entities and their relations defined in JSON Schema.
2+
3+
A local application to visualize and edit entities and their relations defined in a JSON Schema. The architecture
4+
of `jsoned` is:
5+
6+
- FastAPI (Python): backend
7+
- SvelteKit (JavaScript): frontend
8+
- MongoDB: database
9+
- Tauri (Rust): framework for building binaries for desktop app
10+
11+
12+
## Development
13+
14+
If you want to develop locally this package, clone the project and enter in the workspace folder:
15+
16+
```sh
17+
git clone https://github.com/BAMresearch/jsoned.git
18+
cd jsoned
19+
```
20+
21+
Create a virtual environment (you can use Python>3.10) in your workspace:
22+
23+
```sh
24+
python3 -m venv .venv
25+
source .venv/bin/activate
26+
```
27+
28+
We recommend using [`uv`](https://docs.astral.sh/uv/) for installing the dependencies:
29+
30+
```sh
31+
uv sync
32+
```
33+
34+
### Run the app
35+
36+
In order to run the app, you need to follow the instructions for different services. Using `uvicorn` you can launch the FastAPI app:
37+
38+
```sh
39+
cd jsoned/
40+
uvicorn main:app --reload
41+
```
42+
43+
The SwaggerUI will help you understand the implemented endpoints.
44+
45+
#### MongoDB Compass
46+
47+
Go to [MongoDB](https://www.mongodb.com/) and install [MongoDB Community Edition](https://www.mongodb.com/docs/manual/administration/install-community/?operating-system=linux&linux-distribution=ubuntu&linux-package=default&search-linux=with-search-linux) and [MongoDB Compass](https://www.mongodb.com/try/download/compass).
48+
49+
Once the installation is finished, launch MongoDB Compass and start a connection with URI `mongodb://localhost:27017`. Name it `json_db`. You can also create a new collection and call it `schemas`. The URI and names of the database and collection are defined in `jsoned/settings.py`.
50+
51+
#### NodeJS
52+
53+
We use `npm` to manage the frontend dependencies. Go to [NodeJS](https://nodejs.org/en) and install `npm`.
54+
55+
You can install and run the SvelteKit server:
56+
57+
```sh
58+
cd gui/
59+
npm run dev
60+
```

backend/datamodel.py

Lines changed: 0 additions & 9 deletions
This file was deleted.
File renamed without changes.

jsoned/api/__init__.py

Whitespace-only changes.

jsoned/api/v1/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from fastapi import APIRouter
2+
3+
api_router = APIRouter()

jsoned/api/v1/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from fastapi import APIRouter
2+
3+
from jsoned.api.v1.endpoints import schemas
4+
5+
api_router = APIRouter()
6+
api_router.include_router(schemas.router, prefix="/schemas", tags=["schemas"])
7+
# TODO add login with oauth2
8+
# api_router.include_router(login.router, prefix="/login", tags=["login"])

jsoned/api/v1/endpoints/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)