CSI-280 / MusicGames

0 stars 0 forks source link

Our first bit of code, introducing react and django #15

Closed A-Waters closed 4 years ago

A-Waters commented 4 years ago

Hello, after a few hours of work here is what we got. This should deal with issue #6

The project is broken down into 2 main sections The front end and the back end.

The front end is React. Specifically in the GUI folder is where you will find your basic react files. The back end is where we can find our python environment (env) and Django DB files (src).

The front side and backside should be able to run independently (I believe). The way the front end and back end interact is by using a package called "axios" and using GET methods to get access to the data. (e.g. the frontend/gui/src/components/list.js componentDidMount() method)

people will also have to install node.js (https://nodejs.org/en/) (LTS Perferably) (this will take a few minuets) if they are working with react.

Make sure to install the following packages. pip is for the backside of the website, npm is for the frontside of the website

pip install django djangorestframework virtualenv pep8 autopep8 pylint django-cors-headers
npm install axios

you should be able to start up the backside by running the command:

python backend\src\manage.py runserver

you should be able to run the frontside by running the commands:

cd .\frontend\gui
npm install
npm start

if you have any questions or errors starting up lmk. Someone should also update the read me with all this information. I put some in allready just to keep track of it but its not done nicely.

A-Waters commented 4 years ago

I just realized that the front side is missing node modules, working on workaround so we don't have to deal with it. LMK if you have any ideas. (resolved)

JakeCapra commented 4 years ago

With react, you have to locally install the modules. npm install I had the same issue on a previous assignment.

A-Waters commented 4 years ago

Thank you (updated initial comment)

lenora4321 commented 4 years ago

Is it just me, or is there no package.json file, which npm needs to start?

jbuzzell commented 4 years ago

@lenora4321 the package.json file is included in the npm install, you have to be in the directory you're running from when you run npm install axios

lenora4321 commented 4 years ago

For some reason it's in my frontend folder. Welp So where should I be installing this all from?

jbuzzell commented 4 years ago

@lenora4321 frontend/gui

lenora4321 commented 4 years ago

Oh yeah you're right nevermind. Thanks

A-Waters commented 4 years ago

Updated initial comment for more clarification. also when you guys give the thumbs up we will merge into master. I'm not an expert on Django or react. @lenora4321, as far as I know, you're the most experienced in this group with react(frontend/gui/) and @jbuzzell you probably (almost definitely) know the most about Django DB (backend/src/) so as long as you each know what's happening in those directories I think we are good to merge.

lenora4321 commented 4 years ago

Haha that's funny because I've never used react in my life.

A-Waters commented 4 years ago

Well then we're in new territory MB, Its all g. we should just figure out who really knows react then. Im iffy on it but I think its okay rn.

lenora4321 commented 4 years ago

Alright, so I've made it to the screen that says "check console". Is there something else I'm supposed to be checking in this code, because it works up to there. What's supposed to be in the console?

A-Waters commented 4 years ago

Nah if you got that far it looks good. In the console, if you have the backside running and you added some an article to the DB then you would see it there. But the front side is working and rn that's all that matters.

JakeCapra commented 4 years ago

Updated initial comment for more clarification. also when you guys give the thumbs up we will merge into master. I'm not an expert on Django or react. @lenora4321, as far as I know, you're the most experienced in this group with react(frontend/gui/) and @jbuzzell you probably (almost definitely) know the most about Django DB (backend/src/) so as long as you each know what's happening in those directories I think we are good to merge.

Nate and I used React in the last project.

A-Waters commented 4 years ago

Yeah, same but that is about my only experience with it. We can work it out I'm not worried.

JakeCapra commented 4 years ago

Yeah, we need to be more specific with the directions. Other than that it's good, nice work.