-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 065debf
Showing
105 changed files
with
21,604 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.env* | ||
dist | ||
static/css/ | ||
*.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build_and_run: | ||
script: | ||
- docker-compose down | ||
- docker-compose build | ||
- docker-compose up --detach | ||
only: | ||
refs: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# build stage | ||
FROM node:14 as build-stage | ||
|
||
WORKDIR /app | ||
|
||
# ---------- Build stage ---------- | ||
# Creates: | ||
# - node_modules: production dependencies (no dev dependencies) | ||
# - dist: A production build compiled with TypeScript | ||
|
||
COPY package*.json ./ | ||
COPY prisma ./prisma | ||
RUN npm ci | ||
|
||
COPY . . | ||
RUN npm run build:ts | ||
RUN npm run build:scss | ||
RUN npm run build:css | ||
|
||
# Remove dev dependencies | ||
RUN npm prune --production | ||
|
||
# ---------- Release stage ---------- | ||
|
||
FROM node:14 as production-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
COPY --from=build-stage /app/node_modules ./node_modules | ||
COPY --from=build-stage /app/dist ./dist | ||
COPY --from=build-stage /app/static/css ./static/css | ||
|
||
RUN chown -R node:node /app | ||
USER node | ||
|
||
EXPOSE 3005 | ||
CMD [ "node", "dist/index.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# OSA Virtual Challenge | ||
**Web: https://osachallenge.sk/** | ||
|
||
Vytvorili sme webovú aplikáciu pre športovcov, kde sa môžu zapojiť do virtuálnych výziev. Používateľ si zaregistruje výzvu, kde muší splniť rôzne športové aktivity. Záznam o aktivite nahrá ako fotku do webovej aplikácie. Správca musí aktivitu skontrolovať a schváliť. | ||
## Použité technológie | ||
### Frontend | ||
Webová aplikácia má jednoduché používateľské rozhranie. Preto som použil len **HTML a CSS** (konkrétne **Sass**) v kombinácii s **EJS** pre dynamický obsah. **CSS** je písané v **BEM** metodológii. Neskôr môžeme jednoducho nahradiť náš frontend do niektorého JS frameworku, keďže FE je minimálne previazaný s backendom. | ||
|
||
### Backend | ||
Backend som implementoval v **Express.js** a **TypeScript**-e. Dáta ukladáme do **MySQL** databázy s ktorou komunikujeme cez **ORM Prisma**. | ||
|
||
### Nasadenie | ||
Webová aplikácia je **dockerizovaná**, pričom ju môžeme automaticky nasadiť na virtuálny server pomocou **CI/CD** v **GitLab-e**. | ||
|
||
### Externé služby | ||
**Cloudinary** sme použili na ukladanie obrázkov. Používatelia nahrávajú svoje fotky do aplikácie, a preto sme potrebovali zabezpečiť vhodné úložisko a kompresiu fotiek. Cloudinary sme vybrali pretože rieši naše potreby a poskytuje jednoduché API. | ||
|
||
## Plány na vylepšenie | ||
Webová aplikácia je stále vo vývoji (pracujem na nej len vo voľnom čase). Preto aplikáciu postupne dopĺňame o novú funkcionalitu napr: | ||
- Integrácia so službou PAY by square - QR platby | ||
- Odosielanie naštýlovaných HTML emailov pri registrácii atď... | ||
- Ochrana pomocou Google reCAPTCHA | ||
- Zľavové kupóny | ||
- atd. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3.8' | ||
|
||
services: | ||
database: | ||
image: mysql:8 | ||
ports: | ||
- 3307:3306 | ||
volumes: | ||
- osa-virtual-challenge-db-volume:/var/lib/mysql | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${DB_NAME} | ||
MYSQL_USER: ${DB_USER} | ||
MYSQL_PASSWORD: ${DB_PASSWORD} | ||
backend: | ||
build: . | ||
environment: | ||
- NODE_ENV=development | ||
- DATABASE_URL | ||
- PORT | ||
- URL | ||
- JWT_SECRET | ||
- CLOUDINARY_API_KEY | ||
- CLOUDINARY_API_SECRET | ||
- CLOUDINARY_CLOUD_NAME | ||
- MAIL_PASSWORD | ||
- MAIL_USER | ||
restart: always | ||
ports: | ||
- ${PORT}:${PORT} | ||
depends_on: | ||
- database | ||
|
||
volumes: | ||
osa-virtual-challenge-db-volume: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"watch": [ | ||
"./dist/*", | ||
"./views/*" | ||
], | ||
"ext": "js, css, html, ejs" | ||
} |
Oops, something went wrong.