Skip to content
Open

Main, #184

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
50 changes: 12 additions & 38 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/postgres
{
"name": "Python 3 & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts"
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or the host.
"forwardPorts": [3000, 3001],

"onCreateCommand": "(cp .env.example .env || echo \".env creation failed\"); (pipenv install || echo \"pipenv install failed\"); (bash database.sh || echo \"database.sh failed\");",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "python docs/assets/greeting.py both > /workspaces/.codespaces/shared/first-run-notice.txt && npm install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"ms-python.autopep8"
]
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
"name": "autenticacion-abell",
"forwardPorts": [3000, 3001],
"portsAttributes": {
"3001": {
"label": "Backend (Flask)",
"onAutoForward": "openBrowser"
},
"3000": {
"label": "Frontend (Vite)",
"onAutoForward": "openBrowser"
}
}
}
19 changes: 7 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# This file includes global variables that will be available inside your project
# 1. In the front end code you can access this variables like this: console.log(import.meta.env.VARIABLE_NAME)
# 1. In the back end code you access the variable by importing os and then typing print(os.getenv('VARIABLE_NAME'))

# Back-End Variables
DATABASE_URL=postgres://gitpod:postgres@localhost:5432/example
FLASK_APP_KEY="any key works"
FLASK_APP=src/app.py
FLASK_APP=src.app
FLASK_DEBUG=1
DEBUG=TRUE
DEBUG=True
PORT=3001

JWT_SECRET_KEY=super-secret-key

# Front-End Variables
VITE_BASENAME=/
#VITE_BACKEND_URL=
VITE_BACKEND_URL=http://localhost:3001
VITE_FRONTEND_URL=http://localhost:3000
66 changes: 14 additions & 52 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,55 +1,34 @@
# ignore all files starting with .
.*

# track this file .gitignore (i.e. do NOT ignore it)
!.gitignore
!.github
php_errorlog
.log
# env
.env
.env.local

# do not ignore gitpod and render files
!.gitpod.Dockerfile
!.welcome
!.devcontainer
!.devcontainer/*
!Dockerfile.render
!.gitpod.yml
!render.yml
!.render-buildpacks.json
# frontend
node_modules/

# track webpack configs (i.e. do NOT ignore it)
!composer.json
!webpack.config.js
!package.json
!webpack.production.js
!webpack.development.js

# track readme.md in the root (i.e. do NOT ignore it)
!README.md
# python
__pycache__/
*.pyc
.pytest_cache/

# ignore OS generated files
# logs
*.log

# otros
ehthumbs.db
Thumbs.db

# ignore Editor files
*.sublime-project
*.sublime-workspace
*.komodoproject

# ignore log files and databases
*.log
*.sql
*.sqlite

# ignore compiled files
*.com
*.class
*.dll
*.exe
*.o
*.so

# ignore packaged files
*.7z
*.dmg
*.gz
Expand All @@ -58,25 +37,8 @@ Thumbs.db
*.rar
*.tar
*.zip

# ignore node/grunt dependency directories
node_modules/

# webpack output
dist/*
!public/
!public/*

# ignore the dist directory were our bundle files are going to be
!.gitkeep
!.htaccess
!.eslintrc
!.env.example
.now

# backend stuff
.venv
database.database
database.db
diagram.png
__pycache__/
# ignore compiled files
27 changes: 0 additions & 27 deletions .gitpod.Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions .gitpod.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
},
"[javascriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
},
"python-envs.defaultEnvManager": "ms-python.python:system",
"python-envs.pythonProjects": []
}
13 changes: 0 additions & 13 deletions Dockerfile.render

This file was deleted.

31 changes: 17 additions & 14 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,34 @@ verify_ssl = true
[dev-packages]

[packages]
flask = "*"
flask-sqlalchemy = "*"
flask-migrate = "*"
flask-swagger = "*"
psycopg2-binary = "*"
python-dotenv = "*"
flask-cors = "*"
gunicorn = "*"
cloudinary = "*"
flask-admin = "==2.0.0"
typing-extensions = "*"
flask-jwt-extended = "==4.6.0"
wtforms = "==3.1.2"
sqlalchemy = "*"
flask = "*"
flask-cors = "*"
flask-migrate = "*"
flask-sqlalchemy = "*"
pyjwt = "*"
werkzeug = "*"

[requires]
python_version = "3.13"
python_version = "3.11"

[scripts]
start="flask run -p 3001 -h 0.0.0.0"
init="flask db init"
migrate="flask db migrate"
local="heroku local"
upgrade="flask db upgrade"
downgrade="flask db downgrade"
insert-test-data="flask insert-test-data"
reset_db="bash ./docs/assets/reset_migrations.bash"
deploy="echo 'Please follow this 3 steps to deploy: https://github.com/4GeeksAcademy/flask-rest-hello/blob/master/README.md#deploy-your-website-to-heroku' "
start = "bash -lc 'PYTHONPATH=src FLASK_APP=src.app FLASK_DEBUG=1 bash ./bin/start.sh'"
prod = "bash -lc 'fuser -k 3001/tcp || true; sleep 0.5; PYTHONPATH=src gunicorn -w 2 -b 0.0.0.0:3001 src.app:app'"
init = "flask db init"
migrate = "flask db migrate"
local = "heroku local"
upgrade = "flask db upgrade"
downgrade = "flask db downgrade"
insert-test-data = "flask insert-test-data"
reset_db = "bash ./docs/assets/reset_migrations.bash"
deploy = "echo 'Please follow this 3 steps to deploy: https://github.com/4GeeksAcademy/flask-rest-hello/blob/master/README.md#deploy-your-website-to-heroku' "
Loading