Git Product home page Git Product logo

course-dragon's Introduction

About course-dragon

CourseDragon is a MERN REST app. To start it, it is broken into 3 Parts:

  • Frontend (React)
  • Backend (Node/Express)
  • Database (Mongo)

Setup (before running)

First, install Node (you mayneed to instal brew first, if you are on a mac)

brew install node

To setup, you must install node_modules by doing the following:

cd root/backend
npm install
cd root/frontend
npm install

How to run

There are 2 methods to running the application:

  1. Docker start
  2. Manual start

-Docker start-

Preconditions
1. Docker Desktop is installed and is running
  • For Docker start, run the following commands (this is the docker-compose method):
cd root
docker-compose up --build

To test that it has started correctly, you can do the following:

Client Server Database
- Connect to http://localhost:3000/Senior-Design-Capstone Run the command curl localhost:4001 Run the command curl localhost:27017
This should connect to the frontend webpage for Course Dragon This should respond back with the message "home get greeting" This should respond back with the message "It looks like you are trying to access MongoDB over HTTP on the native driver port."

Alternate Docker start method:

  • For Docker start, run the following commands (this is the docker run method):

  • List all docker images

docker image ls
  • Docker build each of the images (frontend-image and backend-image)(mongo image does not need to be created, as it is a standard image)
cd root/frontend
docker build -t course-dragon-frontend-image .
cd root/backend
docker build -t course-dragon-backend-image .
  • Docker run
docker run --name course-dragon-backend-app -d -p 4001:4001 -v $(pwd):/server course-dragon-backend-image
docker run --name db -d -p 27017:27017 mongo
docker run --name course-dragon-frontend-app -d -p 3000:3000 -v $(pwd)/public:/client/public -v $(pwd)/src:/client/src -v $(pwd)/deploy.sh:/client/deploy.sh -v $(pwd)/index.html:/client/index.html -v $(pwd)/react.vite.config.js:/client/react.vite.config.js -v $(pwd)/vite.config.js:/client/vite.config.js -dit course-dragon-frontend-image
  • See all running docker containers
docker ps -a
  • Send commands to docker container (in bash)
docker exec -it course-dragon-backend-app bash
docker exec -it course-dragon-frontend-app bash
  • Close the docker container
docker rm course-dragon-backend-app -f
docker rm course-dragon-frontend-app -f
docker rm mongo-db -f

-Manual start-

Starting the Frontend (React):

cd root/frontend

npm install

npm start

Connect to the Website on https://localhost:3000

Starting the Backend (Node/Express):

cd root/backend

npm install

npm start

Make sure that it's working: curl localhost:4001 If result looks like this then it is working:

(base) username@your-computer ~ % curl localhost:4001
home get greeting%

Starting the Database (Mongo):

Install MongoDB

Create a directory /data/db

Run MongoDB using this command

mongod --port 27017 --dbpath /Users/sebastianbarry/data/db

Make sure that it's working: curl localhost:27017 If result looks like this then it is working:

(base) username@your-computer ~ % curl localhost:27017
It looks like you are trying to access MongoDB over HTTP on the native driver port.

course-dragon's People

Contributors

sebastianbarry avatar kevinhawekotte avatar matthewteets avatar sherpa2025 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.