Skip to content

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.

License

Notifications You must be signed in to change notification settings

younesious/events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

.
├── 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.go

4 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:

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:
docker image build -t my-go-events-app:v1.00 .
  1. Run the Docker container:
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 file for details.

Contributing

Feel free to contribute and I'll be happy to see you :)

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published