Commit 11268756 authored by Ole Martin Ruud's avatar Ole Martin Ruud
Browse files

Update documentation

parent 11c4f4d4
# Contributing
## Project structure
```
pizzabadger
├── assets # Some extra files used for reference
│   └── ...
├── Cargo.lock # Exact project dependencies
├── Cargo.toml # Project metadata and dependencies
├── diesel.toml # Configuration for diesel (database ORM)
├── docker # Folder with Dockerfiles for CI pipeline
│   └── ...
├── docker-compose.yml # Service definition for local environment
├── Dockerfile # Dockerfile used in local environment
├── migrations # Folder with database migrations
│   └── 1970-01-01-000000_some_name # Specific migration
│      ├── down.sql # SQL query to remove migration
│      └── up.sql # SQL query to setup migration
├── Rocket.toml # Configuration file for Rocket (mainly used locally)
├── src # Source code of project
│   ├── bin # Source code of binary files (actual executables)
│   │   ├── server # The sourcecode for the server (MAIN SOURCE REPOSITORY)
│   │   └── ...
│   ├── lib.rs # Main entrypoint of database bindings
│   └── model # Database models (ORM result)
│      └── ...
└── templates # Source code of HTML templates (tera templates)
   └── ...
```
## Some useful places to start
### Editing the webpages (HTML, CSS, JavaScript)
All the HTML templates are located in the `templates` directory. When the server
responds to a request it will render a template using the current context. The
context is different based on the user that sent the request, the pizzas present
etc. The templates are written using [tera](https://tera.netlify.com/docs/).
The website uses [tailwind](https://tailwindcss.com/) as a CSS framework.
### Editing the source code
The server is written using [Rust](https://www.rust-lang.org/). This can be a
complex language to learn, however there is a great [getting
started](https://www.rust-lang.org/learn/get-started) which will teach you all
you need to know about the language.
The project uses [rocket](https://rocket.rs/), which is a web framework, as it's
main component. The main file of the server can be found under
`src/bin/server/main.rs`. Rocket also has a great [getting
started](https://rocket.rs/v0.4/guide/) guide which will get you up to speed
quickly.
----
If anything is unclear, feel free to create an issue, ping @barskern on
Discord or ask during TekKom meetings.
**Happy coding!**
......@@ -8,20 +8,6 @@ A small webserver to enable participants to vote for different pizzas.
docker-compose up -d --build --force-recreate
```
## Deployment
## Contributing
If you have access to `temp.logntnu.no` you can deploy the application. To do so you need `docker-compose` and `docker-machine`.
#### First time setup
```bash
docker-machine create --driver generic --generic-ip-address temp.logntnu.no --generic-ssh-key <ssh-key-path> temp-logntnu-no
```
#### Deploying
```bash
# Setup shell to redirect all docker commands to server (be careful!)
eval $(docker-machine env temp-logntnu-no)
./deploy.sh
```
See `CONTRIBUTING.md` for more information about this.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment