Skip to content

Us 80 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 30, 2019
Merged

Us 80 #13

merged 8 commits into from
Oct 30, 2019

Conversation

JonathanJamesRasmussen
Copy link
Collaborator

Objective

Create initial React.js front-end application development environment.

Detailed Description

This change splits off the project into two separate sections in the root directory:

  1. client - The front-end React.js single-page application.
  2. API - The back-end Node.js/Express.js API (This folder contains the pre-existing project).

Screenshot (if applicable)

Screen Shot 2019-10-26 at 1 08 14 PM

How to Test (if applicable)

React environment

  1. Navigate to the client folder via a CLI
  2. run sudo npm install
  3. run sudo npm start
  4. Open localhost:8000 in a browser

Regression testing

  1. Navigate to the API folder via a CLI
  2. Run sudo ./iron.sh -i

This test is just to verify that the project builds after moved to a subfolder.

Tests (if added)

Requirements

Taiga User Story
Taiga Task 1
Taiga Task 2
Taiga Task 3

Copy link
Owner

@mjidris mjidris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to get the client or the API folder up & running. There maybe some step I'm missing on my end.

On the client side
When I run sudo npm install I'll get an output that looks like this:

npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

+ [email protected]
added 11 packages from 4 contributors, updated 3 packages and audited 905139 packages in 7.125s
found 0 vulnerabilities

On sudo npm start, I'll get something like this:

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "eslint": "^6.1.0"

I've tried deleting the package-lock file and the node modules folder and tried running sudo npm install but I'll still get that error. I've also tried sudo npm install eslintwith no luck.

On the API side
There seems to be something going on with postgress. After install and on launch, I'll get output looking like this:

Stopping previous containers
Removing network api_default
Remove dangling images and volumes if any exist

Starting containers detached
Creating network "api_default" with the default driver
Creating postgres ... error

ERROR: for postgres  Cannot create container for service pgdb: Conflict. The container name "/postgres" is already in use by container "b9dfebd635c2e71f83b37f7295aca4a288cb1a02c23dadbc8af811bfe0f8d319". You have to remove (or rename) that container to be able to reuse that name.

ERROR: for pgdb  Cannot create container for service pgdb: Conflict. The container name "/postgres" is already in use by container "b9dfebd635c2e71f83b37f7295aca4a288cb1a02c23dadbc8af811bfe0f8d319". You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.

I've ensured that there are no docker containers running, I've even restarted docker.

I feel like all of these are maybe steps I'm missing on my end, but I'm not quite sure how to over come them. 🤷‍♂

@mjidris
Copy link
Owner

mjidris commented Oct 27, 2019

@JonathanJamesRasmussen See updated comment ☝️

@JonathanJamesRasmussen
Copy link
Collaborator Author

@mjidris Thanks for the detailed review! On the API side, try running docker system prune after all of your containers are stopped. I ran into this previously and discovered that the Postgres container was still around after stopping it, which prevented a new one from being created.

@JonathanJamesRasmussen
Copy link
Collaborator Author

As for the client side, do you have eslint installed globally?

@JonathanJamesRasmussen
Copy link
Collaborator Author

Looking through this right now:
facebook/create-react-app#5247

@JonathanJamesRasmussen
Copy link
Collaborator Author

I may have found a fix for the client issue. Pushing up a change in a minute.

@JonathanJamesRasmussen
Copy link
Collaborator Author

@mjidris Go ahead and try pulling down this branch again.

@mjidris
Copy link
Owner

mjidris commented Oct 27, 2019

@JonathanJamesRasmussen 👍 Will try the API/Client again.

@mjidris
Copy link
Owner

mjidris commented Oct 27, 2019

So just to update, with that last change, the client portion worked for me with the instructions.

On the API side, even after multiple docker container prune + docker system prune commands + reinstalling the iron.sh script, on launch, I keep getting the postgress error.

I'd love for someone else to give this a try to see if this is an issue specific to my local environment. I know it probably works on @JonathanJamesRasmussen setup, but I'm having trouble identifying the specific issue causing this.

@JonathanJamesRasmussen
Copy link
Collaborator Author

@mjidris Awesome on the client-side! Can you run Docker ps -a and see what the output is?

@mjidris
Copy link
Owner

mjidris commented Oct 27, 2019

I'm getting

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                 PORTS                    NAMES
b9dfebd635c2        irondb_pgdb         "docker-entrypoint.s…"   20 hours ago        Up 2 hours (healthy)   0.0.0.0:5433->5432/tcp   postgres

@JonathanJamesRasmussen
Copy link
Collaborator Author

JonathanJamesRasmussen commented Oct 27, 2019

Try docker stop b9dfebd635c2 and then docker rm b9dfebd635c2. After that, try the install again.

We may have a bug in the ./iron.sh -s utility that isn't properly stopping the postgres container.

@mjidris
Copy link
Owner

mjidris commented Oct 29, 2019

Thanks @JonathanJamesRasmussen! That resolved the issue for me. I was able to get the website up and running with .iron.sh -l. Had some weirdness with the buggy layout probably due to missing some packages.

Screen Shot 2019-10-29 at 3 41 36 PM

Copy link
Collaborator

@JeffFallis JeffFallis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client
Followed instructions, and while I had issues at first, after I updated to the most recent version of nodejs, I was able to get the react app up and running

API
Followed the instructions and troubleshooting comments and successfully got the two api containers to run correctly

@JonathanJamesRasmussen JonathanJamesRasmussen merged commit ee9aa77 into react-migration Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants