feat: Initialize frontend and backend structure with essential configurations and entities
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func helloHandler(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, "Hello from the Time Tracker Backend!")
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", helloHandler)
|
||||
fmt.Println("Server listening on port 8080")
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
module github.com/timetracker/backend
|
||||
|
||||
go 1.23.6
|
||||
@@ -0,0 +1,7 @@
|
||||
package entities
|
||||
|
||||
type Activity struct {
|
||||
ID int
|
||||
Name string
|
||||
BillingRate float64
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package entities
|
||||
|
||||
type Company struct {
|
||||
ID int
|
||||
Name string
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package entities
|
||||
|
||||
type Customer struct {
|
||||
ID int
|
||||
Name string
|
||||
CompanyID int
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package entities
|
||||
|
||||
type Project struct {
|
||||
ID int
|
||||
Name string
|
||||
CustomerID int
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package entities
|
||||
|
||||
import "time"
|
||||
|
||||
type TimeEntry struct {
|
||||
ID int
|
||||
UserID int
|
||||
ProjectID int
|
||||
ActivityID int
|
||||
Start time.Time
|
||||
End time.Time
|
||||
Description string
|
||||
Billable int // Percentage (0-100)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package entities
|
||||
|
||||
type User struct {
|
||||
ID int
|
||||
Username string
|
||||
Password string
|
||||
Role string
|
||||
CompanyID int
|
||||
HourlyRate float64
|
||||
}
|
||||
Reference in New Issue
Block a user