Skip to content
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

changement fichier database + style #66

Merged
merged 2 commits into from
Jan 9, 2024
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
22 changes: 14 additions & 8 deletions backend/database/database.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
CREATE DATABASE externatic_db;
CREATE DATABASE if not exists externatic_db;

-- Sélectionner la base de données
USE externatic_db;

DROP TABLE if exists user;
-- Créer la table "user"
CREATE TABLE
user (
Expand All @@ -18,14 +19,14 @@ CREATE TABLE
UNIQUE (email)
);

DROP table if exists competence;

CREATE TABLE
competence (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL
);

DROP table competence;

CREATE TABLE
user_competence (
user_id INT NOT NULL,
Expand All @@ -36,6 +37,8 @@ CREATE TABLE
UNIQUE (user_id, competence_id)
);

DROP TABLE if exists experience;

CREATE TABLE
experience (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Expand All @@ -44,11 +47,13 @@ CREATE TABLE
city VARCHAR(100) NOT NULL,
type VARCHAR(100) NOT NULL,
is_working BOOL,
date_begin DATE,
date_begin DATE NOT NULL,
date_end DATE,
description TEXT
);

DROP TABLE if exists course;

CREATE TABLE
course (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
Expand All @@ -60,9 +65,7 @@ CREATE TABLE
description TEXT
);

DROP TABLE offer;

DROP TABLE course;
DROP TABLE if exists offer;

CREATE TABLE
offer (
Expand Down Expand Up @@ -127,8 +130,10 @@ VALUES (
'html',
'1234',
1

);


DROP TABLE user;

INSERT INTO
Expand Down Expand Up @@ -174,4 +179,5 @@ VALUES (
L'opportunité de rejoindre le collectif Tech'Me UP (formations, conférences, veille, et bien plus encore…).
",
"[email protected]"
)
)

138 changes: 134 additions & 4 deletions backend/database/schema.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,134 @@
create table item (
id int unsigned primary key auto_increment not null,
title varchar(255) not null
);
CREATE DATABASE externatic_db;

-- Sélectionner la base de données
USE externatic_db;

-- Créer la table "user"
CREATE TABLE
user (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(100) NOT NULL,
lastname VARCHAR(100) NOT NULL,
phone VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
address VARCHAR(155) NOT NULL,
competence VARCHAR(100) NOT NULL,
password VARCHAR(100) NOT NULL,
is_admin BOOL NOT NULL,
UNIQUE (email)
);

CREATE TABLE
competence (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL
);

DROP table competence;

CREATE TABLE
user_competence (
user_id INT NOT NULL,
competence_id INT NOT NULL,
PRIMARY KEY (user_id, competence_id),
FOREIGN KEY (user_id) REFERENCES user(id),
FOREIGN KEY (competence_id) REFERENCES competence(id),
UNIQUE (user_id, competence_id)
);

CREATE TABLE
experience (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
company VARCHAR(100) NOT NULL,
city VARCHAR(100) NOT NULL,
type VARCHAR(100) NOT NULL,
is_working BOOL,
date_begin DATE NOT NULL DEFAULT NOW(),
date_end DATE,
description TEXT
);

DROP TABLE experience;

CREATE TABLE
course (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
level VARCHAR(100) NOT NULL,
domaine VARCHAR(100) NOT NULL,
name VARCHAR(100) NOT NULL,
date_begin DATE NOT NULL,
date_end DATE NOT NULL,
description TEXT
);

DROP TABLE offer;

DROP TABLE course;

CREATE TABLE
offer (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(100) NOT NULL,
company VARCHAR(100) NOT NULL,
type VARCHAR(100) NOT NULL,
city VARCHAR(100) NOT NULL,
mission VARCHAR(100) NOT NULL,
search_profile VARCHAR(100) NOT NULL,
work_place VARCHAR(100) NOT NULL,
salary VARCHAR(100) NOT NULL,
info TEXT NOT NULL,
email VARCHAR(100) NOT NULL
);

-- Insérer des données dans la table "user"
INSERT INTO
user (
firstname,
lastname,
phone,
email,
address,
competence,
password,
is_admin
)
VALUES (
'Frédérique',
'Druet',
'0473728392',
'[email protected]',
'46 boulevard Alfred Musset',
'HTML',
'1234',
0
), (
'Cassiopée',
'Laurie',
'0382938473',
'[email protected]',
'1 rue de la rue',
'html',
'1234',
0
), (
'Marie',
'Delaire',
'0638203818',
'[email protected]',
'1 rue de la rue',
'html',
'1234',
0
), (
'Nassime',
'Harmach',
'03748274827',
'[email protected]',
'1 rue de la rue',
'html',
'1234',
1
);

DROP TABLE user;
2 changes: 1 addition & 1 deletion backend/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fs = require("node:fs");
const path = require("node:path");

// Build the path to the schema SQL file
const schema = path.join(__dirname, "database", "schema.sql");
const schema = path.join(__dirname, "database", "database.sql");

// Get database connection details from .env file
const { DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME } = process.env;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ body {

.container-page {
margin: 0 auto;
padding-top: 30px;

padding-left: 18px;
padding-right: 18px;
max-width: 1280px;
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/Dashboards/title-dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,15 @@
.submit-btn-mini {
background-color: var(--second-color);
color: var(--text-btn);
padding: 18px 30px;
padding: 30px 0;
border: 0;
border-radius: 7px;
text-transform: uppercase;
font-weight: 500;
font-size: 10px;
width: 100%;
margin-top: -20px;
margin-left: 20px;
height: 40px;
align-items: center;
padding: 8px 8px;
}

.ref {
Expand Down
11 changes: 2 additions & 9 deletions frontend/src/components/NavBar/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
MDBNavbarBrand,
MDBCollapse,
} from "mdb-react-ui-kit";
import logo from "../../assets/ext-logo.png";
// import logo from "../../assets/ext-logo.png";

export default function Navbar() {
const [openNavColor, setOpenNavColor] = useState(false);
Expand All @@ -26,14 +26,7 @@ export default function Navbar() {
<MDBContainer fluid>
<MDBNavbarBrand href="#">
<span className="navbar-big-logo">
<img
className="navbar-logo-img"
src={logo}
alt="logo"
width="34"
height="34"
/>
<h4 className="navbar-logo-title">EXTERNATIX</h4>
<h4 className="navbar-logo-title">EXTERNATIC</h4>
</span>
</MDBNavbarBrand>
<MDBNavbarToggler
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/NavBar/navBar.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
border-radius: 5px;
}
.navbar-logo-title {
color: var(--third-title-color);
color: white;
font-size: 20px;
margin: 0 10px 0 5px;
display: none;
Expand All @@ -25,13 +25,15 @@
}
.navbar-link {
color: var(--third-title-color);
text-transform: uppercase;
color: white;
text-decoration: none;
letter-spacing: 0.15em;
font-size: 20px;
display: inline-block;
font-weight: 400;
padding: 10px 0;
margin: 0 20px;
position: relative;
transition: all 0.3s ease;
}
.navbar-link:after {
background: none repeat scroll 0 0 transparent;
Expand All @@ -55,9 +57,7 @@
left: 0;
}
.navbar-link:hover {
color: white;
text-align: center;
text-transform: uppercase;
transform: scale(0.9);
}
.active {
color: white;
Expand Down
Loading