Skip to content

Commit

Permalink
Emoral435/svelte/start frontend (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
emoral435 authored May 11, 2024
2 parents 5480dd1 + da90db7 commit 24597fd
Show file tree
Hide file tree
Showing 19 changed files with 758 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ B | A
Checklist

- [ ] Lint ran?

- [ ] Sign-off message is added to all commits?

- [ ] Tests (unit, integration, api and/or acceptance) are included?

- [ ] Screenshots before/after for front-end changes?

- [ ] Documentation (manuals or wiki) has been updated or is not required?
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@
* During my time at University learning relational databases, I realized that the underlying technology to store and track progression within the gym was something that I would love to challenge myself with!
* An open-source solution to save money and customize to a communities liking 🤩💫

## Screenshots of the application! 😲🚀

## How do I run this locally? 💚🙂
> [!NOTE]\
> This program is fully hosted right now via localhost and package by a Docker container. I would love to host this on AWS, but I do not have the funds to manage their RDS instance :()
>
> Click -> [here](https://docs.docker.com/desktop/install/windows-install/) to go to the installation page.
With Docker Desktop installed and opened, you can run these commands at the root directory of this GitHub repo...
```shell
# if you are running this for the first time, or have made changes and want to see it take affect on its deployment, use this
docker compose up -d --build
# starts the application in its detached state
docker compose up -d
# turns off the application
docker compose down
# wipes the container clean, effectively deleting the volumes for the database
docker compose down -v
```
And then open up [localhost:4173](localhost:4173) 💚

## The Wiki 📕
Visit the [wiki](https://github.com/emoral435/swole-goal/wiki) in order to see more documentation about...
* How to use the software
Expand Down
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ services:
depends_on:
- postgres
entrypoint: [ "/app/wait-for.sh", "postgres:5432", "--", "/app/start.sh" ]
command: [ "/app/main" ]
command: [ "/app/main" ]

svelte:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "4173:4173"
depends_on:
- api

23 changes: 23 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:19 as build

ENV NODE_ENV=production


WORKDIR /app

COPY package.json ./
COPY package-lock.json ./
RUN npm install
COPY . ./
RUN npm run build


FROM node:19-alpine3.16

WORKDIR /app
COPY --from=build /app .


ENV HOST=0.0.0.0
EXPOSE 4173
CMD ["npm","run", "preview","--", "--host", "0.0.0.0"]
Loading

0 comments on commit 24597fd

Please sign in to comment.