Skip to content

a go-based sözlük clone inspired by the first version

Notifications You must be signed in to change notification settings

ecoderat/eski-sozluk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eski-sözlük

A go-based sözlük clone inspired by the first version

homepage

Installation

Installation MySQL

Macos

brew install mysql

Linux

sudo apt install mysql-server

Configuration MySQL

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';

Installation eski-sözlük

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")
// ...

Usage

in the project directory

go run ./cmd

Features

basic features

  • 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

features related to user

  • Creating a users table on the database
  • User authentication
  • Creating a users model
  • Log in/Sign up page
  • Running a HTTPS server

entry search features

...

testing

  • Unit Tests
  • Handler Tests
  • Middleware Tests
  • End to End Tests
  • Integration Tests

About

a go-based sözlük clone inspired by the first version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published