|
| 1 | +# Smart Taskhub - Backend |
| 2 | + |
| 3 | +This is the **backend service** for Smart Taskhub, built with **Play Framework (Scala)** and **PostgreSQL**. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## ⚙️ Tech Stack |
| 8 | +- **Language:** Scala |
| 9 | +- **Framework:** Play Framework (3.0.8) |
| 10 | +- **Database:** PostgreSQL |
| 11 | +- **Build Tool:** sbt |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## 🛠 Setup Instructions |
| 16 | +### 1. Install Dependencies |
| 17 | +Make sure you have: |
| 18 | +- **Java 18+** |
| 19 | +- **sbt** |
| 20 | +- **PostgreSQL** |
| 21 | + |
| 22 | +### 2. Create Database |
| 23 | +Make sure PostgreSQL is running and create the database: |
| 24 | +```bash |
| 25 | +psql -U your_user -c "CREATE DATABASE smart_taskhub;" |
| 26 | +``` |
| 27 | +Or using createdb: |
| 28 | +```bash |
| 29 | +createdb -U your_user smart_taskhub |
| 30 | +``` |
| 31 | + |
| 32 | +### 3. Configure Environment |
| 33 | +Update `application.conf` or use environment variables: |
| 34 | +```bash |
| 35 | +DB_URL=jdbc:postgresql://localhost:5432/smart_taskhub |
| 36 | +DB_USER=your_user |
| 37 | +DB_PASSWORD=your_password |
| 38 | +``` |
| 39 | + |
| 40 | +### 4. Run the App |
| 41 | +```bash |
| 42 | +sbt run |
| 43 | +``` |
| 44 | + |
| 45 | +### 5. Run Tests |
| 46 | +```bash |
| 47 | +sbt test |
| 48 | +``` |
| 49 | + |
| 50 | +### 6. Code Quality |
| 51 | +```bash |
| 52 | +sbt scalastyle |
| 53 | +``` |
| 54 | +## 📂 Project Structure |
| 55 | +```bash |
| 56 | +backend/ |
| 57 | +│ |
| 58 | +├── api-specs/ # API documentation (Swagger/OpenAPI) |
| 59 | +├── app/ |
| 60 | +│ ├── controllers/ # HTTP controllers |
| 61 | +│ ├── db/ # Database configuration and migrations |
| 62 | +│ ├── dto/ # Data Transfer Objects |
| 63 | +│ ├── exception/ # Exception handling |
| 64 | +│ ├── filters/ # Request/response filters |
| 65 | +│ ├── init/ # App initialization logic |
| 66 | +│ ├── mappers/ # Entity ↔ DTO mappers |
| 67 | +│ ├── models/ # Domain models |
| 68 | +│ ├── modules/ # Dependency injection modules |
| 69 | +│ ├── repositories/ # Data access layer |
| 70 | +│ ├── services/ # Business logic |
| 71 | +│ ├── utils/ # Utility functions |
| 72 | +│ └── validations/ # Custom validations |
| 73 | +├── conf/ # Config files (application.conf, routes) |
| 74 | +├── postman_collections/ # API collections for testing |
| 75 | +├── project/ # sbt project settings |
| 76 | +├── public/ # Static assets |
| 77 | +├── test/ # Unit and integration tests |
| 78 | +├── build.sbt # sbt build file |
| 79 | +└── Dockerfile # Docker image definition |
| 80 | +``` |
0 commit comments