https://github.com/jenting/voting-topic
A website allow users to create new topic and voting
https://github.com/jenting/voting-topic
side-project topic voting
Last synced: 5 months ago
JSON representation
A website allow users to create new topic and voting
- Host: GitHub
- URL: https://github.com/jenting/voting-topic
- Owner: jenting
- License: mit
- Created: 2018-05-04T14:24:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-09-22T11:46:38.000Z (9 months ago)
- Last Synced: 2025-09-22T13:19:37.861Z (9 months ago)
- Topics: side-project, topic, voting
- Language: Go
- Homepage:
- Size: 1.27 MB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# voting-topic
A website that allows user to create new topic and voting (upvote or downvote).
[](https://travis-ci.com/jenting/voting-topic)
## Demo site on [Heroku](https://www.heroku.com/)
Demo site
## Language
* F/E: HTML + jQuery
* B/E: Golang (golang >= 1.11)
## Setup
* Download the project
```sh
go get github.com/jenting/voting-topic
```
* Compile and run the project
```sh
./run.sh
```
## RESTful APIs
* CRUD
| Method | URL | Description |
|-------------|-------------|-------------|
| GET | | Query top 20 topic informations. |
| GET | | Query topic information with specific uid. |
| POST | | Create topic with JSON body. |
| PUT | | Update upvote by 1 with specific uid in JSON body. |
| PUT | | Update downvote by 1 with specific uid in JSON body. |
* HTTP POST/PUT JSON body
| Field | Type(Length) | Description |
|--------------|-------------------|-----------------|
| uid | Version 4 UUID | UUID |
| name | String(255) | Topic name |
| upvote | Unsigned Integer | Upvote count |
| downvote | Unsigned Integer | Downvote count |
## TODO
* [ ] Support [prometheus](https://prometheus.io) metrics API
## Limitations
* Topic should not exceed 255 characters.
* Allow user to upvote or downvote the same topic multiple times.
* Homepage lists top 20 topics (sorted by upvotes, descending)
* Keeps the topics in-memory data cache
* Write test cases
* Deploy to Heroku
## Notes
* Do not do AAA
* Do not check duplicate votes
* No needs in-disk database