Skip to content

Spaces #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
POSTGRES_DB: bdio
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
restart: always

backend:
Expand Down
23 changes: 23 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use an official Node.js runtime as the base image
FROM node:16 as build

WORKDIR /app

COPY package*.json ./

RUN npm install -g @angular/cli

RUN npm install

COPY . .

RUN ng build

FROM nginx:alpine

COPY --from=build /app/dist/frontend /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

31 changes: 29 additions & 2 deletions init.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CREATE TABLE Url_Addresses(
url_id serial primary key,
url_address varchar(200) UNIQUE
);
--Table Account_type
CREATE TABLE Account_Type(
account_type_id SERIAL PRIMARY KEY,
Expand All @@ -19,12 +23,22 @@ CREATE TABLE Accounts(
url_activation VARCHAR(100),
FOREIGN KEY (account_type_id) REFERENCES Account_type(account_type_id)
);
-- --Table Category
--Table Category
CREATE TABLE Category(
category_id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE
);

CREATE TABLE Spaces(
space_id SERIAL PRIMARY KEY,
space_creator_id INT,
title VARCHAR(40),
modification_date TIMESTAMP NOT NULL,
url_address_id Int,
FOREIGN key(space_creator_id) REFERENCES accounts(account_id),
FOREIGN key(url_address_id) REFERENCES url_addresses(url_id)
);

--Table Notes
CREATE TABLE Notes(
note_id SERIAL PRIMARY KEY,
Expand All @@ -34,12 +48,25 @@ CREATE TABLE Notes(
category_id INT,
account_id INT,
modification_date TIMESTAMP NOT NULL,
url_address VARCHAR(100) UNIQUE NOT NULL,
favorite BOOLEAN NOT NULL DEFAULT FALSE,
url_address_id int,
space_id int,
FOREIGN KEY (space_id) REFERENCES Spaces(space_id),
FOREIGN KEY (category_id) REFERENCES category(category_id),
FOREIGN key (url_address_id) REFERENCES url_addresses(url_id),
FOREIGN KEY (account_id) REFERENCES accounts(account_id)
);


CREATE TABLE Space_accesses(
access_id serial primary key,
space_id int,
account_id int,
read BOOLEAN NOT NULL,
write BOOLEAN NOT NULL,
FOREIGN KEY(space_id) REFERENCES Spaces(space_id),
FOREIGN KEY(account_id) REFERENCES Accounts(account_id)
);
CREATE SEQUENCE confirmation_token_seq;
CREATE TABLE Confirmation_token(
id INTEGER NOT NULL DEFAULT nextval('confirmation_token_seq'),
Expand Down
12 changes: 0 additions & 12 deletions server/src/main/java/Projektbdio/Requests/UserRequest.java

This file was deleted.

24 changes: 0 additions & 24 deletions server/src/main/java/Projektbdio/model/Confirmation_token.java

This file was deleted.

77 changes: 0 additions & 77 deletions server/src/main/java/Projektbdio/service/AccountsService.java

This file was deleted.

159 changes: 0 additions & 159 deletions server/src/main/java/Projektbdio/service/AdminService.java

This file was deleted.

Loading