Merge branch 'master' of github.com:simon-brooke/youyesyet
This commit is contained in:
commit
682f952b66
91
doc/specification/scaling.md
Normal file
91
doc/specification/scaling.md
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
# YouYesYet: Scaling
|
||||||
|
|
||||||
|
Suppose the YouYesYet project works and we have thousands or tens of thousands of volunteers across Scotland all out chapping doors at the same time: how do we ensure the system stays up under load?
|
||||||
|
|
||||||
|
## Sizing the problem
|
||||||
|
|
||||||
|
There's no point in building the app if it will break down under load. We need to be persuaded that it is possible to support the maximum predictable load the system might experience.
|
||||||
|
|
||||||
|
### Database load per volunteer
|
||||||
|
|
||||||
|
A street canvasser visits on average while working not more than one dwelling every two minutes; the average doorknock-to-doorknock time is probably more like five minutes. Each visit results in
|
||||||
|
|
||||||
|
1. Zero or one visit record being created;
|
||||||
|
2. Zero to about five intention records;
|
||||||
|
3. Zero to about five followup request records.
|
||||||
|
|
||||||
|
So in aggregate minimum zero, maximum about eleven records, typical probably one visit, two intentions = three database inserts per street volunteer per visit. Telephone canvassers probably achieve slightly more because they don't have to walk from door to door. But over all we're looking at an average of less than one insert per volunteer per minute.
|
||||||
|
|
||||||
|
Database reads are probably more infrequent. Each client will obviously need to download the data for each dwelling visited, but it will download these in geograhic blocks of probably around 100 dwellings, and will download a new block only when the user goes outside the area of previously downloaded blocks. However, there ideally should be frequent updates so that the canvasser can see which dwellings other members of the team have already visited, in order that the same dwelling is not visited repeatedly. So there's probably on average one database read per visit.
|
||||||
|
|
||||||
|
### Reliability of network links
|
||||||
|
|
||||||
|
Mobile phones typically can have intermittent network access. The client must be able to buffer a queue of records to be stored, and must not prevent the user from moving on to the next doorstep just because the data from the last visit has not yet been stored. There should probably be some on-screen indication of when there is unsent buffered data.
|
||||||
|
|
||||||
|
### Pattern of canvassing
|
||||||
|
|
||||||
|
Canvassing takes place typically between 6:30pm and 9:00pm on a weekday evening. There will be some canvassing outside this period, but not enough to create significant load. Canvassing will be higher on dry nights than on wet ones, and will probably ramp up through the campaign.
|
||||||
|
|
||||||
|
### Total number of volunteers
|
||||||
|
|
||||||
|
Personally I've never worked in a big canvassing team - maximum about forty people. I believe that there were bigger teams in some parts of urban Scotland. I would guess that the maximum number of volunteers canvassing at any one time - across all groups campaigning for 'Yes' in the first independence referendum - never exceeded 35,000 and was probably much lower. I've asked whether anyone has better figures but until I have a better estimate I'm going to work on the basis of 35,000 maximum concurrent users.
|
||||||
|
|
||||||
|
### Estimated peak transactions per second
|
||||||
|
|
||||||
|
This means that the maximum number of transactions per second across Scotland is about
|
||||||
|
|
||||||
|
35,000 * (1 + 0.2)
|
||||||
|
------------------ = 700 transactions per second
|
||||||
|
60
|
||||||
|
|
||||||
|
700 transactions per second is not a very large number. We should be able to support this level of load on a single server. But what if we can't?
|
||||||
|
|
||||||
|
## Spreading the load
|
||||||
|
|
||||||
|
### Geographic sharding
|
||||||
|
|
||||||
|
Volunteers canvassing simultaneously in the same street or the same locality need to see in near real time which dwellings have been canvassed by other volunteers, otherwise we'll get the same households canvassed repeatedly, which wastes volunteer time and annoys voters. So they all need to be sending updates to, and receiving updates from, the same server. But volunteers canvassing in Aberdeen don't need to see in near real time what is happening in Edinburgh.
|
||||||
|
|
||||||
|
So we could have one database master for each electoral district (or contiguous group of districts) with no real problems except that volunteers working at the very edge of an electoral district would only be supported to canvas on one side of the boundary. I'd rather find an architectural solution which works for the whole of Scotland, but if we cannot do that it isn't a crisis.
|
||||||
|
|
||||||
|
It also should not be terribly difficult to organise for a street canvasser user using the *Map View* to be connected automatically to right geographic shard server, without any action by the user. The issue for telephone canvasser users is a bit different because they will often - perhaps typically - be canvassing voters in a region distant from where they are physically located, so if the geographic sharding model is adopted there would probably have to be an additional electoral district selection screen in the telephone canvasser's interface.
|
||||||
|
|
||||||
|
Data from many 'front-line' database servers each serving a restricted geographic area can relatively simply be aggregated into a national server by doing the integration work in the wee sma' oors, when most volunteers (and voters) are asleep.
|
||||||
|
|
||||||
|
The geographic sharding strategy is scalable. We could start with a single server, split it into a 'west server' and an 'east server' when that gets overloaded, and further subdivide as needed through the campaign. But we can only do this effectively if we have prepared and tested the strategy in advance.
|
||||||
|
|
||||||
|
But having considerable numbers of database servers will have cost implications.
|
||||||
|
|
||||||
|
### Read servers and write servers
|
||||||
|
|
||||||
|
It's a common practice in architecting busy web systems to have one master database server to which all write operations are directed, surrounded by a ring of slave databases which replicate from the master and serve all read requests. This works because for the majority of web systems there are many more reads than writes.
|
||||||
|
|
||||||
|
My feeling is that it's likely that YouYesYet would see more writes than reads. Thus the 'write to master, read from slaves' pattern probably isn't a big win. That isn't to say that every database master should not have a 'hot failover' slave replicating from it which can take over immediately if the master goes down.
|
||||||
|
|
||||||
|
### App servers and database servers
|
||||||
|
|
||||||
|
The majority of the processing in YouYesYet happens client side; most of what is being sent back to the server is data to be stored directly in the database. So although there will be a small performance win in separating the app server from the database server this isn't a very big win either.
|
||||||
|
|
||||||
|
### Summary: spreading the load
|
||||||
|
|
||||||
|
From the above I think the scaling problem should be addressed as follows:
|
||||||
|
|
||||||
|
1. Start with a pair of database servers (master and hot failover, with replication) and a single app server;
|
||||||
|
2. Add additional app servers on a load-balancing basis as needed;
|
||||||
|
3. Add a third database server ('read server'), also replicating from the master, and direct reads to this;
|
||||||
|
4. When the initial cluster of three database servers becomes overloaded, shard into two identical groups ('east' and 'west');
|
||||||
|
5. When any shard becomes overloaded, split it into two further shards.
|
||||||
|
|
||||||
|
If we have prepared for sharding, all that is required is to duplicate the database and then set geographic polygons to address database requests from clients within a given polygon to the database server for that polygon.
|
||||||
|
|
||||||
|
This means that essentially we should set up one polygon for each electoral district from the launch of the app, but initially requests from all of these polygons should be directed to the same database server group. As shards are added, the map of polygons to database server groups should be updated.
|
||||||
|
|
||||||
|
Obviously, once we have split the database into multiple shards, there is a task to integrate the data from the multiple shards in order to create an 'across Scotland' overview of the canvas data; however, again if we have prepared for it in advance, merging the databases should not be difficult, and can be done either in the wee sma' oors or alternatively during the working day, as the system will be relatively lighty loaded during these periods.
|
||||||
|
|
||||||
|
## Preparing for sharding
|
||||||
|
|
||||||
|
We should prepare a Docker image for the app server and a Docker image for the database server. We should prepare, as part of the app (i.e. not in the database but as a Clojure or Json data file) a datastructure which maps polygons representing each of Scotland's electoral districts to database URLs. For security reasons this datastructure should live server-side and should not be part of the single-page app sent to the client.
|
||||||
|
|
||||||
|
## Further reading on optimising Postgres performance
|
||||||
|
|
||||||
|
1. [Replication, Clustering, and Connection Pooling](https://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling)
|
|
@ -30,6 +30,7 @@
|
||||||
[mount "0.1.10"]
|
[mount "0.1.10"]
|
||||||
[cprop "0.1.9"]
|
[cprop "0.1.9"]
|
||||||
[org.clojure/tools.cli "0.3.5"]
|
[org.clojure/tools.cli "0.3.5"]
|
||||||
|
[migratus "0.8.31"]
|
||||||
[luminus-nrepl "0.1.4"]
|
[luminus-nrepl "0.1.4"]
|
||||||
[luminus-migrations "0.2.7"]
|
[luminus-migrations "0.2.7"]
|
||||||
[conman "0.6.1"]
|
[conman "0.6.1"]
|
||||||
|
|
50
resources/migrations/20161014170335-basic-setup.down.sql
Normal file
50
resources/migrations/20161014170335-basic-setup.down.sql
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
----
|
||||||
|
---- 20161014170335-basic-setup.down.sql: database schema for youyesyet.
|
||||||
|
----
|
||||||
|
---- This program is free software; you can redistribute it and/or
|
||||||
|
---- modify it under the terms of the GNU General Public License
|
||||||
|
---- as published by the Free Software Foundation; either version 2
|
||||||
|
---- of the License, or (at your option) any later version.
|
||||||
|
----
|
||||||
|
---- This program is distributed in the hope that it will be useful,
|
||||||
|
---- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
---- GNU General Public License for more details.
|
||||||
|
----
|
||||||
|
---- You should have received a copy of the GNU General Public License
|
||||||
|
---- along with this program; if not, write to the Free Software
|
||||||
|
---- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
---- USA.
|
||||||
|
----
|
||||||
|
---- Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
----
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- intended to reverse out the database changes made in
|
||||||
|
-- 20161014170335-basic-setup.up.sql
|
||||||
|
|
||||||
|
drop table addresses cascade;
|
||||||
|
--;;
|
||||||
|
drop table authorities cascade;
|
||||||
|
--;;
|
||||||
|
drop table canvassers cascade;
|
||||||
|
--;;
|
||||||
|
drop table districts cascade;
|
||||||
|
--;;
|
||||||
|
drop table electors cascade;
|
||||||
|
--;;
|
||||||
|
drop table followupactions cascade;
|
||||||
|
--;;
|
||||||
|
drop table followupmethods cascade;
|
||||||
|
--;;
|
||||||
|
drop table followuprequests cascade;
|
||||||
|
--;;
|
||||||
|
drop table issueexpertise cascade;
|
||||||
|
--;;
|
||||||
|
drop table issues cascade;
|
||||||
|
--;;
|
||||||
|
drop table options cascade;
|
||||||
|
--;;
|
||||||
|
drop table visits cascade;
|
||||||
|
--;;
|
665
resources/migrations/20161014170335-basic-setup.up.sql
Normal file
665
resources/migrations/20161014170335-basic-setup.up.sql
Normal file
|
@ -0,0 +1,665 @@
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
----
|
||||||
|
---- 20161014170335-basic-setup.up.sql: database schema for youyesyet.
|
||||||
|
----
|
||||||
|
---- This program is free software; you can redistribute it and/or
|
||||||
|
---- modify it under the terms of the GNU General Public License
|
||||||
|
---- as published by the Free Software Foundation; either version 2
|
||||||
|
---- of the License, or (at your option) any later version.
|
||||||
|
----
|
||||||
|
---- This program is distributed in the hope that it will be useful,
|
||||||
|
---- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
---- GNU General Public License for more details.
|
||||||
|
----
|
||||||
|
---- You should have received a copy of the GNU General Public License
|
||||||
|
---- along with this program; if not, write to the Free Software
|
||||||
|
---- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
---- USA.
|
||||||
|
----
|
||||||
|
---- Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
----
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
----
|
||||||
|
---- NOTE
|
||||||
|
---- This file is essentially a Postgres schema dump of a database schema which was
|
||||||
|
---- created with the function initdb! in the file src/clj/youyesyet/db/schema.clj.
|
||||||
|
---- This file has then been mildly massaged to work with Migratus.
|
||||||
|
---- Either this file or src/clj/youyesyet/db/schema.clj is redundant; schema.clj
|
||||||
|
---- represents the older, Korma, way of doing things but does not readily allow
|
||||||
|
---- for migrations; this file represents the newer Migratus/HugSQL way. I'm not
|
||||||
|
---- certain which of these paths I'm going to go down.
|
||||||
|
----
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SET statement_timeout = 0;
|
||||||
|
--;;
|
||||||
|
SET lock_timeout = 0;
|
||||||
|
--;;
|
||||||
|
SET client_encoding = 'UTF8';
|
||||||
|
--;;
|
||||||
|
SET standard_conforming_strings = on;
|
||||||
|
--;;
|
||||||
|
SET check_function_bodies = false;
|
||||||
|
--;;
|
||||||
|
SET client_min_messages = warning;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
|
||||||
|
--
|
||||||
|
|
||||||
|
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
||||||
|
--;;
|
||||||
|
|
||||||
|
SET search_path = public, pg_catalog;
|
||||||
|
--;;
|
||||||
|
SET default_tablespace = '';
|
||||||
|
--;;
|
||||||
|
SET default_with_oids = false;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: addresses; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE addresses (
|
||||||
|
id integer NOT NULL,
|
||||||
|
address character varying(256) NOT NULL,
|
||||||
|
postcode character varying(16),
|
||||||
|
phone character varying(16),
|
||||||
|
district_id integer,
|
||||||
|
latitude real,
|
||||||
|
longitude real
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.addresses OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: addresses_id_seq; Type: SEQUENCE; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE addresses_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.addresses_id_seq OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: addresses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE addresses_id_seq OWNED BY addresses.id;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: authorities; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE authorities (
|
||||||
|
id character varying(32) NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.authorities OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: canvassers; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE canvassers (
|
||||||
|
id character varying(32) NOT NULL,
|
||||||
|
fullname character varying(64) NOT NULL,
|
||||||
|
elector_id integer,
|
||||||
|
address_id integer NOT NULL,
|
||||||
|
phone character varying(16),
|
||||||
|
email character varying(128),
|
||||||
|
authority_id character varying(32) NOT NULL,
|
||||||
|
authorised boolean
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.canvassers OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: districts; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE districts (
|
||||||
|
id integer NOT NULL,
|
||||||
|
name character varying(64) NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.districts OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: electors; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE electors (
|
||||||
|
id integer NOT NULL,
|
||||||
|
name character varying(64) NOT NULL,
|
||||||
|
address_id integer NOT NULL,
|
||||||
|
phone character varying(16),
|
||||||
|
email character varying(128)
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.electors OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: followupactions; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE followupactions (
|
||||||
|
id integer NOT NULL,
|
||||||
|
request_id integer NOT NULL,
|
||||||
|
actor character varying(32) NOT NULL,
|
||||||
|
date timestamp with time zone DEFAULT now() NOT NULL,
|
||||||
|
notes text,
|
||||||
|
closed boolean
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.followupactions OWNER TO youyesyet;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followupactions_id_seq; Type: SEQUENCE; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE followupactions_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.followupactions_id_seq OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: followupactions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE followupactions_id_seq OWNED BY followupactions.id;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followupmethods; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE followupmethods (
|
||||||
|
id character varying(32) NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.followupmethods OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
--
|
||||||
|
-- Name: followuprequests; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
insert into followupmethods values ('Telephone');
|
||||||
|
--;;
|
||||||
|
insert into followupmethods values ('eMail');
|
||||||
|
--;;
|
||||||
|
insert into followupmethods values ('Post');
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE followuprequests (
|
||||||
|
id integer NOT NULL,
|
||||||
|
elector_id integer NOT NULL,
|
||||||
|
visit_id integer NOT NULL,
|
||||||
|
issue_id character varying(32) NOT NULL,
|
||||||
|
method_id character varying(32) NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
ALTER TABLE public.followuprequests OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_id_seq; Type: SEQUENCE; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE followuprequests_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.followuprequests_id_seq OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE followuprequests_id_seq OWNED BY followuprequests.id;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: issueexpertise; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE issueexpertise (
|
||||||
|
canvasser_id character varying(32) NOT NULL,
|
||||||
|
issue_id character varying(32) NOT NULL,
|
||||||
|
method_id character varying(32) NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.issueexpertise OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: issues; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE issues (
|
||||||
|
id character varying(32) NOT NULL,
|
||||||
|
url character varying(256)
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.issues OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: options; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE options (
|
||||||
|
id character varying(32) NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.options OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE schema_migrations (
|
||||||
|
id bigint NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.schema_migrations OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: visits; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE visits (
|
||||||
|
id integer NOT NULL,
|
||||||
|
address_id integer NOT NULL,
|
||||||
|
canvasser_id character varying(32) NOT NULL,
|
||||||
|
date timestamp with time zone DEFAULT now() NOT NULL
|
||||||
|
);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.visits OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: visits_id_seq; Type: SEQUENCE; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE visits_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.visits_id_seq OWNER TO youyesyet;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: visits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE visits_id_seq OWNED BY visits.id;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY addresses ALTER COLUMN id SET DEFAULT nextval('addresses_id_seq'::regclass);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followupactions ALTER COLUMN id SET DEFAULT nextval('followupactions_id_seq'::regclass);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followuprequests ALTER COLUMN id SET DEFAULT nextval('followuprequests_id_seq'::regclass);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY visits ALTER COLUMN id SET DEFAULT nextval('visits_id_seq'::regclass);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: addresses_address_key; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY addresses
|
||||||
|
ADD CONSTRAINT addresses_address_key UNIQUE (address);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY addresses
|
||||||
|
ADD CONSTRAINT addresses_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: authorities_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY authorities
|
||||||
|
ADD CONSTRAINT authorities_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: canvassers_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY canvassers
|
||||||
|
ADD CONSTRAINT canvassers_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: districts_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY districts
|
||||||
|
ADD CONSTRAINT districts_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: electors_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY electors
|
||||||
|
ADD CONSTRAINT electors_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followupactions_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followupactions
|
||||||
|
ADD CONSTRAINT followupactions_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followupmethods_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followupmethods
|
||||||
|
ADD CONSTRAINT followupmethods_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followuprequests
|
||||||
|
ADD CONSTRAINT followuprequests_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY issues
|
||||||
|
ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: options_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY options
|
||||||
|
ADD CONSTRAINT options_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: schema_migrations_id_key; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY schema_migrations
|
||||||
|
ADD CONSTRAINT schema_migrations_id_key UNIQUE (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: visits_pkey; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY visits
|
||||||
|
ADD CONSTRAINT visits_pkey PRIMARY KEY (id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: addresses_district_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY addresses
|
||||||
|
ADD CONSTRAINT addresses_district_id_fkey FOREIGN KEY (district_id) REFERENCES districts(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: canvassers_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY canvassers
|
||||||
|
ADD CONSTRAINT canvassers_address_id_fkey FOREIGN KEY (address_id) REFERENCES addresses(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: canvassers_authority_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY canvassers
|
||||||
|
ADD CONSTRAINT canvassers_authority_id_fkey FOREIGN KEY (authority_id) REFERENCES authorities(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: canvassers_elector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY canvassers
|
||||||
|
ADD CONSTRAINT canvassers_elector_id_fkey FOREIGN KEY (elector_id) REFERENCES electors(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: electors_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY electors
|
||||||
|
ADD CONSTRAINT electors_address_id_fkey FOREIGN KEY (address_id) REFERENCES addresses(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followupactions_actor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followupactions
|
||||||
|
ADD CONSTRAINT followupactions_actor_fkey FOREIGN KEY (actor) REFERENCES canvassers(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followupactions_request_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followupactions
|
||||||
|
ADD CONSTRAINT followupactions_request_id_fkey FOREIGN KEY (request_id) REFERENCES followuprequests(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_elector_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followuprequests
|
||||||
|
ADD CONSTRAINT followuprequests_elector_id_fkey FOREIGN KEY (elector_id) REFERENCES electors(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followuprequests
|
||||||
|
ADD CONSTRAINT followuprequests_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followuprequests
|
||||||
|
ADD CONSTRAINT followuprequests_method_id_fkey FOREIGN KEY (method_id) REFERENCES followupmethods(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: followuprequests_visit_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY followuprequests
|
||||||
|
ADD CONSTRAINT followuprequests_visit_id_fkey FOREIGN KEY (visit_id) REFERENCES visits(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: issueexpertise_canvasser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY issueexpertise
|
||||||
|
ADD CONSTRAINT issueexpertise_canvasser_id_fkey FOREIGN KEY (canvasser_id) REFERENCES canvassers(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: issueexpertise_issue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY issueexpertise
|
||||||
|
ADD CONSTRAINT issueexpertise_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: issueexpertise_method_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY issueexpertise
|
||||||
|
ADD CONSTRAINT issueexpertise_method_id_fkey FOREIGN KEY (method_id) REFERENCES followupmethods(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: visits_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY visits
|
||||||
|
ADD CONSTRAINT visits_address_id_fkey FOREIGN KEY (address_id) REFERENCES addresses(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: visits_canvasser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: youyesyet
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY visits
|
||||||
|
ADD CONSTRAINT visits_canvasser_id_fkey FOREIGN KEY (canvasser_id) REFERENCES canvassers(id);
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: public; Type: ACL; Schema: -; Owner: postgres
|
||||||
|
--
|
||||||
|
|
||||||
|
REVOKE ALL ON SCHEMA public FROM PUBLIC;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
REVOKE ALL ON SCHEMA public FROM postgres;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
GRANT ALL ON SCHEMA public TO postgres;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
GRANT ALL ON SCHEMA public TO PUBLIC;
|
||||||
|
--;;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- PostgreSQL database dump complete
|
||||||
|
--
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Welcome to youyesyet</title>
|
<title>Welcome to YouYesYet</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card-deck">
|
<div class="card-deck">
|
||||||
<div class="card-block">
|
<div class="card-block">
|
||||||
<h4>Welcome to youyesyet</h4>
|
<h4>Welcome to YouYesYet</h4>
|
||||||
<p>If you're seeing this message, that means you haven't yet compiled your ClojureScript!</p>
|
<p>If you're seeing this message, that means you haven't yet compiled your ClojureScript!</p>
|
||||||
<p>Please run <code>lein figwheel</code> to start the ClojureScript compiler and reload the page.</p>
|
<p>Please run <code>lein figwheel</code> to start the ClojureScript compiler and reload the page.</p>
|
||||||
<h4>For better ClojureScript development experience in Chrome follow these steps:</h4>
|
<h4>For better ClojureScript development experience in Chrome follow these steps:</h4>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
;;;; USA.
|
;;;; USA.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Copyright (C) 2016 Simon Brooke
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
;;;;
|
;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
@ -30,8 +30,9 @@
|
||||||
;;; Note that this is the (old) Korma way of doing things;
|
;;; Note that this is the (old) Korma way of doing things;
|
||||||
;;; it may not play well with migrations, nor with the HugSQL way of doing things recommended
|
;;; it may not play well with migrations, nor with the HugSQL way of doing things recommended
|
||||||
;;; in Web Development with Clojure, Second Ed. So this may be temporary 'get us started' code,
|
;;; in Web Development with Clojure, Second Ed. So this may be temporary 'get us started' code,
|
||||||
;;; which later gets thrown away.
|
;;; which later gets thrown away. The 'create-x-table!' functions in this file may be
|
||||||
|
;;; redundant, and if they are the namespace probably needs to be renamed to 'entities'.
|
||||||
|
;;; See also resources/migrations/20161014170335-basic-setup.up.sql
|
||||||
|
|
||||||
(defn create-districts-table!
|
(defn create-districts-table!
|
||||||
"Create a table to hold the electoral districts in which electors are registered.
|
"Create a table to hold the electoral districts in which electors are registered.
|
||||||
|
|
37
src/cljs/youyesyet/views/building.cljs
Normal file
37
src/cljs/youyesyet/views/building.cljs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
(ns youyesyet.views.building
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.building: building view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the building view.
|
||||||
|
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the building panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/electors.cljs
Normal file
38
src/cljs/youyesyet/views/electors.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.electors
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.electors: electors view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the electors view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#electors-view
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the electors panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/followup_action.cljs
Normal file
38
src/cljs/youyesyet/views/followup_action.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.followup-action
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.followup-action: followup-action view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the followup-action view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#followup-action-view
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the followup-action panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/followup_request.cljs
Normal file
38
src/cljs/youyesyet/views/followup_request.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.followup-request
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.followup-request: followup-request view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the followup-request view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#followup-request-form
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the followup-request panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/followup_requests.cljs
Normal file
38
src/cljs/youyesyet/views/followup_requests.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.login
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.login: login view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the login view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#followup-requests-view
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the login panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/issues.cljs
Normal file
38
src/cljs/youyesyet/views/issues.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.issues
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.issues: issues view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the issues view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#issues-view
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the issues panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/login.cljs
Normal file
38
src/cljs/youyesyet/views/login.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.login
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.login: login view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the login view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#logging-in
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the login panel."
|
||||||
|
[]
|
||||||
|
[])
|
39
src/cljs/youyesyet/views/map.cljs
Normal file
39
src/cljs/youyesyet/views/map.cljs
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
(ns youyesyet.views.map
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.map: map view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the map view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#map-view
|
||||||
|
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the map panel."
|
||||||
|
[]
|
||||||
|
[])
|
39
src/cljs/youyesyet/views/role_menu.cljs
Normal file
39
src/cljs/youyesyet/views/role_menu.cljs
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
(ns youyesyet.views.role-menu
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.role-menu: role-menu view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the role-menu view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#after-login
|
||||||
|
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the role-menu panel."
|
||||||
|
[]
|
||||||
|
[])
|
38
src/cljs/youyesyet/views/signup.cljs
Normal file
38
src/cljs/youyesyet/views/signup.cljs
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
(ns youyesyet.views.signup
|
||||||
|
(:require [re-frame.core :refer [reg-sub]]))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;;
|
||||||
|
;;;; youyesyet.views.signup: signup view for youyesyet.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
;;;; as published by the Free Software Foundation; either version 2
|
||||||
|
;;;; of the License, or (at your option) any later version.
|
||||||
|
;;;;
|
||||||
|
;;;; This program is distributed in the hope that it will be useful,
|
||||||
|
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
;;;; GNU General Public License for more details.
|
||||||
|
;;;;
|
||||||
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
|
;;;; along with this program; if not, write to the Free Software
|
||||||
|
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
|
;;;; USA.
|
||||||
|
;;;;
|
||||||
|
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
|
||||||
|
;;;;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
;;; The pattern from the re-com demo (https://github.com/Day8/re-com) is to have
|
||||||
|
;;; one source file/namespace per view. Each namespace contains a function 'panel'
|
||||||
|
;;; whose output is an enlive-style specification of the view to be redered.
|
||||||
|
;;; I propose to follow this pattern. This file will (eventually) provide the signup view.
|
||||||
|
|
||||||
|
;;; See https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/userspec.md#creating-an-account
|
||||||
|
|
||||||
|
(defn panel
|
||||||
|
"Generate the signup panel."
|
||||||
|
[]
|
||||||
|
[])
|
Loading…
Reference in a new issue