Code Monkey home page Code Monkey logo

pyladies-courseware's Introduction

Pyladies Courseware

Nástroj pro odevzdávání a review domácích úkolů z programování.

CircleCI

Production deployment: https://projekty.pyladies.cz/

Demo (reseted on every deploy): https://projekty-demo.messa.cz/

Todo

Next steps:

  • dokončit workflow pro review úkolů
  • rozběhat FB a Google login
  • přidat Github login
  • někam to nasadit :)
  • udělat notifikace
    • uvnitř aplikace
    • do Slacku
    • e-mail
    • debouncing (neposílat každou zvlášť, ale agregovat)
  • dodělat admin uživatelů, ať se dají přiřazovat studenti a koučové do jednotlivých kurzů

Dlouhodoběji:

  • odevzdávání přes Github

Viz také issues.

Pokud máte dotaz nebo chcete spustit diskuzi nad některým todo, založte issue (pokud už takové neexistuje).

Architecture

Uses React frontend based on Next.js and Python backend based on aiohttp.server.

browser --> nginx
              - /* ------------> node.js frontend
              - /api, /auth ---> Python aiohttp backend ---> MongoDB  

Why React:

  • the site will be very dynamic, with complex forms, no-reload page updates, notifications etc. React enables to do this on client-side easily
  • so far we keep the code as simple as possible - no redux, no graphql etc., just "classic" React component state

Why Next.js:

  • handles all the boring stuff: webpack, routing, code splitting...
  • we just write the React components, nothing else, no server-side code (except getInitialProps)
  • we don't even use "nice" dynamic URLs to keep things as simple as possible
    • URL /lesson?courseId=abc is served from pages/lesson.js with props: { query: { courseId: 'abc' }}

Why Python backend:

  • the language we all love :)
  • libraries for everything
  • more mature language for business logic and advanced I/O, process management etc.
  • API backend is more responsive when the HTML server-rendering is outsourced to client process (or to static files)

Why aiohttp:

  • supports websockets natively
  • enables the server to be single-process, single-thread, so things like notification broadcasting become much easier
  • powerful enough (just serves JSON API, no template rendering)
  • the MongoDB asyncio client motor is a "first-class" MongoDB client library

Why MongoDB:

  • provides all we need
  • "operations friendly" - replication, migration etc. much easier than with *SQL
  • MongoDB and its Python client motor provide nice asyncio API

Requirements

  • Node.js >= 10.0
  • Python >= 3.6
    • Ubuntu: install also python3-venv
  • MongoDB
    • via Docker: docker run --rm -it -p 27017:27017 mongo:4

Local Development

Ve 3 samostatných konzolích spusť:

$ make run-mongod
$ make run-backend
$ make run-frontend

Otevři http://localhost:3000/

Port Služba
3000 Node.js – frontend
5000 aiohttp – backend
27017 MongoDB

Při změně kódu Python backendu je potřeba restartovat proces (tj. znovu spustit make run-backend). Pro automatizaci tohoto lze použít nějaký watchdog, např. watch_files.py.

Developer login

Pro usnadnění vývoje na localhostu, je možné (v defaultu automaticky) zapnout tlačítka přihlášení různých rolí.

local dev login

Usage:

# in the backend directory
$ export ALLOW_DEV_LOGIN=1
$ make run-backend

Project structure

pyladies-courseware
├── Dockerfile
├── Makefile
├── backend
│   ├── Makefile
│   ├── cw_backend
│   │   ├── __init__.py
│   │   ├── __main__.py
│   │   ├── configuration.py
│   │   ├── courses.py
│   │   ├── main.py
│   │   ├── model
│   │   ├── util
│   │   └── views
│   ├── requirements-tests.txt
│   ├── requirements.txt
│   ├── setup.py
│   └── tests
│       ├── conftest.py
│       ├── data
│       ├── model
│       │   ├── test_users.py
│       │   └── ...
│       ├── ...
├── data - course, session and task data
├── frontend
│   ├── components
│   │   ├── ALink.js
│   │   ├── CodeEditor.js
│   │   ├── Header.js
│   │   ├── HomeworkComments.js
│   │   ├── ...
│   │   ├── admin
│   │   └── forms
│   ├── package-lock.json
│   ├── package.json
│   ├── pages
│   │   ├── admin
│   │   │   └── users.js
│   │   ├── course.js
│   │   ├── index.js
│   │   ├── lesson.js
│   │   ├── login.js
│   │   └── profile.js
│   ├── static
│   └── util
└── resources - images for README etc.
    └── local_dev_login.png

Poznámky

Nějaký pokus o přepsání domácích úkolů proběhl zde: pyvec/naucse.python.cz#153

pyladies-courseware's People

Contributors

messa avatar brabemi avatar veronikks avatar encukou avatar kobzol avatar zuzejk avatar frenzymadness avatar petravidnerova avatar adelpopelkova avatar fivaldi avatar zitkat avatar disi77 avatar janaslo avatar mintaka avatar petracihalova avatar vasekch avatar zuzanita avatar befeleme avatar dependabot[bot] avatar radzuka avatar jahodfra avatar jirkav avatar hroncok avatar

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.