Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
1st draft. Removed vagrant. Added Docker info according to Step 9 from the intern documentation.
  • Loading branch information
jessewashburn authored Nov 15, 2024
1 parent b8168ad commit 4f0c755
Showing 1 changed file with 71 additions and 41 deletions.
112 changes: 71 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,94 +10,124 @@ Planet Learning is a generic learning system built in Angular & CouchDB.

Link to [Angular Doc](https://angular.io/docs) and [Material Design](https://material.angular.io/).

To work on this
## To work on this

The only prerequisite is Docker Desktop. After cloning the repository, follow the steps below to set up the development environment using Docker:

Create a directory for planet development data:
mkdir -p ~/srv/planetdev && cd ~/srv/planetdev
Create a directory for planet development data:
```
mkdir -p ~/srv/planetdev && cd ~/srv/planetdev
```

Download the Docker Compose file:
For Linux:
wget https://raw.githubusercontent.com/ole-vi/planet-prod-configs/main/planet-dev.yml
For macOS/Windows:
curl https://gist.githubusercontent.com/xyb994/0d14dfe302df0df0d4e8d8df0d1d5feb/raw/planet-dev-mac.yml -o planet-dev.yml
Download the Docker Compose file:
For Linux:
```
wget https://raw.githubusercontent.com/ole-vi/planet-prod-configs/main/planet-dev.yml
```

Start the containers:
docker compose -f planet-dev.yml -p planet-dev up -d
For macOS/Windows:
```
curl https://gist.githubusercontent.com/xyb994/0d14dfe302df0df0d4e8d8df0d1d5feb/raw/planet-dev-mac.yml -o planet-dev.yml
```

Verify container status:
Run docker ps -a after a minute. You should see two containers running: chatapi and couchdb. The db-init container should have exited.
Start the containers:
```
docker compose -f planet-dev.yml -p planet-dev up -d
```
Verify container status:
Run ```docker ps -a``` after a minute. You should see two containers running: chatapi and couchdb. The db-init container should have exited.

Configure CORS for CouchDB:
git clone https://github.com/pouchdb/add-cors-to-couchdb.git
Configure CORS for CouchDB:
```git clone https://github.com/pouchdb/add-cors-to-couchdb.git
cd add-cors-to-couchdb
npm install
while ! curl -X GET http://127.0.0.1:2200/_all_dbs ; do sleep 1; done
node bin.js http://localhost:2200

Clone and configure the Planet project:
```
Clone and configure the Planet project:
```
git clone https://github.com/open-learning-exchange/planet.git
cd planet
chmod +x couchdb-setup.sh
bash couchdb-setup.sh -p 2200 -i

Install dependencies and serve the app:
```
Install dependencies and serve the app:
```
npm install
ng serve
Visit localhost:3000 to access the Planet app.
If port 3000 is in use, try ng serve --port 3001.
```
Visit localhost:3000 to access the Planet app.
If port 3000 is in use, try ```ng serve --port 3001```

Project Guidelines
## Project Guidelines

Check out the project page for tasks.
Review the style guide.
Clone the repository to collaborate from a shared branch.
Run npm run install-hooks after cloning to add Git hooks.
Report issues, especially with specific frontend components.
Create a new branch with a descriptive name to work on issues.
Wait for two positive reviews before merging into master.
Check out the project page for tasks.
Review the style guide.
Clone the repository to collaborate from a shared branch.
Run npm run install-hooks after cloning to add Git hooks.
Report issues, especially with specific frontend components.
Create a new branch with a descriptive name to work on issues.
Wait for two positive reviews before merging into master.

Unit & End-to-End Tests
## Unit & End-to-End Tests

You can run tests directly from the host or within the development container.

Unit Tests:
Unit Tests:
```
npm run test

End-to-End Tests:
```
End-to-End Tests:
```
npm run e2e
````
Additional Commands

## Additional Commands
```
Run: ng serve
Build: ng build
Lint: ng lint
Fix Lint: ng lint --fix
```
To serve the app in a different language, use the LNG variable:
```
LNG=es npm start
Troubleshooting
I switched branches and now I'm missing a dependency...
```
## Troubleshooting
### I switched branches and now I'm missing a dependency...
Run the following command to reinstall dependencies:
```
npm install
```
If issues persist, delete and reinstall dependencies:
```
rm -rf node_modules/*
npm install
Missing database or authentication issues
````
### Missing database or authentication issues
Run the CouchDB setup script:
```
./v-couchdb-setup.sh -u <admin-username> -w <admin-password>
Cannot GET /
```
### Cannot GET /
Reinstall packages:
Reinstall packages:
```
rm -rf node_modules/*
rm package-lock.json
npm install
```
Restart the app:
Restart the app:
```
ng serve
```
This project is tested with BrowserStack.
This project is tested with [BrowserStack](https://www.browserstack.com/).

0 comments on commit 4f0c755

Please sign in to comment.