An open API service indexing awesome lists of open source software.

https://github.com/rayato159/quests-tracker

Hey adventurers! Welcome to Crabby's Quests Tracker, the ultimate tool to keep tabs on all your epic adventures. ๐ŸŒŸ
https://github.com/rayato159/quests-tracker

axum-demo clean-architecture clean-code crud-api diesel domain-driven-design postgresql practice-project restful-api rust

Last synced: 2 months ago
JSON representation

Hey adventurers! Welcome to Crabby's Quests Tracker, the ultimate tool to keep tabs on all your epic adventures. ๐ŸŒŸ

Awesome Lists containing this project

README

          

# Quests Tracker: Crabby's Final Project ๐Ÿ“œ

Hey adventurers! Welcome to **Crabby's Quests Tracker**, the ultimate tool to keep tabs on all your epic adventures. ๐ŸŒŸ Whether you're rallying your squad, tracking loot, or planning your next epic quest.

this projectโ€™s got your back. Let's make managing quests as legendary as Crabby's journey itself! ๐Ÿฆ€๐Ÿ’ฅ

## ๐Ÿš€ What is Quests Tracker?

This is a project to help you stay organized with quests, adventurers, and their outcomes! Track whoโ€™s in, whoโ€™s out, and what went down, all while keeping things clean with **Rust** and **Domain-Driven Design** (DDD). Itโ€™s not just another tracker, it's Crabby's way to squad up and roll out! โš”๏ธโœจ

### ๐Ÿ” Key Features

- **QuestOps**: Manage all the quest operations. โš”๏ธ
- **Quest Viewing**: Easily view all active quests, their details, and progress. ๐Ÿ“โœจ
- **Journey Ledger**: Keep a log of every quest journey, completed, failed, or in progress. ๐Ÿ“–๐Ÿ’ซ
- **Crew Switchboard**: Let's adventures to join or leave a quest. ๐Ÿ› ๏ธ๐Ÿ‘ฅ
- **Adventures**: Just an adventure. ๐ŸŒŸ
- **Guild Commanders**: Assign guild commanders to do the quest ops duty. ๐Ÿฐ๐Ÿฆธโ€โ™‚๏ธ
- **Authentication**: Keep everything secure, only the right adventurers can join the quests. ๐Ÿ”’โœจ

## ๐Ÿ› ๏ธ Tech Stack

- **Rust Tokio Axum** ๐Ÿฆ€: For maximum safety and async vibes.
- **PostgreSQL** ๐Ÿ˜: To store all that legendary loot and quest data.
- **Diesel ORM** ๐Ÿš‚: For smooth database ops.

## ๐Ÿ“‹ Project Structure

Organized with **Domain-Driven Design** + **Clean Architecture** to keep things tidy:

```text
quests_tracker/
โ”œโ”€โ”€โ”€config/
โ”œโ”€โ”€โ”€src/
โ”‚ โ”œโ”€โ”€โ”€application/
โ”‚ โ”‚ โ””โ”€โ”€โ”€usecases/
โ”‚ โ”œโ”€โ”€โ”€domain/
โ”‚ โ”‚ โ”œโ”€โ”€โ”€entities/
โ”‚ โ”‚ โ”œโ”€โ”€โ”€repositories/
โ”‚ โ”‚ โ””โ”€โ”€โ”€value_objects/
โ”‚ โ””โ”€โ”€โ”€infrastructure
โ”‚ โ”œโ”€โ”€โ”€axum_http/
โ”‚ โ””โ”€โ”€โ”€postgres/
โ”‚ โ”œโ”€โ”€โ”€migrations/
โ”‚ โ””โ”€โ”€โ”€repositories/
โ”œโ”€โ”€ Cargo.toml
```

## ๐Ÿ”ง How to Set Up

Ready to level up? Follow these steps:

1. **Clone the Repo**:

```sh
git clone https://github.com/Rayato159/quests-tracker.git
cd quests-tracker
```

2. **Set Up Diesel**:

```sh
cargo install diesel_cli --no-default-features --features postgres
```

3. **Set Up PostgreSQL on Podman**:

```sh
podman run --name quests-tracker-db -e POSTGRES_PASSWORD=123456 -e POSTGRES_DB=quests_tracker_db -p 5432:5432 -d postgres:latest
```

4. **Run Migrations**:

```sh
diesel migration run
```

5. **Run the Server**:

```sh
cargo run
```

Boom, you're in! ๐ŸŽ‰

## ๐Ÿงช Testing

1. **Run Tests**:

```sh
cargo test
```

2. **Runing Test Coverage**:

```sh
cargo install cargo-tarpaulin
```

```sh
cargo tarpaulin --out xml
```

## ๐Ÿ“ฆ Upgrade All Dependecies

```sh
cargo update
```

## ๐Ÿค– Let's Cargo Clippy Refactor Your Code in Automatically

```sh
cargo clippy --fix --lib -p quests_tracker
```

## ๐Ÿ“ ENV Example

```text
STAGE=Local

SERVER_PORT=8080
SERVER_BODY_LIMIT=10 # MB
SERVER_TIMEOUT=90 # seconds

DATABASE_URL=postgres://postgres:123456@localhost/quests_tracker_db

JWT_ADVENTURER_SECRET=a_supersecret
JWT_ADVENTURER_REFRESH_SECRET=ar_supersecretrefresh
JWT_GUILD_COMMANDER_SECRET=g_supersecret
JWT_GUILD_COMMANDER_REFRESH_SECRET = gr_supersecretrefresh
```

## ๐Ÿณ Build

1. **Build Docker Image**:

```sh
docker build -t quests-tracker:v1.0.0 -f ./Dockerfile .
```

2. **Run Docker Container**:

```sh
podman run --name quests-tracker -p 8080:8080 \
-e STAGE=Local \
-e SERVER_PORT=8080 \
-e SERVER_BODY_LIMIT=10 \
-e SERVER_TIMEOUT=90 \
-e DATABASE_URL=postgres://user:password@host:port/database_name \
-e JWT_ADVENTURER_SECRET=xxxxx \
-e JWT_ADVENTURER_REFRESH_SECRET=xxxxx \
-e JWT_GUILD_COMMANDER_SECRET=xxxxx \
-e JWT_GUILD_COMMANDER_REFRESH_SECRET=xxxxx \
-d quests-tracker:v1.0.0
```

## โšก๏ธ Usage

- **Do a Quest Ops**: Start a new adventure for your crew.
- **Add Adventurers**: Let your squad join in on the action.
- **Track Progress**: Update and check the status of quests, know whoโ€™s thriving and whoโ€™s not.

## ๐ŸŒ Contributing

Feel like adding your magic to Crabby's adventure? Fork the repo, make those changes, and open a pull request. Crabby loves help from fellow adventurers! ๐Ÿ’ชโœจ

## ๐Ÿ“œ License

This project is open-sourced under the **MIT License**. feel free to use, modify, and share.

## ๐Ÿฆ€ Shoutout to Crabby!

Special shoutout to **Crabby**, the ultimate adventure guide. Without Crabby, none of these epic quests would be possible. Keep on adventuring! ๐Ÿฆ€๐Ÿš€

**Happy Questing, Adventurers!** ๐ŸŒŸ