diff --git a/README.md b/README.md index 472af217..af2c8f45 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,12 @@ Please ensure the following are installed on your system: ### Step-by-step guide -1. Clone the [project](https://github.com/COSC-499-W2023/year-long-project-team-3) -2. Follow the steps in: [AWS Authentication Credentials Setup](docs/guides/aws_authentication.md) -3. Project Setup - 1. Either: Set up the project on your machine: - - Follow the steps in: [Poll Worker Setup](docs/guides/poll_worker_setup.md) - - and: [Local Development Setup](docs/guides/local_development_setup.md) - 2. Or set it up using Docker: - - Follow the steps in: [Local Docker Development Setup](docs/guides/local_docker_development_setup.md) +1. Clone the [project](https://github.com/COSC-499-W2023/year-long-project-team-3) using Git +2. Obtain the two required environment files for local development by contacting one of the project devs: `./.env` and `./workers/poll-worker/.env` +3. Follow the steps in: [AWS Authentication Credentials Setup](docs/guides/aws_authentication.md) +4. Project Setup + - Follow the steps in: [Poll Worker Setup](docs/guides/poll_worker_setup.md) + - and: [Local Development Setup](docs/guides/local_development_setup.md) ### Tests diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 6f8dc08e..32b54e75 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -12,27 +12,6 @@ services: networks: - internal-dev - nextjs-app: - depends_on: - - db - build: - context: . - dockerfile: Dockerfile.dev - args: - - ARG_DATABASE_URL=$DATABASE_URL - - ARG_NEXTAUTH_URL=$NEXTAUTH_URL - container_name: docker-next - env_file: .env.docker.local - volumes: - - .:/app - ports: - - '3000:3000' - networks: - - internal-dev - links: - - db - restart: always - poll-worker: build: context: . diff --git a/docs/guides/aws_authentication.md b/docs/guides/aws_authentication.md index 7d1ce7c1..ad4eb43f 100644 --- a/docs/guides/aws_authentication.md +++ b/docs/guides/aws_authentication.md @@ -2,7 +2,6 @@ 1. Go to the [AWS console](https://ubc-cicsso.awsapps.com/start#/) 2. Click on your AWS account, and choose: `Access Keys` -3. Ensure the correct OS tab is selected at the top: The default is macOS and Linux -4. After selecting your OS, follow the instructions under: Option 1: Set AWS environment variables +3. Select Mac/Linux as your OS, copy the text for _Option 1: Set AWS environment variables_. The three keys copied from here (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,AWS_SESSION_TOKEN) need to be pasted into the two environment files without the "export". **Note**: This credential is temporary so there is a chance you have to repeat this while working. diff --git a/docs/guides/local_development_setup.md b/docs/guides/local_development_setup.md index 692e126c..5c485f6b 100644 --- a/docs/guides/local_development_setup.md +++ b/docs/guides/local_development_setup.md @@ -1,18 +1,16 @@ # Local Development Setup -1. Contact one of our devs to receive a link to the environment file and add it to the root directory: - 1. Make sure to replace the text highlighted in yellow inside this file with your AWS access key ID, AWS secret - access key, and AWS session token (from the [AWS console](https://ubc-cicsso.awsapps.com/start#/)) -2. From the root directory, install dependencies using: +1. Ensure that all environment files have already been added to the project. +2. From the root directory, install dependencies using (Node.js must be installed before doing this): ```bash npm install ``` -3. Make sure Docker Desktop is still running +3. Make sure Docker Desktop is running 4. Spin up the database using: ```bash docker-compose -f docker-compose.dev.yml up db -d ``` -5. Verify that the container _year-long-project-team-3-db-1_ is running in Docker Desktop +5. Verify that the container is running in Docker Desktop. If it fails it may be due to improperly configured or missing `.env` files. 6. Migrate the database using: ```bash npm run migrate @@ -22,4 +20,4 @@ npm run dev ``` -The project should now be fully set up and running on [port 3000](http://localhost:3000/). \ No newline at end of file +The project should now be fully set up and running on [port 3000](http://localhost:3000/). diff --git a/docs/guides/poll_worker_setup.md b/docs/guides/poll_worker_setup.md index 4e9475c1..adec87f3 100644 --- a/docs/guides/poll_worker_setup.md +++ b/docs/guides/poll_worker_setup.md @@ -1,17 +1,9 @@ # Poll Worker Setup -1. Contact one of our devs to receive a link to the environment file and add it to the _workers/poll-worker_ directory: - 1. Make sure to replace the text highlighted in yellow inside this file with your AWS access key ID, AWS secret - access key, and AWS session token (from the [AWS console](https://ubc-cicsso.awsapps.com/start#/)) -2. Navigate to the poll worker directory and install the required dependencies using: +1. Ensure that all environment files have already been added to the project. +2. Make sure Docker Desktop is running +3. From the root directory, start the poll worker using: ```bash - cd workers/poll-worker - npm install - ``` -3. Make sure Docker Desktop is running -4. Navigate to the root directory and start the poll worker using: - ```bash - cd ../.. docker-compose -f docker-compose.dev.yml up poll-worker -d ``` -5. Verify that the container docker-poll-worker is running in Docker Desktop +4. Verify that the container _docker-poll-worker_ is running in Docker Desktop