Skip to content

Latest commit

 

History

History
141 lines (90 loc) · 3.7 KB

README.md

File metadata and controls

141 lines (90 loc) · 3.7 KB

Koodi101 Project Template

Forking and cloning the repository

Start by forking the repository

If you work in a group, only one person needs to fork the repository. The others need to be members of the repository. See collaborating with other users

Then clone the forked repository using SSH

git clone [email protected]:<user>/project-template.git

When you use SSH to clone a repository, you need a private key on your account which is authorized to pull (read) the repository.

Using SSH allows you to push (write) to the repository without providing you username and password! Handy, right?

Running the project

Start by going to the cloned repository in a terminal

cd project-template

Then build the docker images and start the services

docker-compose build
docker-compose up

Or with a single command

docker-compose up --build

Hit Ctrl+C to stop the processes

Optionally you can run the process in the background

Add -d to the docker-compose commands.

docker-compose build
docker-compose up -d

Or with a single command

docker-compose up --build -d

-d comes from the word detached

To see if the project is running

docker-compose ps

To stop the running background processes and remove the built images

docker-compose down --rmi all --remove-orphans

If the processes are not running docker-compose down also removes the containers and images

If you don't want to remove the images, you can just run

docker-compose down

Clearing the database

The database is stored in an anonymous volume which may be removed using

docker-compose down -v

For instance, if you edit the models, you need to remove the database volume 👆 for the changes to get applied

Running the project with only Node.js

Use this repository instead.

Collaborating

Only the owner of the forked repository in your group needs to add the collaborators

Collaboration is the heart of Open Source software development in GitHub.

After creating/forking a repository, owner may add collaborators to it alternatively in the GitHub repository page by clicking settings -> collaborators or by going to the web page by the following URL where <username> is replaced by a repository owner's username

Collaborators can clone the owner's repository using SSH and push changes to it.

https://github.com/<username>/project-template/settings/access

And, by searching usernames of other students (collaborators), owner can invite them as group members to allow them pushing (making changes) to the repository.

Upon inviting your group members, they will receive the invitation via email. Only after accepting the invitation are they given access to the repository.

Here is the help page with also images

Collaborating example

  • Niklash on is making changes to src/index.jsx, committing them and finally pushing them to GitHub.

computer1

Git commands used:

  • git add
  • git diff
  • git status
  • git commit -m "message"
  • git push
  • Severi is then pulling the changes and viewing them.

computer1

Git commands used:

  • git pull
  • git show