This is the repository responsible for Streamlet's apps.
-
Backend β Streamlet's application backend.
To work properly, fill in the
.env
file. Use the.env.example
file as an example. -
Frontend β Streamlet's application frontend.
To work properly, fill in the
.env
file. Use the.env.example
file as an example. -
Shared β Streamlet's application common modules for reuse.
- NodeJS (16.x.x);
- NPM (8.x.x);
- PostgreSQL (14.0)
- Docker
- run
npx simple-git-hooks
at the root of the project, before the start (it will set the pre-commit hook for any commits).
- Create
.env
folder at the root project and addapi-db.env
file according to.env.example
- Fill ENVs in each project
npm install
at the rootnpx simple-git-hooks
at the root
Each project run in the separate terminal
- Go to
.docker
folder and run:docker compose up -d
- Apply first migration to DB:
npm run migrate
- Run:
npm run start:backend
- Run:
npm run start:frontend
Static analyzers are used for both frontend and backend projects to ensure basic code quality. Additionally, quality criteria rules are enforced during code review and audit.
erDiagram
User {
String id PK
String email
String username
String password
Boolean isActivated
DateTime createdAt
DateTime updatedAt
}
UserProfile {
String id PK
String firstName
String lastName
String avatar
DateTime createdAt
DateTime updatedAt
}
RefreshToken {
String id PK
String token
DateTime createdAt
DateTime updatedAt
}
ResetPasswordToken {
String id PK
String token
String userId
DateTime createdAt
DateTime updatedAt
}
Video {
String id PK
String name
String description
Boolean isLive
String videoPath
Int liveViews
Int videoViews
DateTime createdAt
DateTime updatedAt
}
Tag {
String id PK
String name
DateTime createdAt
DateTime updatedAt
}
Category {
String id PK
String name
DateTime createdAt
DateTime updatedAt
}
VideoComment {
String id PK
String text
DateTime createdAt
DateTime updatedAt
}
Channel {
String id PK
String name
String description
String contactEmail
String bannerImage
DateTime createdAt
DateTime updatedAt
}
Subscription {
String id PK
Boolean notify
DateTime createdAt
DateTime updatedAt
}
ChatMessage {
String id PK
String text
DateTime createdAt
DateTime updatedAt
}
Notification {
String id PK
String text
Boolean viewed
DateTime createdAt
DateTime updatedAt
}
History {
String id PK
DateTime createdAt
DateTime updatedAt
}
Reaction {
String id PK
Boolean isLike
DateTime createdAt
DateTime updatedAt
}
UserProfile o|--|| User : "user"
RefreshToken o|--|| User : "user"
Video o{--}o Tag : ""
Video o{--}o Category : ""
Video o{--|| Channel : "channel"
Tag o{--}o Video : ""
Category o{--}o Video : ""
VideoComment o{--|| Video : "video"
VideoComment o{--|| User : "author"
Channel o{--|| User : "author"
Subscription o{--|| User : "user"
Subscription o{--|| Channel : "channel"
ChatMessage o{--|| Video : "video"
ChatMessage o{--|| User : "author"
Notification o{--|| User : "user"
Notification o{--|| Video : "video"
History o{--|| User : "user"
History o{--|| Video : "video"
Reaction o{--|| User : "user"
Reaction o{--|| Video : "video"
- Express β a backend framework.
- InversifyJS - an IoC container
- Prisma β an ORM.
- React β a frontend library.
- Redux + Redux Toolkit β a state manager.
- simple-git-hooks β a tool that lets you easily manage git hooks.
- lint-staged β run linters on git staged files.
- editorconfig β helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
- prettier β an opinionated code formatter.
- ls-lint β file and directory name linter.
- eslint β find problems in your JS code
- stylelint β Find and fix problems in your CSS code
production
- production source code.development
- staging source code.
<type>/<project-prefix><ticket-number>-<short-desc>
- task
- fix
task/design5-add-signin-page
task/blog12-add-filters
fix/design16-fix-signup-validation
<project-prefix>-<ticket-number>: <modifier> <desc>
+
(add)*
(edit)-
(remove)
blog-5: + form component
design-12: * filter markup
blog-16: - require prop for nickname field
Specify api.env
api-db.env
files in .env
folder
Run commands from root:
docker build --build-arg REACT_APP_API_ORIGIN_URL=/api/v1 --build-arg REACT_APP_SERVER_HOST=localhost --build-arg REACT_APP_PUSH_PORT=5002 --build-arg REACT_APP_VIDEO_FALLBACK_BASE_URL=http://localhost:8080 -f .docker/frontend.Dockerfile -t frontend .
docker build -f .docker/backend.Dockerfile -t backend .
docker build -f .docker/push.Dockerfile -t push .
docker build -f .docker/video-transcoding-server.Dockerfile -t video-transcoding-server .
docker compose -f .docker/docker-compose.local.yml up -d
Fill the files api-debug.env
and client-debug.env
in .env
folder.
When you change the frontend, it requires page refresh.
docker compose -f .docker/debug/docker-compose.debug.yml up --build