Skip to content

KirylMi/uni-web_sdt-2.2-image_sharing_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WEB-SDT

INFO:

Этот репозиторий (именно этот) является отображением приватного репозитория по разработке лаб по вебу в универе, из данного репозитория удалены ВСЕ коммиты/ветки (в т.ч. ansible ветка) и т.д. кроме последней (Сделано это для того, чтобы скрыть личные данные, которые, в теории, могли попасть в коммиты во время разработки (почта, пароли от AWS (S3,...)). После успешной сдачи лаб могу признаться, что в лабе есть один большой косяк, который я заметил только к концу последней лабораторной. Сам "косяк" - огромное количество обращений к S3 (Каждое фото = новое обращение), что выливается в тысячи обращений при тестировании (а S3 не совсем бесплатен, если делать 10к+ обращений), чинить я это конечно же не стал, т.к. и так налепил огромное количество ненужный вспомогательных классов, которые, вроде как, существенно улучшили абстракцию, но нарушили самое главное - скорость работы. Соответсвенно исправление привело бы к переделке довольно большого количества кода. Вряд ли это кто-то будет читать, поэтому да, можно и написать про ошибки :)

Temp info for the teacher

Я там налажал с коммитами и бренчами, каюсь. Много коммитов отправлял без указания какая лаба, т.к. много раз фиксил стили, функции, БД запросы которые относятся к разным лабам + обновлял readme и т.д.

For launching the app, .env files must be filled. Their description can be found below. I uploaded some env (without dot) files, with examples, change what must be changed, and it will be almost ready to roll

Sometimes, the installation of image viewing script is needed for correct work. If images are not showing (happened to me twice, tried it on the absolutely new linux system - everything was fine) then go to the localhost:8001/slir/install
This will automatically install some additional files in the project folder, which will make images working

Main Info

Main parts:

PHP, Apache, PostgreSQL

Additional software:

PGAdmin4, Composer

Libraries

PHPMailer - https://github.com/PHPMailer/PHPMailer,
Dotenv (for PHP) - https://github.com/vlucas/phpdotenv,
GD (PHP ext)
SLIR - https://github.com/lencioni/SLIR
AWS SDK for PHP (S3) - https://github.com/aws/aws-sdk-php

Important Notes

Dotenv

Program requiers .env files:

  • .env in the main directory (with the docker-compose variables) like:

    DB_PASSWORD
    DB_NAME
    DB_USER

  • .env in the ./www/ directory (with the Mailer variables + DB) like:

    DB_HOST
    DB_PORT
    DB_USER
    DB_NAME
    DB_PASSWORD
    MAIL_USER
    MAIL_EMAIL
    MAIL_PASS
    MAIL_FROM
    MAIL_SSL
    MAIL_PORT
    S3_BUCKET
    S3_KEY
    S3_SECRET_K

Tasks:

  • ✔️ Docker+PHP
    • ✅ Docker + docker-compose
    • ✅ Apache with PHP on(in?) Docker
    • ✅ PostgreSQL on(in?) Docker
    • ✅ PGAdmin4 on(in?) Docker
    • ✅ Composer on(in?) Docker
    • ✅ Migrations in PostgreSQL(Dockerised)
    • 🏁 Tests
  • ✔️ Apache Rerouting
    • ✅ .htaccess file
    • 🏁 Tests
  • ✔️ Registration,Sign in and activation through email
    • ✅ Interface
    • ✅ PHPMailer
    • ✅ DB queries
    • 🔲 Three tries*
    • 🏁 Tests
  • ✔️ Users list + Profile
    • ✅ ProfilePage
    • ✅ NavPanel
    • ✅ UsersPage
    • ✅ ProfilePage with photos
    • ✅ Tests
  • ✔️ Profile edit
    • ✅ Change email with reactivation
    • ✅ Change password, name
    • ✅ Tests
    • 🔲 Change privilege (Lab N required)
    • ✅ Tests
  • ✔️ Images
    • ✅ Amazon S3
    • ✅ Amazon S3 put
    • ✅ Amazon S3 get
    • ✅ Amazon S3 delete
    • ✅ DB queries
    • ✅ GD Tests
    • ✅ Show and Delete interface
    • ✅ Size control
    • ✅ Fake images tests
  • ✔️ Subscriptions
    • ✅ Idea
    • ✅ DB (Table, functions, queries)
    • ✅ Button:)
    • ✅ Showing images in the correct order
    • ✅ Styles fixes
    • ✅ Tests
    • 🔲 list of subscribers. Easy one, but should i add it?
  • ✔️ Comments
    • ✅ Idea
    • ✅ DB (Table, functions, queries)
    • ✅ Buttons:)
    • ✅ Showing them and synchronysing
    • 🔲 Styles fixes. Will have to change a lot. Better stay as it is
    • ✅ Tests

P.S.

........

For me:

  • ✅ Not ERRORS+header, create a php file with redirection, or add function "Rerout($errormsg,$location)"
  • ✅🔲 Stop using direct db.php access. There must be such hierarchy: Pages->(if needed)Functions->(if needed)Db queries
  • ✅🔲 Delete useless comments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors