Project Structure
Your folder structure should look like this:
GlobalDB/
│
├── frontend/
│ ├── src/
│ │ ├── App.tsx
│ │ └── index.tsx
│ ├── public/
│ ├── package.json
│ ├── ...
│ └── vite.config.js
│
├── backend/
│ ├── venv/
│ ├── app.py
│ ├── requirements.txt
└── README.md
cd GlobalDB
git clone https://github.com/yoonlee201/GlobalDB.git
Always create a new branch before making changes.
git pull origin master
git checkout -b <branch-name>
Examples:
git checkout -b yoonje/add-login
git checkout -b yoonje/navbar-responsive
After editing files, check what’s changed:
git status
Add your changes:
git add .
Then commit them with a clear message:
git commit -m "Add login page component"
Push your branch to the remote repository:
git push origin <branch-name>
💡 Example:
git push origin feature/add-login
Before pushing or merging, always pull updates from main to avoid conflicts:
git checkout master
git pull origin master
Then switch back to your branch and merge the latest main updates:
git checkout <branch-name>
git merge master
or
git checkout <branch-name>
git pull master
If there are conflicts, fix them manually, then commit again:
git add .
git commit -m "Resolve merge conflicts"
Once your feature is ready:
1. Go to your repository on GitHub
2. Click "Pull Request" Tab & "New pull request"
3. Add a title and description for your changes
4. Submit the pull request
Action Command
Clone repo git clone <url>
Create new branch git checkout -b <branch>
Switch branch git checkout <branch>
Add files git add .
Commit changes git commit -m "message"
Push branch git push origin <branch>
Pull latest main git pull origin main
Merge main into branch git merge main
Delete branch (local) git branch -d <branch>
Delete branch (remote) git push origin --delete <branch>
git clone https://github.com/yoonlee201/GlobalDB.git
git checkout -b <name>/<feature>
git add .
git commit -m "<message>"
git push origin <branch_name>
Before starting, ensure you have the following installed: - Node.js (version 16+ recommended) - npm (comes with Node.js)
Check versions:
node -v
npm -v
- Run Each App
cd frontend
npm run dev
Runs on: http://localhost:5173
- Updating Dependencies
npm install <package-name>
If you need a clean reinstall:
rm -rf node_modules package-lock.json
npm install
This guide explains how to set up and run the backend environment using Python and a virtual environment.
Install docker from this link: https://www.docker.com/101-tutorial/
If completed, turn on you docker everytime you want to run your backend locally
For Windows PowerShell:
cd backend
New-Item -ItemType File -Name ".env" -Force
Set-Content -Path ".env" -Value "SQLALCHEMY_DATABASE_URI=postgresql://globaldb:globaldb_dev_password@db:5432/globaldb"
cd ..For Unix/Linux/Mac:
cd backend
touch .env
echo SQLALCHEMY_DATABASE_URI=postgresql://globaldb:globaldb_dev_password@db:5432/globaldb > .env
cd ..Run this when:
- changes in .env
- error in backend
docker build -t globaldb-backend ./backend
docker cp ./data.sql pg-globaldb:/data.sql
docker exec -it pg-globaldb psql -U globaldb -f data.sql
docker cp ./db/init.sql pg-globaldb:/db/init.sql docker exec -it pg-globaldb psql -U globaldb -f db/init.sql
docker cp ./addData.sql pg-globaldb:/addData.sql
docker exec -it pg-globaldb psql -U globaldb -f addData.sql
docker compose -f compose.dev.yml up --build
docker compose -f compose.dev.yml watch backend frontend db