https://github.com/aditya43/golang-bookstore_oauth-api
OAuth API | DDD Approach | Apache Cassandra As Backend Database
https://github.com/aditya43/golang-bookstore_oauth-api
cassandra domain-driven-design gin-gonic golang microservice oauth rest-api
Last synced: 3 months ago
JSON representation
OAuth API | DDD Approach | Apache Cassandra As Backend Database
- Host: GitHub
- URL: https://github.com/aditya43/golang-bookstore_oauth-api
- Owner: aditya43
- License: mit
- Created: 2021-04-30T14:01:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-08T15:46:31.000Z (over 4 years ago)
- Last Synced: 2025-07-02T00:02:14.687Z (5 months ago)
- Topics: cassandra, domain-driven-design, gin-gonic, golang, microservice, oauth, rest-api
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## REST Microservices using Golang | OAuth API
OAuth API | DDD Approach | Apache Cassandra As Backend Database
## Author
Aditya Hajare ([Linkedin](https://in.linkedin.com/in/aditya-hajare)).
## Current Status
WIP (Work In Progress)!
## License
Open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
-------
### Install And Configure Cassandra:
- [How to setup Cassandra on MacOS](https://medium.com/@manishyadavv/how-to-install-cassandra-on-mac-os-d9338fcfcba4)
- Steps:
```sh
# Install Python
brew install python
# Install Cassandra
brew install cassandra
# Install cqlsh
pip install cql
# Start Cassandra
cassandra -f
# Start cqlsh
cqlsh
```
- In `cqlsh` shell, type following to create `keyspace` and `oauth` table:
```sh
# List all keyspaces
describe keyspaces;
# Create new keyspace called "oauth" with single replica
CREATE KEYSPACE oauth WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};
# Use "oauth" keyspace
USE oauth;
# Create "access_tokens" table
CREATE TABLE access_tokens( access_token VARCHAR PRIMARY KEY, user_id BIGINT, client_id BIGINT, expires BIGINT);
# Describe "access_tokens" table
describe access_tokens;
# Select operation on "access_tokens" table
SELECT * FROM access_tokens WHERE access_token='adi';
```