Giter Site home page Giter Site logo

dfcomps.ru's Introduction

Dfcomps.ru

This is a repository for storing everything related to dfcomps.ru site, which is dedicated to hosting Quake III Defrag tournaments. Feel free to contribute or just join our awesome community and send your demos :)

For anyone interested in contributing, there is a trello board with the list of planned tasks for dfcomps: https://trello.com/b/kKv83NJL/dfcomps.

Quick start

The repository consists of several applications which are managed by Nx Workspaces. Every app is written in Typescript, recommended version of NodeJS is 18.x. To develop backend locally, you need to install Docker for working with database. Before running any projects locally, you need to install npm packages:

npm i

Frontend

Main site frontend written in Angular. To start frontend project locally:

npm run frontend

By default, frontend is using backend from main dfcomps.ru site, to switch to local backend use

npm run frontend-local

Connection to different backends is managed in url-params.config and also in proxy.conf files (prod and local)

Database

There is a PostgreSQL database using TypeORM for migrations and PgAdmin for database management. To setup database make sure Docker is installed and running, then execute this script once:

npm run database:setup

After that, you will have PostgreSQL working on port 5432 with test database and PgAdmin working on port 4004. To access database via PgAdmin:

  • Open PgAdmin frontend http://localhost:4004
  • Login as test user Login: [email protected], Password: admin
  • Right click on Servers -> Register -> Server
  • Input any name at General tab
  • At Connection tab input this fields:
Host name/address: local_pgdb
Port: 5432
Maintenance database: postgres
Username: user
Password: admin
  • After clicking save you should be able to access dfcomps test database.

The database itself is obfuscated replica of prod database without user sensitive information like logins, passwords and discord tags.

Backend

Main site backend written in NestJS. To start backend project locally you need to first ensure that you have local version of database initialized (as described in previous section). Start script:

npm run backend

1v1 Server

Websocket server specially designed for 1v1 pick/bans and matchmaking. Written in pure Typescript using Express. To start server locally:

npm run 1v1-server

Websocket interaction between client and server is pretty complex, so there is 100% coverage of all use cases by end-to-end tests. Make sure that all new functionality also is covered by end-to-end tests and all tests are passing by running:

npm run 1v1-server:test

Testing

There are several test users in test database, each of them representing the access role.

Login: superadmin Password: superadmin
Login: admin Password: admin
Login: validator Password: validator
Login: cup_organizer Password: cup_organizer
Login: newsmaker Password: newsmaker
Login: user Password: user
Login: moderator Password: moderator
Login: streamer Password: streamer

There are end-to-end tests written in Cypress, which can be run by commands

npm run e2e
npm run e2e-single # edit the test name in this script & run single test

Test cases (☐ - needs to be automated, ☑ - already has e2e test):

☑ 1. Adding simple news
☑ 2. Editing simple news
☑ 3. Deleting news
☑ 4. Adding offline cup
☑ 5. Editing offline cup
☑ 6. Adding start offline cup news
☑ 7. Editing start offline cup news
☑ 8. Adding offline cup result news
☑ 9. Editing offline cup result news
☑ 10. Adding online cup announce news
☑ 11. Adding online cup result news
☑ 12. Adding multicup result news
☑ 13. Adding streamers result news
☑ 14. Uploading valid demo with overbounces turned off
☑ 15. Uploading valid demo with overbounces turned on
☑ 16. Uploading invalid demo
☑ 17. Validation (validators archive + setting results in admin)
☑ 18. Finishing cup (distribution of rating + making cup archive)
☑ 19. Deleting offline cup
☑ 20. Adding multicup
☑ 21. Editing multicup
☐ 22. Adding multicup round with custom map
☐ 23. Editing multicup round with custom map
☐ 24. Deleting multicup round with custom map
☑ 25. Deleting multicup
☑ 26. Adding online cup
☑ 27. Editing online cup
☑ 28. Online cup with server logs
☑ 29. Online cup with manual results
☑ 30. Deleting online cup
☑ 31. Ending season
☐ 32. Updating profile
☐ 33. Warcup map suggestion
☐ 34. Warcup map admin voting

Discord bot

Designed to bring some dfcomps functionality to discord channels. Currently is not used and is in deprecated state. To run locally:

npm run discord-bot

Server scheme

Everything related to server scheme is stored in build folder, main part of which is build/base-nginx.conf. Visual interpretation of nginx config and server scheme: dfcomps server

dfcomps.ru's People

Contributors

angular-cli avatar deniskond avatar dependabot[bot] avatar gk8tech avatar kg7x avatar levevg avatar not-arzuaga avatar wolfeman95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dfcomps.ru's Issues

Fix youtube component to only click once on the video

There is a possibility to add youtube embed to news, like here: http://dfcomps.ru/news/318. The youtube embed is optimized not to load youtube player at first, and only displays the video image.
The problem is: the user needs to click twice to start video and it needs to be fixed :) This can probably be done by generating second click on youtube embed component just after the first click.
In this issue, only YoutubeComponent needs to be edited.

Unable to see comments

Not logged in. Can't see any comments on the main page.

image

Browser: Firefox 99.0 (64-bit)

See no errors in console, plugins are disabled.

Development page

На ней пока будут новости разработки и описание как помочь разработке сайта
Добавить ключ в таблицу новостей и чекбокс в админку, показывающий что это статья

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.