Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This repository is extracted from my **Transcendence** project at [Hive Helsinki](https://www.hive.fi/).

During the Transcendence project, our team built an online PingPong game with a microservice architecture.
During the Transcendence project, our team built an online Ping-Pong game with a microservice architecture.
I was responsible for designing and implementing the **auth/user service** with **Go** and **Gin**.

I also implemented a minimal **frontend prototype** using **Svelte** for learning propose here.
I also implemented a minimal **frontend prototype** using **Svelte** for learning purposes.

---

Expand All @@ -15,13 +15,34 @@ Currently supported features include:

- User registration
- Login with username or email
- Logout
- Avatar update
- OAuth login (Google)
- Two-factor authentication (TOTP)
- Friends system
- Friend listing
- Friend requests
- Online status tracking

## Libraries

### Backend

- `gin`: web framework
- `gorm`: ORM
- `go-playground/validator v10`: data validation
- `godotenv`: environment variables
- `slog-gin`: logging
- `gin-swagger`: Swagger (OpenAPI) docs

### Frontend

- `Svelte`: frontend framework
- `Tailwind CSS` : CSS
- `shadcn/ui (Svelte)`: UI library
- `Zod`: Validator
- `SvelteKit Superforms`: Form (SPA)

---

## Running the Project
Expand All @@ -42,17 +63,24 @@ cd backend
make dev
```

Then navigate to `http://localhost:3003/api/docs/index.html` for swagger.

### Frontend

```bash
#TODO
cd frontend
pnpm run dev
```

Then navigate to `http://localhost:5173`.
Note: Google login does not work locally until Google OAuth credentials are configured.

## Limitation
Due to the limitation of the Hive subject, `SQLite` was required for the project.
## Limitations

Due to the constraints of the Hive project, `SQLite` was required for the project.

As a result:
- `SQLite` is used to store `authentication tokens` and `heartbeat` data. In production, these would be better handled by `Redis`.
- And also, `Stale token` and `heartbeat` data are not automatically cleaned up. And `Token` auto-renewal is not implemented.
- On the frontend side, `Friend auto-completion` is implemented in a very rough way.

- `SQLite` is used to store authentication tokens and heartbeat data. In production, these would be better handled by `Redis`.
- Stale tokens and heartbeat data are not automatically cleaned up, and token auto-renewal is not implemented.
- On the frontend side, friend auto-completion is implemented in a basic manner.
3 changes: 0 additions & 3 deletions backend/requests/ping.rest

This file was deleted.

101 changes: 0 additions & 101 deletions backend/requests/users.rest

This file was deleted.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"vitest-browser-svelte": "^2.0.1"
},
"dependencies": {
"@sveltejs/adapter-vercel": "^6.3.0",
"clsx": "^2.1.1",
"lucide-svelte": "^0.562.0",
"qrcode": "^1.5.4",
Expand Down
Loading
Loading