This repository contains the API code for the Shiftkey App, which is built using Go and Gin framework. The API interacts with a PostgreSQL database to store and retrieve data.
Before running the API, make sure you have the following installed:
- Go
- PostgreSQL
To get started with the Shiftkey App API, follow these steps:
-
Clone the repository:
git clone https://github.com/shiftkeyapp/api.git
-
Install the dependencies:
go mod download
-
Set up the PostgreSQL database:
- Create a new database named
shiftkey-db. - Create a new
.envfile using the.env.examplefile as a template.
- Create a new database named
-
Build and run the API:
go run cmd/main/main.go
or build and run the API using
run.sh:./run.sh
Make sure to give permission to the script before running it:
chmod +x run.sh
- GET
/users: Retrieve a list of users. - POST
/users: Create a new user. - GET
/users/:id: Retrieve a specific user by ID. - PUT
/users/:id: Update a specific user by ID. - DELETE
/users/:id: Delete a specific user by ID.
- GET
/events: Retrieve a list of events. - POST
/events: Create a new event. - GET
/events/:id: Retrieve a specific event by ID. - PUT
/events/:id: Update a specific event by ID. - DELETE
/events/:id: Delete a specific event by ID.
- GET
/attendance: Retrieve attendance records. - POST
/attendance: Create an attendance record. - PUT
/attendance/:id: Update an attendance record by ID. - DELETE
/attendance/:id: Delete an attendance record by ID.
- GET
/hosts: Retrieve a list of hosts. - POST
/hosts: Create a new host. - GET
/hosts/:id: Retrieve details of a specific host. - PUT
/hosts/:id: Update details of a specific host. - DELETE
/hosts/:id: Delete a specific host.
- POST
/auth/login: Authenticate a user and return a token. - POST
/auth/register: Register a new user. - POST
/auth/logout: Log out a user.
If you would like to contribute to the Shiftkey App API, please follow the guidelines in the CONTRIBUTING.md file.
This project is licensed under the MIT License.
