diff --git a/README.md b/README.md index 848faa1..393c0d0 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,53 @@ The most hackable Web Shop! -## Compile for production +## How to use + +### Prepare development environment + +1. Install node.js + +```bash +sudo apt install npm + +# If outdated version: +sudo npm install -g n +sudo n stable +``` + +2. Download + extract the project +3. Open the root folder with VS Code (recommended) +4. Open the bash inside VS Code, navigate to the `software/` folder and install all necessary packages: + +```bash +npm i +``` + +### Test/development + +There are multiple commands to test parts or the whole project: + +- `npm run dev`: Starts the Vue frontend only +- `npm run server`: Starts the ExpressJs backend only +- `npm run serve`: Starts front- and backend + +The frontend runs on `http://localhost:5173/` and the backend on `http://localhost:3000/` + +### Compile for production TODO -## Database +## Structure + +### Database ![database-erm](misc/images//database.png) -## Backend API endpoints +### Backend API endpoints The application host it's data in a SQLite database. The access is managed by an [ExpressJs](https://expressjs.com/) server which offers many REST-API endpoints for the frontend. The REST-API server runs on port 3000. -### `/api` +#### `/api`
Server check @@ -75,10 +109,11 @@ Delete and refill the database with example values
-### `/categories` +#### `/categories`
All categories +

Description

@@ -192,7 +227,7 @@ Delete a category by it's id
-### `/products` +#### `/products`
All products @@ -400,7 +435,7 @@ Delete a product by it's id
-### `/orders` +#### `/orders`
Request orders of user @@ -508,7 +543,7 @@ Place a new order to the database
-### `/accounts` +#### `/accounts`
Login user