A lightweight web application written in Go that allows users to manage events through a simple CRUD interface. The project serves as a practical implementation of essential web application features using Go's standard library and minimal dependencies.
Here's a visual walkthrough of the application:
The home page provides quick access to event management and user authentication.
View and manage all your events in one place, with options to create, edit, and delete events.
Detailed view of individual events showing all relevant information.
-
Event Management
- Create, read, update, and delete events
- View event details and listings
-
User Authentication & Security
- User registration and login
- Session management
- CSRF protection
- Secure password handling
- github.com/alexedwards/scs/v2: Session management middleware for secure user sessions
- github.com/alexedwards/scs/sqlite3store: SQLite3 session store for SCS
- github.com/go-playground/form/v4: Form decoder and validator for processing HTTP form data
- github.com/justinas/alice: Middleware chaining for clean HTTP handler composition
- github.com/justinas/nosurf: CSRF protection middleware
- github.com/mattn/go-sqlite3: SQLite3 database driver
- golang.org/x/crypto/bcrypt: Password hashing and verification
- TailwindCSS: Utility-first CSS framework for styling
- @tailwindcss/forms: Form styling plugin
- @tailwindcss/typography: Typography styling plugin
- Iconify: Icon system with multiple icon sets
- Used via CDN for UI icons (material-symbols, lucide, etc.)
- Air: Live reload for Go applications during development
- Browser-sync: Browser synchronization and auto-reload
- Just: Command runner for development tasks
- Goose: Database migration tool
-
Backend
- Go (Golang) for server-side logic
- SQLite for data persistence
- Goose for database migrations
-
Frontend
- HTML templates
- TailwindCSS for styling
- JavaScript for enhanced interactivity
-
Development Tools
- Air for live reloading
- Browser-sync for development server
- Just for task automation
- Docker for containerization
-
Clone the repository:
git clone https://github.com/madalinpopa/go-event-planner.git && cd go-event-planner
-
Build the Docker image:
docker build -t go-event-planner .
-
Run the container:
docker run -p 4000:4000 \ -v $(pwd)/database:/app/database \ go-event-planner
The application will be available at http://localhost:4000
-
Install dependencies:
- Go 1.x or higher
- TailwindCSS CLI
- Just command runner
- Air (for live reloading)
- Browser-sync
- Goose (for database migrations)
-
Install project dependencies:
go mod download
-
Run database migrations:
just migrate up
-
Start the development server:
just dev
This will start:
- The Go server with live reloading
- TailwindCSS compiler in watch mode
- Browser-sync for automatic browser refreshing
- Update Go dependencies:
just update
- Build production CSS:
just build
- Run migrations:
just migrate [command]
- Create new migration:
just makemigrations [name]
.
├── cmd/
│ └── web/ # Web application code
│ ├── context.go # Request context definitions
│ ├── forms.go # Form handling and validation
│ ├── handlers.go # HTTP request handlers
│ ├── helpers.go # Helper functions
│ ├── main.go # Application entry point
│ ├── middleware.go # HTTP middleware
│ ├── routes.go # Route definitions
│ └── templates.go # Template handling
├── database/ # Database related files
│ ├── events.db # SQLite database
│ └── migrations/ # Database migrations
├── internal/ # Private application packages
│ ├── models/ # Data models
│ │ ├── errors.go
│ │ ├── event.go
│ │ └── user.go
│ └── validator/ # Validation logic
│ └── validator.go
├── ui/ # User interface related code
│ ├── assets/ # Source assets
│ │ └── input.css # TailwindCSS input file
│ ├── embed.go # File embedding for Go
│ ├── html/
│ │ ├── base.tmpl # Base template
│ │ ├── pages/ # Page templates
│ │ │ ├── auth/ # Authentication pages
│ │ │ ├── events/ # Event management pages
│ │ │ └── home.tmpl # Homepage
│ │ └── partials/ # Reusable template parts
│ │ ├── components/ # UI components
│ │ └── forms/ # Form templates
│ └── static/ # Static assets
│ ├── css/ # Compiled CSS
│ ├── fonts/ # Custom fonts
│ ├── img/ # Images
│ └── js/ # JavaScript files
├── Dockerfile # Docker configuration
├── go.mod # Go module definition
├── justfile # Task runner commands
└── tailwind.config.js # TailwindCSS configuration
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Some ideas for future enhancements:
- Add event categories and tags
- Implement user roles and permissions
- Add event sharing functionality
- Create API endpoints for programmatic access
- Add event reminders and notifications
- Implement event search and filtering
- Add event location with map integration
- Create a REST API
- Add unit tests and integration tests