Consolidate to single app
- Dominant language
- Python
- Stars
- 12
- Forks
- 21
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 5
Description
# TL;DR
Consolidate the various app directories - accounts, api, exp, studies, web, project - into a single app.
# Narrative
As a developer, I want the organization of my app code to make sense. Furthermore, I don't want a complicated dependency graph for migrations.
The choice to split lookit-api into several applications was ill-advised. Given the high cohesion/interconnectedness of the data model, it has created more problems than solved by imposing awkward conceptual boundaries that have become a nuisance when adding new features ("does this go in `accounts` because it deals with accounts? Or does it go in `web` because it's part of the "web" interface? What does "web" even mean - isn't the entire application, a web application?).
We should consolidate to a single app, and in the process blow away the previous migrations and create a new initial migration. This could even coincide with our new semver'd v1 (#558), to formalize the notion that this is the real v1 data model.
# Acceptance Criteria
- [ ] All old tests pass.
# Implementation Notes
## Ancillary (beneficial) effect on tests
This will also speed up tests (see #564 ), since we won't be forcing our test harness to dutifully recapitulate the entire evolution of Lookit's data model every time we run `python manage.py test`.
## New Directory Structure
The new directory structure should look (very roughly) as such:
```
.
├── config
│ └── settings
├── lookit
│ ├── admin
│ ├── backends
│ ├── fields
│ ├── forms
│ ├── media
│ ├── migrations
│ ├── mixins
│ ├── models
│ ├── queries
│ ├── scripts
│ ├── serializers
│ ├── static
│ ├── templates
│ ├── templatetags
│ ├── tests
│ ├── urls
│ └── views
└── requirements
```
(files not included - classes and functions from different files may be reorganized to account for the fact that "shared" code is now subsumed into a single app)
After the multi-phase move to this consolidated structure, we should have #558 ready to go for a v1 release that deletes the rest of the cruft.
# Implementation Plan
## Phase 0: New Directory Structure
App skeleton changes
- [ ] Create new `lookit` app
- [ ] Rename `project` to `config`
## Phase 1: Model Migrations
- [ ] `studies` --> `lookit`
- [ ] `accounts` --> `lookit`
## Phase 2: Stateless Code Re-org
Includes static, templates, view code, urlconfs, etc.
- [ ] `studies` --> `lookit`
- [ ] `accounts` --> `lookit`
- [ ] `web` --> `lookit`
- [ ] `api` --> `lookit`
- [ ] `exp` --> `lookit`
## Phase 3: Cleanup & Finalize
- [ ] Delete old app shells
- [ ] Cleanup migrations (reset `id_seq` and clean out old content types)
Contributor guide
Assessment
This issue has not been assessed yet.