#StackBounty: #java #mvc #database #spring Meme (title with picture) exchanger

Bounty: 150

Project structure without code:
project structure without code

Packages:

packages

Classes in packages:

first part
second part

In ConfigConstants I store path to folder, where I save pictures. Also in WebConstants I store URL of Servlet.
Here is mySQL script for creating db:

drop database meme_exchanger;
CREATE SCHEMA `meme_exchanger` DEFAULT CHARACTER SET utf8 ;

use meme_exchanger;

create table users(
    id int auto_increment primary key,
    name varchar(30) not null unique,
    password varchar(20) not null,
    access_level_id int references access_levels.id,
    creation_date date not null
);

create table users_banned(
    id int auto_increment primary key,
    user_id int references users.id,
    _from date not null,
    _to date not null,
    removed boolean default false,
    removed_date date default null
);

create table access_levels(
    id int auto_increment primary key,
    name varchar(20) not null
);

create table posts(
    id int auto_increment primary key,
    title varchar(100),
    user_id int references users.id,
    publish_date date not null,
    picture_name varchar(50) not null
);

create table posts_banned(
    id int auto_increment primary key,
    post_id int references posts.id,
    _from date not null,
    _to date not null,
    removed boolean default false,
    removed_date date default null
);

create table post_likes(
    id int auto_increment primary key,
    post_id int references posts.id,
    user_id int references users.id,
    date date not null
);

create table post_comments(
    id int auto_increment primary key,
    post_id int references posts.id,
    user_id int references users.id,
    text varchar(500) not null,
    date date not null
);

create table post_comments_banned(
    id int auto_increment primary key,
    comment_id int references post_comments.id,
    _from date not null,
    _to date not null,
    removed boolean default false,
    removed_date date default null
);


create table user_ip_adresses(
    id int auto_increment primary key,
    user_id int references users.id,
    name varchar(15)
);

create table user_id_adresses_banned(
    id int auto_increment primary key,
    ip_adress_id int references user_ip_addresses.id,
    _from date not null,
    _to date not null,
    removed boolean default false,
    removed_date date default null
);

and creating admin account:

insert into access_levels
(name)
VALUES
    ('CommonUser'),
    ('Admin');
    
insert into users
(name, password, access_level_id, creation_date)
VALUES
    ('root', '123321a', 2, curdate());

To see code on GitHub.

It is my first project on Spring MVC(used Tomcat 7.0) and I think I did many design and coding mistakes. Help me to find them, please.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.