Skip to content
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

refactor: Automates the process of running development environment #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions dev-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

## Run docker Compose
sudo docker compose --env-file backend/.env up -d

## change directory to backend
cd backend

## Run migration
npm run migrate:dev
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dev script should just start the server and docker container at both frontend and backend.


## Seed the DB
npm run seed

## start the backend development server
npm run start:dev &

## change drectory to frontend
cd ../frontend

## start the frontend development server
npm run dev & gnome-terminal -- npm run dev
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here npm run dev is executed two times which cause the frontend server to start on both port 3000 and 3001.

15 changes: 15 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

## change directory to backend
cd backend

## install the backend dependencies
echo "installing backend dependencies..."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Setup script should do the following -

  • Installing dependencies
  • Starting docker container
  • Migrations and Seeding database

npm i

## change directory to frontend
cd ../frontend

## install the Frontend dependencies
echo "installing frontend dependencies..."
npm i