|
| 1 | +(dev-setup)= |
| 2 | + |
| 3 | +# Setting up a development environment |
| 4 | + |
| 5 | +To begin with, you will need to have [git](https://git-scm.com/) installed on your computer. |
| 6 | +You will also need a GitHub account. |
| 7 | + |
| 8 | +First, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository) |
| 9 | +tin. Then you can clone tin onto your computer with |
| 10 | + |
| 11 | +```bash |
| 12 | +git clone https://github.com/YOUR_GITHUB_USERNAME/tin |
| 13 | +``` |
| 14 | + |
| 15 | +From here, you can either use a local setup, or use Docker. Check out the |
| 16 | +relevant sections. |
| 17 | + |
| 18 | +## Docker |
| 19 | + |
| 20 | +If you prefer, you can run the development setup with [Docker](https://www.docker.com/). To do so, |
| 21 | +`cd` into the project directory and run: |
| 22 | + |
| 23 | +``` |
| 24 | +docker compose build |
| 25 | +docker compose up |
| 26 | +``` |
| 27 | + |
| 28 | +To create testing users and apply migrations, run the below command in a separate terminal: |
| 29 | + |
| 30 | +``` |
| 31 | +./scripts/docker_setup.sh |
| 32 | +``` |
| 33 | + |
| 34 | +## Local Setup |
| 35 | + |
| 36 | +To set up your environment locally, you will need to install the following: |
| 37 | + |
| 38 | +- [python](https://www.python.org/downloads/) (3.11) |
| 39 | +- [uv](https://docs.astral.sh/uv/) |
| 40 | + |
| 41 | +Then, run these commands: |
| 42 | + |
| 43 | +``` |
| 44 | +uv run manage.py migrate |
| 45 | +uv run manage.py create_debug_users |
| 46 | +``` |
| 47 | + |
| 48 | +Now you're all set! Try running the development server |
| 49 | + |
| 50 | +```bash |
| 51 | +uv run manage.py runserver |
| 52 | +``` |
| 53 | + |
| 54 | +Head on over to [http://127.0.0.1:8000](http://127.0.0.1:8000), and login |
| 55 | +as `admin` and the password you just entered. |
| 56 | + |
| 57 | +In order to actually submit code, there are some more steps. First, |
| 58 | +you'll need to install [redis](https://redis.io/download). |
| 59 | + |
| 60 | +You'll also need to start the celery worker. This can be done |
| 61 | +by running the following command in a separate terminal: |
| 62 | + |
| 63 | +``` |
| 64 | +uv run celery -A tin worker --loglevel=info |
| 65 | +``` |
| 66 | + |
| 67 | +## Final Steps |
| 68 | + |
| 69 | +After that, you'll want to create a course and an assignment in the course. |
| 70 | +After saving the assignment, you can hit "Upload grader" to add a grader - |
| 71 | +the simplest example of a grader is located in `scripts/sample_grader.py`. |
| 72 | + |
| 73 | +Now you can try making a submission, and as long as your submission doesn't throw an error you |
| 74 | +should get a 100%! Congrats on your brand new 5.0 GPA! |
0 commit comments