Requires:
- Python 3.5
- Flask
Use ‘pip -r requirements.txt’ Use virtualenv
- Add User curl: -L –data ‘username=username&email=email’ localhost:5000/user POST: /user {username, email}
- Get User curl: localhost:5000/user?username=username GET: /user {username} -> {username, email}
- Delete User: NotImplemented
- Update User: NotImplemented
create table `user` (
id int primary key auto_increment,
username varchar(20) unique not null,
email varchar(20) unique not null
);
create table likes(
user_id int,
tattoo_id int,
primary key(user_id, tattoo_id),
foreign key (user_id) references `user`(id) on delete cascade,
foreign key (tattoo_id) references tattoo(id) on delete cascade
);
create table follows(
follower_id int,
followed_id int,
primary key(follower_id, followed_id),
foreign key (`follower_id`) references `user`(id) on delete cascade,
foreign key (`followed_id`) references `user`(id) on delete cascade
);
- get liked/followed
- get public/private
- un/follow
- un/like
- ID, path, submitter, tags, visibility
- ?? Convert tags into a relation instead of a pipe separated list
contains(tattoo_id, tag_id);
create table tattoo(
id int primary key auto_increment,
owner_id int not null,
private boolean not null default true,
tags varchar(100),
path tinytext,
foreign key (owner_id) references `user`(id)
);
create table tag(
id int primary key auto_increment,
`desc` varchar(20) not null
);
- Create
- Delete
- set visible
- add tag