Skip to content

Commit

Permalink
Upgraded NPM packages (#212)
Browse files Browse the repository at this point in the history
* Upgraded NPM packages

* Replaced `vue-cli` with `vite`
* Adjusted import statements and Dockerfiles
* Moved index.html
* Declared all build targets in Makefile as phony
  so that `-B` option is not required
* Updated README

* Explicit port
  • Loading branch information
crazyscientist authored Jul 22, 2024
1 parent 70560e8 commit 098a1d1
Show file tree
Hide file tree
Showing 47 changed files with 2,275 additions and 20,105 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.PHONY: all backend frontend

all: backend frontend

backend:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ In a nutshell, these are the steps to set up a development environment:
3. Backend
1. Create a file with environment variable definitions (See [config.py](backend/config.py) for
which variables are available/required).
2. Create a Python virtualenv (Our suggestion: Python 3.9).
2. Create a Python virtualenv (Our suggestion: Python 3.12).
3. Install Python dependencies with `pip`.
4. Run database migrations: `alembic upgrade head`.
4. Frontend
1. Install `npm` (and `nodejs`, our suggestion: v16).
1. Install `npm` (and `nodejs`, our suggestion: v20).
2. Install JS dependencies with `npm install`.

### Updating NPM packages
Expand Down Expand Up @@ -75,14 +75,14 @@ command:

```shell
cd frontend
npm run serve
npm run dev
```

This will run the frontend on `localhost:8080`.

**Note**: The dev server is configured to proxy API requests to `localhost:8000` by default. If your
backend development server is listening somewhere else, make sure to adjust the proxy target in
[vue.config.js](frontend/vue.config.js)!
[vite.config.js](frontend/vite.config.js)!

## Building production images

Expand Down
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package*.json *.config.js ./
COPY package*.json *.config.js index.html ./
RUN npm install
COPY public ./public/
COPY src ./src/
Expand Down
14 changes: 14 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title>AIMAAS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
Loading

0 comments on commit 098a1d1

Please sign in to comment.