Project Demo is live at shopedia.ca Project GraphiQL can be accessed at /graphiql
Hosted on an AWS EC2 Instance (Nginx)
- All CRUD functionalities for Articles with search capability, following core MVC principles
- Authentication: OAuth2 (secure) using Google Provider with session handling
- User database and associations with created Articles (including user dashboard view)
- GraphQL integration for database queries and mutations
- Caching (Action and Fragment) for optimized performance
- Refined and added test cases. All tests pass in
article_test.rb.
Tests can be observed usingrails test
command.
- A comprehensive list of changes to application can be viewed in the commit logs. I have utilized Conventional Commits
feat:
denotes a new feature to the application.fix:
denotes a commit to address bugs/revisions.
A few important points to note:
- Only users who are signed-in can create, edit, or delete their articles.
- Once signed-in, users will be able to see a
Create
button in the navbar. - A user may only mutate their own Articles. This is to maintain content integrity and leverage User Authentication.
All queries and mutations below can be tested in /graphiql
query GetUsers {
users {
email
name
uid
}
}
query GetArticles{
articles {
id
title
content
userId
date
}
}
Note: you can change the query string below to test various searches
query SearchArticles {
searchArticles(query: "Testing") {
id
title
content
}
}
Note: A user is required to create articles. Use the userId provided below. Date format should be exactly the same
mutation CreateArticle {
createArticle(
input:{
title: "GraphQL",
content: "Some content",
author:"Shopify",
date: "2024-01-16",
userId:"105777079670793482961"
}) {
article {
id
title
content
author
}
errors
}
}
Note: Only articles that exist in the database can be deleted. Select an appropriate article id from GetArticles query.
mutation DeleteArticle {
deleteArticle(input:{
id: ""
}) {
message
}
}
Note: Only articles that exist in the database can be updated. Select an appropriate article id from GetArticles query.
mutation UpdateArticle {
updateArticle(input:{
id:"24"
title: "GraphQL: Mutations"
}) {
article {
id
title
author
content
}
errors
}
}
- Using auth-tokens to allow for scoped queries and mutations in GraphQL (preferably with JWT)
- Elasticsearch to enhance search functionality (real-time search, 'fuzzy' search, autocomplete etc.)
- Additional OAuth2 providers (GitHub, Microsoft etc.)
- Project was built using
Ruby 3.3.0
andRails 7.1.2
- Tailwind CSS and DaisyUI for Frontend design