EverybodysCatButler
π Introduction
This project is a site for posting road cats locations by users.
π Getting started
1. git clone
First of all, clone this repository
$ git clone https://github.com/likelionmju/EverybodysCatButler.git
2. create virtual environment
Second, prepare a virtual environment with the django and several packages
$ python -m venv venv
The name of virtual environment is defined by "venv"
3. activate virtual environment
$ source venv/scripts/activate # for windows
$ source venv/bin/activate # for mac or linux
4. install pip packages
$ pip install -r requirements.txt
The required packages are defined in the requirements.txt file.
$ pip freeze > requirements.txt
If additional packages are installed, the following commands should be executed.
5. change git branch
first time, you must change master branch to other branch
$ git checkout <branch_name> # backend or frontend
Insert 'backend' or 'frontend' instead of <branch_name>.
Git command
$ git pull origin <branch_name>
$ git add .
$ git commit -m "messages"
$ git push origin <branch_name>
Insert 'backend' or 'frontend' instead of <branch_name>.
6. Run Localhost Server
Reactμ Djnago REST Frameworkλ₯Ό λμμ μΌμΌ νλ―λ‘ ν°λ―Έλμ μ€νλ¦Ώ ν΄μ€λ€. (Ctrl+Shift+5)
$ cd frontend # νλ‘ νΈμλ ν΄λλ‘ μ΄λ
$ npm start # React μλ² μλ (localhost:3000)
Reactλ₯Ό μμνκΈ° μ μ λ°λμ npmμ μ€μΉν΄μΌ νλ€. μ€μΉ νμλ μ¬λΆν μ΄ νμνλ€. μ€μΉλ°©λ²
$ cd backend # λ°±μλ ν΄λλ‘ μ΄λ
$ python manage.py runserver # Djnaog REST Framework μλ (localhost:8000)
μ΄λ€ κ²μ λ¨Όμ ν€λ μκ΄ μλ€. λ¨, λ μ€μ νλλΌλ μΌμ§ μμΌλ©΄ νμ΄μ§κ° 보μ΄μ§ μλλ€.
π§ What's inside?
.
βββ backend
β βββ post
β βββ reactapi
β βββ manage.py
β
βββ frontend
β βββ public
β βββ src
β βββ .gitignore
β βββ package.json
β βββ README.md
β βββ yarn.lock
β
βββ .gitignore
βββ README.md
βββ requirements.txt
/backend
: Backend Directory using "Django REST Framework"/post
: APIλ‘ νΈμΆμν¬ TEST APP/reactapi
: Django νλ‘μ νΈ ν΄λmanage.py
: Django command-line util
/frontend
: Frontend Directory using "React"/public
: κ°μ DOMμ νμν ν΄λ/src
: React κ°λ° λ©μΈ ν΄λ.gitignore
: define what should be ignored in gitpackage.json
: ν¨ν€μ§ λ° λ²μ μ 보README.md
: React μ€λͺ μyarn.lock
: ν¨ν€μ§ μ κΈ νμΌ
.gitignore
: define what should be ignored in gitrequirement.txt
: list of pip-packages to install
π License
This project uses the MIT License