-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Yannx79/develop
Develop
- Loading branch information
Showing
13 changed files
with
345 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Archivos y directorios de sistema | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Archivos de Git | ||
.git | ||
.gitignore | ||
|
||
# Archivos de entorno de desarrollo | ||
.env | ||
.env.local | ||
.env.*.local | ||
|
||
# Archivos de configuración de IDEs y editores | ||
.vscode/ | ||
.idea/ | ||
*.sublime-project | ||
*.sublime-workspace | ||
|
||
# Archivos de compilación | ||
/dist/ | ||
/build/ | ||
/tmp/ | ||
/out/ | ||
|
||
# Directorios de logs | ||
*.log | ||
|
||
# Archivos de dependencias en Node.js | ||
node_modules/ | ||
|
||
# Archivos de dependencias en PHP | ||
/vendor/ | ||
|
||
# Archivos de dependencias en Python | ||
*.pyc | ||
*.pyo | ||
__pycache__/ | ||
|
||
# Archivos de Docker | ||
docker-compose.override.yml | ||
|
||
# Otros archivos no necesarios | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM eclipse-temurin:21.0.3_9-jdk AS Build | ||
|
||
WORKDIR /root | ||
|
||
COPY ./pom.xml /root | ||
COPY ./.mvn /root/.mvn | ||
COPY ./mvnw /root | ||
|
||
RUN chmod +x mvnw | ||
|
||
RUN ./mvnw dependency:go-offline | ||
|
||
COPY ./src /root/src | ||
|
||
RUN ./mvnw clean install -DskipTests | ||
|
||
FROM eclipse-temurin:21.0.3_9-jre AS Run | ||
|
||
WORKDIR /root | ||
EXPOSE 8080 | ||
COPY --from=build /root/target/Learning-Platform-Reactive-API-0.0.1-SNAPSHOT.jar /root/target/Learning-Platform-Reactive-API-0.0.1-SNAPSHOT.jar | ||
ENTRYPOINT ["java","-jar","/root/target/Learning-Platform-Reactive-API-0.0.1-SNAPSHOT.jar"] | ||
|
||
LABEL maintainer="https://www.linkedin.com/in/yannick-yasuhiro-funes-chavez/" | ||
LABEL version="0.0.1" | ||
LABEL description="This container runs Spring Boot with a custom configuration." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM eclipse-temurin:21.0.3_9-jdk AS Build | ||
|
||
WORKDIR /root | ||
|
||
COPY ./pom.xml /root | ||
COPY ./.mvn /root/.mvn | ||
COPY ./mvnw /root | ||
|
||
RUN chmod +x mvnw | ||
|
||
RUN ./mvnw dependency:go-offline | ||
|
||
COPY ./src /root/src | ||
|
||
RUN ./mvnw clean install -DskipTests | ||
|
||
FROM eclipse-temurin:21.0.3_9-jre AS Run | ||
|
||
WORKDIR /root | ||
EXPOSE 8080 | ||
COPY --from=build /root/target/Learning-Platform-Reactive-API-0.0.1-SNAPSHOT.jar /root/target/Learning-Platform-Reactive-API-0.0.1-SNAPSHOT.jar | ||
ENTRYPOINT ["java","-jar","/root/target/Learning-Platform-Reactive-API-0.0.1-SNAPSHOT.jar"] | ||
|
||
LABEL maintainer="https://www.linkedin.com/in/yannick-yasuhiro-funes-chavez/" | ||
LABEL version="0.0.1" | ||
LABEL description="This container runs Spring Boot with a custom configuration." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[mysqld] | ||
lower_case_table_names=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: "3.9" | ||
services: | ||
|
||
spring-api-image: | ||
# image: nk-learning-platform-reactive-api:latest | ||
# image: yan640/nk-learning-platform-reactive-api:lastest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.prod | ||
container_name: nk-learning-platform-reactive-api | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- .:/app | ||
networks: | ||
- spring-network | ||
depends_on: | ||
- mysql | ||
# environment: | ||
# - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/db_e_learning_platform | ||
# - SPRING_DATASOURCE_USERNAME=nk-yannick | ||
# - SPRING_DATASOURCE_PASSWORD=101010 | ||
# restart: on-failure | ||
|
||
mysql: | ||
image: mysql | ||
container_name: nk-mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 1234 | ||
MYSQL_DATABASE: db_e_learning_platform | ||
MYSQL_USER: nk-yannick | ||
MYSQL_PASSWORD: 101010 | ||
ports: | ||
- "3307:3306" | ||
networks: | ||
- spring-network | ||
volumes: | ||
- mysql-volume:/var/lib/mysql | ||
- ./config/mysql/my.cnf:/etc/mysql/conf.d/my.cnf | ||
- ./init-db-scripts:/docker-entrypoint-initdb.d | ||
restart: on-failure | ||
|
||
networks: | ||
spring-network: | ||
driver: bridge | ||
|
||
volumes: | ||
mysql-volume: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: "3.9" | ||
services: | ||
|
||
spring-api-image: | ||
# image: nk-learning-platform-reactive-api:latest | ||
image: yan640/nk-learning-platform-reactive-api:lastest | ||
# build: | ||
# context: . | ||
# dockerfile: Dockerfile.prod | ||
container_name: nk-learning-platform-reactive-api | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- .:/app | ||
networks: | ||
- spring-network | ||
depends_on: | ||
- mysql | ||
# environment: | ||
# - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/db_e_learning_platform | ||
# - SPRING_DATASOURCE_USERNAME=nk-yannick | ||
# - SPRING_DATASOURCE_PASSWORD=101010 | ||
# restart: on-failure | ||
|
||
mysql: | ||
image: mysql | ||
container_name: nk-mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 1234 | ||
MYSQL_DATABASE: db_e_learning_platform | ||
MYSQL_USER: nk-yannick | ||
MYSQL_PASSWORD: 101010 | ||
ports: | ||
- "3307:3306" | ||
networks: | ||
- spring-network | ||
volumes: | ||
- mysql-volume:/var/lib/mysql | ||
- ./config/mysql/my.cnf:/etc/mysql/conf.d/my.cnf | ||
- ./init-db-scripts:/docker-entrypoint-initdb.d | ||
restart: on-failure | ||
|
||
networks: | ||
spring-network: | ||
driver: bridge | ||
|
||
volumes: | ||
mysql-volume: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
-- Create the database | ||
CREATE DATABASE IF NOT EXISTS db_e_learning_platform; | ||
USE db_e_learning_platform; | ||
|
||
-- Create the Users table | ||
CREATE TABLE IF NOT EXISTS users ( | ||
UserID INT AUTO_INCREMENT PRIMARY KEY, | ||
FullName VARCHAR(100) NOT NULL, | ||
Email VARCHAR(100) NOT NULL UNIQUE, | ||
Password VARCHAR(255) NOT NULL, | ||
Role ENUM('Student', 'Instructor', 'Admin') NOT NULL, | ||
CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- Create the Courses table | ||
CREATE TABLE IF NOT EXISTS courses ( | ||
CourseID INT AUTO_INCREMENT PRIMARY KEY, | ||
Title VARCHAR(100) NOT NULL, | ||
Description TEXT, | ||
InstructorID INT NOT NULL, -- References Users.UserID but no foreign key | ||
CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- Create the Lessons table | ||
CREATE TABLE IF NOT EXISTS lessons ( | ||
LessonID INT AUTO_INCREMENT PRIMARY KEY, | ||
CourseID INT NOT NULL, -- References Courses.CourseID but no foreign key | ||
Title VARCHAR(100) NOT NULL, | ||
Content TEXT, | ||
VideoURL VARCHAR(255), | ||
CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- Create the Enrollments table | ||
CREATE TABLE IF NOT EXISTS enrollments ( | ||
EnrollmentID INT AUTO_INCREMENT PRIMARY KEY, | ||
UserID INT NOT NULL, -- References Users.UserID but no foreign key | ||
CourseID INT NOT NULL, -- References Courses.CourseID but no foreign key | ||
EnrolledAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- Create the Quizzes table | ||
CREATE TABLE IF NOT EXISTS quizzes ( | ||
QuizID INT AUTO_INCREMENT PRIMARY KEY, | ||
CourseID INT NOT NULL, -- References Courses.CourseID but no foreign key | ||
Title VARCHAR(100) NOT NULL, | ||
CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- Optional: Insert sample data | ||
INSERT INTO users (FullName, Email, Password, Role) VALUES | ||
('Alice Johnson', '[email protected]', 'password123', 'Instructor'), | ||
('Bob Smith', '[email protected]', 'password123', 'Student'); | ||
|
||
INSERT INTO courses (Title, Description, InstructorID) VALUES | ||
('Introduction to Python', 'Learn the basics of Python programming.', 1); | ||
|
||
INSERT INTO lessons (CourseID, Title, Content, VideoURL) VALUES | ||
(1, 'Lesson 1: Variables and Data Types', 'This lesson covers variables and data types.', 'https://example.com/video1'), | ||
(1, 'Lesson 2: Control Structures', 'This lesson covers loops and conditionals.', 'https://example.com/video2'); | ||
|
||
INSERT INTO enrollments (UserID, CourseID) VALUES | ||
(2, 1); | ||
|
||
INSERT INTO quizzes (CourseID, Title) VALUES | ||
(1, 'Quiz 1: Basic Python Concepts'); | ||
|
||
-- Additional inserts for Users table | ||
INSERT INTO users (FullName, Email, Password, Role) VALUES | ||
('Charlie Brown', '[email protected]', 'password123', 'Student'), | ||
('Diana Prince', '[email protected]', 'password123', 'Instructor'), | ||
('Ethan Hunt', '[email protected]', 'password123', 'Student'), | ||
('Fiona Gallagher', '[email protected]', 'password123', 'Admin'), | ||
('George Wilson', '[email protected]', 'password123', 'Instructor'); | ||
|
||
-- Additional inserts for Courses table | ||
INSERT INTO courses (Title, Description, InstructorID) VALUES | ||
('Advanced Python', 'A deeper dive into Python programming concepts.', 2), | ||
('Web Development Basics', 'Learn HTML, CSS, and JavaScript to build websites.', 5), | ||
('Data Science with Python', 'Learn data analysis and visualization with Python.', 1), | ||
('Introduction to Machine Learning', 'An introductory course on machine learning principles.', 2), | ||
('JavaScript for Beginners', 'Learn the fundamentals of JavaScript programming.', 5); | ||
|
||
-- Additional inserts for Lessons table | ||
INSERT INTO lessons (CourseID, Title, Content, VideoURL) VALUES | ||
(2, 'Lesson 1: Advanced Functions', 'Understand higher-order functions and decorators.', 'https://example.com/video3'), | ||
(3, 'Lesson 1: HTML Basics', 'Learn about HTML structure and tags.', 'https://example.com/video4'), | ||
(4, 'Lesson 1: Data Visualization', 'Introduction to Matplotlib and Seaborn.', 'https://example.com/video5'), | ||
(5, 'Lesson 1: Linear Regression', 'Basics of linear regression in machine learning.', 'https://example.com/video6'), | ||
(6, 'Lesson 1: Variables and Scopes', 'Learn about variable declaration and scoping in JavaScript.', 'https://example.com/video7'); | ||
|
||
-- Additional inserts for Enrollments table | ||
INSERT INTO enrollments (UserID, CourseID) VALUES | ||
(2, 2), | ||
(3, 3), | ||
(4, 4), | ||
(3, 5), | ||
(2, 6); | ||
|
||
-- Additional inserts for Quizzes table | ||
INSERT INTO quizzes (CourseID, Title) VALUES | ||
(2, 'Quiz 2: Python Advanced Topics'), | ||
(3, 'Quiz 1: HTML and CSS Basics'), | ||
(4, 'Quiz 1: Data Visualization Techniques'), | ||
(5, 'Quiz 1: Machine Learning Fundamentals'), | ||
(6, 'Quiz 1: JavaScript Variables and Functions'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.