diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index ad88952..0000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,58 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ $default-branch ] - pull_request: - branches: [ $default-branch ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - environment: Testing - strategy: - matrix: - node-version: [14.x , 16.x] - max-parallel: 1 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - with: - ref: 'main-test' - - - name: Install server npm packages - uses: bahmutov/npm-install@v1 - with: - working-directory: mern/server - - - name: Install client npm packages - uses: bahmutov/npm-install@v1 - with: - working-directory: mern/client - - - name: Start server in the background - env: - ATLAS_URI: ${{ secrets.ATLAS_URI }} - run: (cd mern/server && echo "ATLAS_URI=$ATLAS_URI" > config.env && npm start &) - - - name: Start React app in the background - run: (cd mern/client && npm start &) - - - name: Install Cypress and run tests - uses: cypress-io/github-action@v2 - with: - working-directory: mern/client - diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c672e5 --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# A simple MERN stack application + +**Note** - To run this project using `docker compose`, follow the below steps. + +Switch to the `compose` branch to learn the + +1. Implementation of `Dockerfile` for `client` and `server`. +2. Run the containers using `Docker Compose`. + +## Run it local without Docker + +### Prerequisite + +- Install `npm` + +#### Start Server: + +``` +cd mern/server +npm install +npm start +``` + +#### Start Client + +``` +cd mern/client +npm install +npm run dev +``` + +Screenshot 2024-08-31 at 11 07 58 PM diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index fecb786..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,38 +0,0 @@ -services: - backend: - build: ./mern/backend - ports: - - "5050:5050" - networks: - - mern_network - environment: - MONGO_URI: mongodb://mongo:27017/mydatabase - depends_on: - - mongodb - - frontend: - build: ./mern/frontend - ports: - - "5173:5173" - networks: - - mern_network - environment: - REACT_APP_API_URL: http://backend:5050 - - mongodb: - image: mongo:latest - ports: - - "27017:27017" - networks: - - mern_network - volumes: - - mongo-data:/data/db - -networks: - mern_network: - driver: bridge - -volumes: - mongo-data: - driver: local # Persist MongoDB data locally - diff --git a/mern/backend/Dockerfile b/mern/backend/Dockerfile index c6d703b..73de6b8 100644 --- a/mern/backend/Dockerfile +++ b/mern/backend/Dockerfile @@ -10,5 +10,4 @@ COPY . . EXPOSE 5050 -CMD ["npm", "start"] - +CMD [ "npm" , "start"] \ No newline at end of file