-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
106 additions
and
35 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 |
---|---|---|
@@ -1,10 +1,35 @@ | ||
# CV Management System API | ||
### CV Management System API | ||
|
||
This project provides a platform for managing user data and generating custom CV templates. | ||
|
||
## Directory structure Hierarchy | ||
|
||
### Table of contents | ||
1. [Directory structure Hierarchy](#directory-structure-hierarchy) | ||
2. [Components](#components) | ||
3. [Prerequisites](#prerequisites) | ||
4. [Environment variables file .env file](#environment-variables-file-env-file) | ||
5. [Install Basic Tools](#install-basic-tools) | ||
6. [Replace Paths](#replace-paths) | ||
7. [Create DB, users table](#create-db-users-table) | ||
8. [Verify successful import](#verify-successful-import) | ||
9. [Change DB user password](#change-db-user-password) | ||
10. [Build the backend API](#build-the-backend-api) | ||
11. [BFF Flask app setup frontend](#bff-flask-app-setup-frontend) | ||
12. [SSH conection](#ssh-conection) | ||
13. [Github commit](#github-commit) | ||
14. [Start the project](#start-the-project-makefile) | ||
15. [Docker](#docker) | ||
16. [Browser links](#browser-links) | ||
|
||
|
||
### Directory structure Hierarchy | ||
```sh | ||
CV_project | ||
βββ .github # GitHub configuration directory | ||
β βββ workflows # GitHub Actions workflows | ||
β βββ integration-tests.yml # Workflow for integration tests | ||
β βββ unit-tests.yml # Workflow for unit tests | ||
β βββ venom-tests.yml # Workflow for venom tests | ||
βββ api # Go API - backend | ||
β βββ CV_project # Executable file ... (cd $PathCvProject/api && go build -o CV_project main.go) | ||
β βββ example.pdf # Sample PDF | ||
|
@@ -29,36 +54,30 @@ CV_project | |
β β βββ template2.html # CV template 2 | ||
β β βββ template3.html # CV template 3 | ||
β βββ users.js # JavaScript - user-related functionality | ||
βββ db.cnf # Database configuration | ||
βββ docker-compose.yml # Docker Compose configuration | ||
βββ .env # Environment variables file | ||
βββ .gitignore # Git ignore - version control | ||
βββ .github # GitHub configuration directory | ||
β βββ workflows # GitHub Actions workflows | ||
β βββ integration-tests.yml # Workflow for integration tests | ||
β βββ unit-tests.yml # Workflow for unit tests | ||
β βββ venom-tests.yml # Workflow for venom tests | ||
βββ Makefile # Building and running | ||
βββ README.md # Project documentation | ||
βββ sql # SQL files - database schema | ||
β βββ db.cnf # Database configuration | ||
β βββ Dockerfile # Dockerfile - sql | ||
β βββ mysql.pid # MySQL process ID file | ||
β βββ schemadump.sql # Schema creation and sample data | ||
β βββ schema.sql # Schema creation only | ||
βββ src # Source code | ||
βββ __init__.py # Initialization and configuration | ||
βββ src # Source code | ||
β βββ __init__.py # Initialization and configuration | ||
βββ .env # Environment variables file | ||
βββ .gitignore # Git ignore - version control | ||
βββ Makefile # Building and running | ||
βββ README.md # Project documentation | ||
βββ docker-compose.yml # Docker Compose configuration | ||
``` | ||
|
||
## Components: | ||
### Components: | ||
|
||
Backend (Go) : HandlMYSQL_ | ||
Backend (Go) : Handles user data management, authentication, and PDF generation. | ||
Frontend (Python,Flask) : Provides the web interface for user interaction. | ||
Database (SQL) : Stores user information. | ||
|
||
MYSQL_s user data management, authentication, and PDF generation. | ||
Frontend (Python,Flask) : Provides the web interface for user interaction. | ||
Database (SQL) : Stores user information. | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
## Prerequisites: | ||
### Prerequisites: | ||
|
||
- `Go `: _Backend development_ | ||
- `Flask `: _Frontend development_ | ||
|
@@ -68,7 +87,11 @@ Database (SQL) : Stores user information. | |
- `Docker & Docker Compose `: _Containerized deployment_ | ||
|
||
|
||
## Environment variables file: .env file | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Environment variables file: .env file | ||
|
||
```sh | ||
MYSQL_ROOT_PASSWORD=*** | ||
|
@@ -81,22 +104,34 @@ MYSQL_DATABASE=users | |
MYSQL_PORT=3306 | ||
``` | ||
|
||
## Install Basic Tools: | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Install Basic Tools: | ||
|
||
```sh | ||
sudo apt update && sudo apt upgrade && sudo apt install -y git curl build-essential golang-go python3 python3-pip wkhtmltopdf docker.io docker-compose selinux-utils curl mysql-server | ||
sudo mysql_secure_installation | ||
pip install --break-system-packages Flask Flask-Bcrypt Flask-Migrate Flask-SQLAlchemy | ||
``` | ||
|
||
## Replace Paths | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Replace Paths | ||
|
||
```sh | ||
PathCvProject="/bcn/github/CV_project" | ||
grep -q "PathCvProject=" ~/.bashrc || echo "export PathCvProject=\"$PathCvProject\" # Set path to CV project." >> ~/.bashrc && source ~/.bashrc | ||
``` | ||
|
||
## Create DB, users table | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Create DB, users table | ||
|
||
```sh | ||
sudo mysql -u root -p | ||
|
@@ -105,7 +140,11 @@ USE users; | |
SOURCE /bcn/github/CV_project/sql/schemadump.sql; | ||
``` | ||
|
||
## Verify successful import | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Verify successful import | ||
|
||
```sh | ||
mysql -u root -p users | ||
|
@@ -118,13 +157,21 @@ SELECT * FROM template; | |
SELECT * FROM users; | ||
``` | ||
|
||
## Change DB user password | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Change DB user password | ||
|
||
```sh | ||
ALTER USER 'CV_user'@'localhost' IDENTIFIED BY 'Y0ur_strong_password'; | ||
``` | ||
|
||
## Build the backend API | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Build the backend API | ||
|
||
```sh | ||
cd $PathCvProject/api | ||
|
@@ -135,15 +182,23 @@ export DB_PASSWORD="?????????????" | |
./CV_project | ||
``` | ||
|
||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
## BFF Flask app setup frontend | ||
|
||
```sh | ||
cd $PathCvProject/bff | ||
python3 app.py -i 127.0.0.1 -p 8080 | ||
``` | ||
|
||
# Github | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
|
||
## Github | ||
### SSH conection | ||
|
||
```sh | ||
|
@@ -158,7 +213,11 @@ git config --global http.sslBackend "openssl" | |
ssh -T [email protected] | ||
``` | ||
|
||
### Commit & pull-push, avoid conflicts | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Github commit | ||
|
||
```sh | ||
echo "Enter commit message (Title case, infinitive verb, brief and clear summary of changes):" | ||
|
@@ -169,7 +228,11 @@ git commit -m "$CommitMssg" | |
git pull && git push origin main | ||
``` | ||
|
||
## Start the project: Makefile | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Start the project: Makefile | ||
|
||
```sh | ||
cd $PathCvProject | ||
|
@@ -178,7 +241,11 @@ make # Build and start the services | |
make docker # # Start services using Docker Compose | ||
``` | ||
|
||
## Docker | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Docker | ||
|
||
```sh | ||
docker-compose build # build | ||
|
@@ -190,7 +257,11 @@ docker-compose ps # view running containers | |
docker-compose rm # removes stopped service containers | ||
``` | ||
|
||
## Browser links | ||
<div align="right"> | ||
<b><a href="#table-of-contents">π</a></b> | ||
</div> | ||
|
||
### Browser links | ||
|
||
https://miro.com/app/board/uXjVK6HA_1A=/ | ||
|
||
|