/everybodys-cat-butler

LIKELION X MJU Second Toy Project (2020.08.18~)

Primary LanguageJavaScript

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>.

:octocat: 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
  1. /backend: Backend Directory using "Django REST Framework"
    • /post : API둜 ν˜ΈμΆœμ‹œν‚¬ TEST APP
    • /reactapi : Django ν”„λ‘œμ νŠΈ 폴더
    • manage.py : Django command-line util
  2. /frontend: Frontend Directory using "React"
    • /public : 가상 DOM에 ν•„μš”ν•œ 폴더
    • /src : React 개발 메인 폴더
    • .gitignore : define what should be ignored in git
    • package.json : νŒ¨ν‚€μ§€ 및 버전 정보
    • README.md : React μ„€λͺ…μ„œ
    • yarn.lock : νŒ¨ν‚€μ§€ 잠금 파일
  3. .gitignore: define what should be ignored in git
  4. requirement.txt: list of pip-packages to install

πŸ“ License

This project uses the MIT License