Compare commits

...

4 Commits

Author SHA1 Message Date
Sascha Kühl 7788369b73 removed unused variable 2025-04-21 21:49:56 +02:00
Sascha Kühl 3b873c62b0 added readme 2025-04-21 21:49:16 +02:00
Sascha Kühl d10b7efed9 backend fixes 2025-04-21 21:49:03 +02:00
Sascha Kühl 05ead54051 app progress 2025-04-21 21:48:46 +02:00
9 changed files with 18 additions and 21 deletions

View File

@ -5,7 +5,7 @@ class BackendService {
return localStorage.getItem("server") !== null;
}
getServer(): Server {
return JSON.parse(localStorage.getItem("server") || '{"protocol":"https","host":"localhost","port":8080}');
return JSON.parse(localStorage.getItem("server") || '{"protocol":"https","host":"localhost","port":8124}');
}
updateServer(server: Server): void {
localStorage.setItem("server", JSON.stringify(server));

View File

@ -15,11 +15,9 @@ export class BullpenSessionService {
}
public save(bullpen: Bullpen): Promise<Bullpen> {
console.log(JSON.stringify(bullpen, null, 2));
return api
.post('/bullpen_session', bullpen)
.then(response => {
console.log(JSON.stringify(response.data, null, 2));
return response.data;
}, (error) => {
console.log(JSON.stringify(error, null, 2));

View File

@ -22,7 +22,6 @@ class TokenService {
}
setUser(user: UserInfo) {
console.log(JSON.stringify(user));
localStorage.setItem("auth", JSON.stringify(user));
}

View File

@ -29,8 +29,6 @@ const pitcher = computed(() => store.state.auth.user);
const pitchTypes = computed(() => store.state.pitchTypes.pitchTypes);
const bullpen = computed(() => store.state.bullpen);
console.log(JSON.stringify(bullpen.value.bullpen, null, 2));
const determinePitchTypeName = (id: number): string => {
const pitchType = pitchTypes.value.find((pitchType: PitchType) => pitchType.id === id);
@ -52,7 +50,7 @@ const gotoHome = () => {
<ion-title v-else>Bullpen Summary</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-content v-if="bullpen.bullpen">
<ion-card v-for="(pitch, index) in bullpen.bullpen.pitches" :key="index">
<ion-card-header>
<ion-card-title>Pitch {{index+1}}</ion-card-title>

View File

@ -15,28 +15,23 @@ const userImage = ref(null);
const pitcher = computed(() => store.state.auth.user);
const isAuthenticated = computed(() => store.state.auth.isAuthenticated);
console.log('user', pitcher.value);
if (pitcher.value === undefined || pitcher.value === null || pitcher.value === '') {
router.push({ path: '/login' });
}
const startBullpen = () => {
console.log('Starting bullpen session');
router.push({ path: '/bullpen' });
};
const showStats = () => {
console.log('Showing bullpen stats');
router.push({ path: '/stats' });
};
const showProfile = () => {
console.log('Showing profile');
router.push({ path: '/profile' });
};
const logout = () => {
console.log('Logout');
store.dispatch('auth/logout').then(() => {
router.push({ path: '/' });
}, error => {

View File

@ -1,4 +1,3 @@
.idea
node_modules
npm-debug.log
.env.*

View File

@ -24,7 +24,7 @@ RUN --mount=type=bind,source=package.json,target=package.json \
npm ci --include=dev
USER node
COPY . .
CMD ["npm", "run", "dev"]
CMD ["npm", "run", "start:dev"]
#FROM node:20-alpine as build

View File

@ -6,11 +6,13 @@ services:
secrets:
- db-password
environment:
POSTGRES_DB: bullpen-prod
POSTGRES_USER: test
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD_FILE: /run/secrets/db-password
expose:
- 5432
ports:
- "15432:5432"
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
@ -29,12 +31,12 @@ services:
- "8124:8080"
container_name: bullpen
environment:
NODE_ENV: production
POSTGRES_HOST: db
POSTGRES_USER: test
NODE_ENV: development
POSTGRES_HOST: ${DB_HOST}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD_FILE: /run/secrets/db-password
POSTGRES_DB: bullpen-prod
POSTGRES_PORT: 5432
POSTGRES_DB: ${DB_NAME}
POSTGRES_PORT: ${DB_PORT}
secrets:
- db-password
volumes:

6
backend/readme.md Normal file
View File

@ -0,0 +1,6 @@
docker-compose up --build -d
docker-compose exec app npx sequelize-cli db:migrate
docker-compose exec app npx sequelize-cli db:seed:all
docker-compose exec app sh