Skip to content

moxxiq/online-diary

Repository files navigation

Online Diary

Backend • Heroku Status

Frontend • Netlify Status

Description

Online diary for teachers and students to collaborate. Make and do different types of works, group students by classes etc

Database structure

Database structure

Database structure

Installation

To launch this service local you need to

1. Clone the repository

git clone git@gitlab.com:MathApe/online-diary.git
cd online-diary

2. Install docker and docker compose for your system

https://docs.docker.com/engine/install/

https://docs.docker.com/compose/install/

3. Build and run all services

docker-compose -f docker-compose-local.yaml up --build --detach

If this is your first time, please run database migrations

docker-compose -f docker-compose-local.yaml exec backend alembic upgrade head

And rerun docker-compose

docker-compose -f docker-compose-local.yaml up --build

Develop

To rebuild only 1 service you need to

docker-compose -f docker-compose-local.yaml up --detach --build {service-name}

To run tests execute

docker-compose -f docker-compose-local.yaml exec backend pytest

To run DB migration

docker-compose -f docker-compose-local.yaml exec backend alembic upgrade head

To run migration after structure change

docker-compose -f docker-compose-local.yaml exec backend alembic revision --autogenerate -m "Add a column" 

Change owner of the files if it is needed

docker-compose -f docker-compose-local.yaml exec backend chown -R 1000:1000 migrations

Edit the file online-diary/services/backend/migrations/versions/b54somehash14_add_a_column.py or just a new file with corresponding name to correct the migration

Run again migration to head

docker-compose -f docker-compose-local.yaml exec backend alembic upgrade head

WARNING: If you add a new model, put its metatada into target_metadata in file services/backend/migrations/env.py

Usage

Install, play with admin user, credentials of which must be in environment variables.

Contributing

If you find this repository useful and want to improve it - just fork it.

Authors and acknowledgment

Authors: Dmytro Bubela, Nazar Havryliuk, Oliinyk Maiia, Nadiia Tolstukha

License

This project is licensed under the terms of the MIT license.

Project status

WARNING: Not ready for production, vulnerable to CSRF attacks

Project was made for University course, probably will have no further updates after the passing