Kushena is a restaurant employee and order management system. This backend API is built using Golang, Gin-Gonic, MongoDB, JWT authentication, and bcrypt for password hashing.
Employee authentication (Login, JWT-based authentication)
Employee attendance tracking (Check-in, Check-out, Attendance report)
Order management (Create, Update, Delete, Retrieve orders)
Food and Drink management
Role-based access control (Manager role)
Reports (Daily, Weekly, Monthly, Yearly)
Golang : Backend development
Gin-Gonic : HTTP framework for building RESTful APIs
MongoDB : NoSQL database for data storage
JWT (JSON Web Token) : Authentication and authorization
Bcrypt : Password hashing
Email Services : Sending emails (if implemented)
Install Go (>=1.18)
Install MongoDB
Set up environment variables
Create a .env file and define the following variables:
PORT = 8080
MONGO_URI = mongodb://localhost:27017/kushena
JWT_SECRET = your_secret_key
Clone the repository and install dependencies:
git clone https://github.com/yesetoda/kushena.git
cd kushena
go mod tidy
Method
Endpoint
Description
POST
/employee/login
Employee login
Method
Endpoint
Description
POST
/checkin
Employee check-in
POST
/checkout
Employee check-out
GET
/attendance
Get attendance records
GET
/checkstatus
Get employee check-in status
GET
/todaysworkingtime
Get today's working hours
Method
Endpoint
Description
GET
/report/daily
Get daily report
GET
/report/weekly
Get weekly report
GET
/report/monthly
Get monthly report
GET
/report/yearly
Get yearly report
Employee Management (Manager Only)
Method
Endpoint
Description
POST
/manage/employee
Create an employee
GET
/manage/employee/:id
Get employee by ID
PATCH
/manage/employee
Update employee details
DELETE
/manage/employee/:id
Delete an employee
GET
/manage/employees
Get all employees
Method
Endpoint
Description
POST
/action/order
Create an order
PATCH
/action/order
Update an order
DELETE
/action/order/:id
Delete an order
GET
/action/order/:id
Get order by ID
GET
/action/orders
Get all orders
GET
/action/myorders
Get all orders for logged-in user
Method
Endpoint
Description
POST
/action/food
Create food item
PATCH
/action/food
Update food item
DELETE
/action/food/:id
Delete food item
GET
/action/food/:id
Get food by ID
GET
/action/foods
Get all foods
POST
/action/drink
Create drink item
PATCH
/action/drink
Update drink item
DELETE
/action/drink/:id
Delete drink item
GET
/action/drink/:id
Get drink by ID
GET
/action/drinks
Get all drinks
Authentication & Authorization
JWT authentication is required for most endpoints.
Manager endpoints require a valid JWT with Manager role.
Returns 404 for undefined routes.
Returns 403 for unauthorized access.
Returns 400 for bad requests.
Fork the repository.
Create a new branch (feature/your-feature).
Commit changes and push to the branch.
Open a pull request.
MIT License
For inquiries, reach out to yeneinehseiba@gmail.com