https://github.com/xmlynek/elearn-web-app
Elearn application about UWB technology
https://github.com/xmlynek/elearn-web-app
axios bootstrap docker docker-compose express formik-yup jwt-tokens mysql nodejs nodemailer passport prisma react react-pdf rest-api tsnode typescript
Last synced: about 2 months ago
JSON representation
Elearn application about UWB technology
- Host: GitHub
- URL: https://github.com/xmlynek/elearn-web-app
- Owner: xmlynek
- License: mit
- Created: 2022-08-05T10:50:50.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-09T16:00:56.000Z (almost 4 years ago)
- Last Synced: 2025-05-12T23:24:34.555Z (about 1 year ago)
- Topics: axios, bootstrap, docker, docker-compose, express, formik-yup, jwt-tokens, mysql, nodejs, nodemailer, passport, prisma, react, react-pdf, rest-api, tsnode, typescript
- Language: TypeScript
- Homepage: https://elearn-uwb-app.azurewebsites.net/welcome
- Size: 4.1 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Node Express TypeScript Elearn App about UWB

---
[](https://www.typescriptlang.org/)
[](https://reactjs.org/)
[](https://nodejs.dev/)
[](https://www.npmjs.com/package/ts-node)
[](https://expressjs.com/)
[](https://www.prisma.io/)
[](https://www.mysql.com/)
[](https://hub.docker.com/repository/docker/xmlynek/node-backend)
[](https://elearn-uwb-bp.azurewebsites.net/welcome)
[](https://getbootstrap.com/)
# Table of Contents
- [Quick start](#quick-start)
- [npm](#npm)
- [docker-compose](#docker-compose)
- [Overview](#overview)
- [Features](#features)
- [Use Case Diagram](#use-case-diagram)
- [User Roles and Functionality](#user-roles-and-functionality)
- [Unauthenticated](#li-unauthenticated-li)
- [Student](#li-student-li)
- [Teacher](#li-teacher-li)
- [Admin](#li-admin-li)
- [Database Model](#database-model)
- [Docker](#docker)
- [Docker run](#docker-run)
- [Docker compose](#docker-compose-1)
- [Env variables](#env-variables)
- [App design & components](#app-design--components)
- [License](#license)
# Quick start
## npm
1. Run `npm install`
2. Rename `config.env.example` to `config.env`
3. Set valid `DATABASE_URL` in `config.env` file
4. Run `npm start`
5. App is running at http://localhost:8080/
## Docker compose
- Run `docker compose up`
# Overview
This application is a Web Elearning application about the UWB technology, which is the result of my bachelor thesis rework. It's a full stack application, which consists of React, Nodejs and Typescript technology. App uses REST API for communication between FE & BE using Express framework. I used Prisma for ORM and MySQL database.
- Example application is running on Microsoft Azure: https://elearn-uwb-app.azurewebsites.net
- Admin credentials: `admin@random.sk` `password1`

## Features
- Authentication/Authorization
- JWT tokens
- Client/server input validation
- REST API (Express)
- Swagger OpeAPI
- Password reset
- Roles
- Dynamic forms using formik
- Multiple question types
- React PDF
- Responsive design
- Nodemailer
- 2 languages
- Passport jwt
- Bootstrap
- Axios
- Docker & docker compose
- & many others..
# Use Case Diagram
### Use Case diagram contains the role-based functionality of the application mentioned at User Roles And Functionality, that the user can perform.

# User Roles and Functionality
##
User without authentication has the folowing functionality:
---
##
User with role Student has the following functionality:
---
##
In addition to the same functionality as the above Student role, a user with the Teacher role also has the following functionality:
---
##
In addition to the same functionality as the above Teacher role, a user with the Admin role also has the following functionality:
# Database Model

# Docker
Docker hub: xmlynek/react-node-elearn-app
## Docker run
`docker run -p 8080:8080 -e DATABASE_URL=mysql://Filip:password@localhost:3306/uwbdb -e NODE_ENV=production xmlynek/react-node-elearn-app`
## Docker compose
run `docker compose up`
```
version: '3.8'
services:
mysql_db:
image: mysql:8.0
restart: always
volumes:
- ./mysql/volume:/var/lib/mysql
- ./mysql/dump.sql:/docker-entrypoint-initdb.d/dump.sql
ports:
- 9906:3306
environment:
MYSQL_HOST: localhost
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: Filip
MYSQL_PASSWORD: password
MYSQL_DATABASE: uwbdb
healthcheck:
test: "exit 0"
server:
image: xmlynek/react-node-elearn-app
ports:
- 8080:8080
environment:
- DATABASE_URL=mysql://Filip:password@mysql_db/uwbdb
- NODE_ENV=production
depends_on:
mysql_db:
condition: service_healthy
restart: always
```
## Env variables
- PORT
- NODE_ENV - development/production
- DATABASE_URL - mysql://USERNAME:PASSWORD@HOST:PORT/DB_NAME
- JWT_ACCESS_TOKEN_SECRET
- JWT_ACCESS_TOKEN_EXPIRATION
- JWT_REFRESH_TOKEN_SECRET
- JWT_REFRESH_TOKEN_EXPIRATION
- JWT_PASSWORD_RESET_TOKEN_SECRET
- JWT_PASSWORD_RESET_TOKEN_EXPIRATION
- EMAIL_HOST
- EMAIL_PORT
- EMAIL_USERNAME
- EMAIL_PASSWORD
- EMAIL_SERVICE
# App design & components
Design of pages and components can be found in client README
# License