A go-based sözlük clone inspired by the first version
brew install mysql
sudo apt install mysql-server
sudo mysql
mysql>
to create a new eskisozluk database using UTF8 encoding:
-- Create a new UTF-8 `eskisozluk` database.
CREATE DATABASE eskisozluk CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Switch to using the `eskisozluk` database.
USE eskisozluk;
to create a new sozluk table to hold the text entry for our application:
-- Create a `sozluk` table.
CREATE TABLE sozluk (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(50) NOT NULL,
content TEXT NOT NULL,
user VARCHAR(40) NOT NULL,
created DATETIME NOT NULL,
);
-- Add an index on the created column.
CREATE INDEX idx_sozluk_created ON sozluk(created);
to create a users model:
CREATE TABLE users (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(40) NOT NULL,
hashed_password CHAR(60) NOT NULL,
created DATETIME NOT NULL
);
ALTER TABLE users ADD CONSTRAINT users_uc_name UNIQUE (name);
creating a new user:
CREATE USER 'web'@'localhost';
GRANT SELECT, INSERT, UPDATE ON eskisozluk.* TO 'web'@'localhost';
-- Important: Make sure to swap 'pass' with a password of your own choosing.
ALTER USER 'web'@'localhost' IDENTIFIED BY 'pass';
clonning of repo:
git clone https://github.com/ecoderat/eski-sozluk.git
open main.go and swap 'pass' value with a password of your own chosen:
// main.go
// ...
dsn := flag.String("dsn", "web:pass@/eskisozluk?parseTime=true", "MySQL data source name")
// ...
in the project directory
go run ./cmd
- Latest entry fetching properly to homepage
- Topics list on homepage is fetching properly
- Topics list on topicpage is fetching properly
- Adding an entry to a topic with the form (no authentication yet)
- Creating a new topic
- Adding middleware
- Creating a users table on the database
- User authentication
- Creating a users model
- Log in/Sign up page
- Running a HTTPS server
...
- Unit Tests
- Handler Tests
- Middleware Tests
- End to End Tests
- Integration Tests