Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/younesious/events
This is a backend program written in Go for managing events. Users can sign up, log in, and perform various actions based on their JWT tokens.
https://github.com/younesious/events
gin go jwt-authentication sqlite3
Last synced: 2 months ago
JSON representation
This is a backend program written in Go for managing events. Users can sign up, log in, and perform various actions based on their JWT tokens.
- Host: GitHub
- URL: https://github.com/younesious/events
- Owner: younesious
- License: mit
- Created: 2024-06-04T17:41:49.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-06-07T10:03:36.000Z (7 months ago)
- Last Synced: 2024-10-02T05:21:29.498Z (3 months ago)
- Topics: gin, go, jwt-authentication, sqlite3
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Events
## Description
This is a backend program written in Go for managing events. Users can sign up, log in, and perform various actions for especial endpoints. For example, only users who are owners can update or delete their own events. for create an event or register an event or cancel the registraition login is required.
## Project Structure
```sh
.
├── db
│ └── db.go
├── Dockerfile
├── events.db
├── go.mod
├── go.sum
├── handlers
│ ├── events.go
│ ├── register.go
│ └── users.go
├── LICENSE
├── main.go
├── models
│ ├── event.go
│ ├── registration.go
│ └── user.go
├── README.md
└── routes
├── middleware.go
└── routes.go4 directories, 16 files
```## Getting Started
### Prerequisites
- Docker
- or if you wanna run it locally and golang installed in your system just need internet :)## Installation
To run this project locally, follow these steps:Clone the repository:
```sh
git clone https://github.com/younesious/go-events-backend.git
cd go-events-backend
go run ./main.go
```Or if prefer Docker, follow these steps:
1. Build the Docker image:
```sh
docker image build -t my-go-events-app:v1.00 .
```
2. Run the Docker container:
```sh
docker container run -p 8080:8080 -v /path/to/local/events.db:/app/events.db my-go-events-app:v1.00
```
Replace `/path/to/local` with the actual path where you want to store the database on your host system(path to `events.db` file).#### HTTP API Endpoints
- **Sign Up**: Register as a new user: `POST /signup`
- **Log In**: Authenticate with your credentials: `POST /login`
- **View Events**: Retrieve a list of events: `GET /events`
- **View an Event**: Retrieve a special event: `GET /events/:id`
- **Create Event**: Add a new event: `POST /events`
- **Update Event**: Modify an existing event (only allowed by event owner): `PUT /events/:id`
- **Delete Event**: Remove an event (only allowed by event owner): `DELETE /events/:id`
- **Register for Event**: Sign up for an event: `POST /events/:id/register`
- **Cancel Registration**: Withdraw from an event: `DELETE /events/:id/register`License
-------This project is licensed under the MIT License - see the [LICENSE](https://github.com/younesious/events/blob/master/LICENSE) file for details.
### Contributing
Feel free to contribute and I'll be happy to see you :)