Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge completed #3

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
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
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.expo
71 changes: 39 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Foodbarrio ReactNative & GraphQL test

The goal is to implement a small Post/Comments app using GraphQL API and React Native.
## Instructions

This project requires to have docker installed on the machine where it is run.
to run the project:
- clone the repository
- run yarn install to install the concurrently package
- run yarn pre to install packages in front end and back end
- run yarn start to start front end and back end concurrently
- you can run the project on web or scan the qr code produced in terminal to run on expo on a smartphone (this requires the expo app on the device).

## Screens
The app will have three screens.
- [ ] **Login**
- [ ] **List of posts**
- [ ] **Create/Edit post**
- [ ] **Post details**
- [x] **Login**
- [x] **List of posts**
- [x] **Create/Edit post**
- [x] **Post details**

### Navigation
- The user inserts his/her username in the "Login" screen to enter the app. If the inserted username doesn't exists, it will be created.
Expand All @@ -19,51 +27,51 @@ The app will have three screens.
## Use cases
### Must have
As a user I can
- [ ] enter the app with a username
- [ ] see all available posts
- [ ] create new posts
- [ ] edit/delete my posts
- [ ] like and unlike my or other posts
- [ ] create new comments on my or other posts
- [ ] edit/delete my comments on posts
- [ ] like and unlike my or other comments
- [x] enter the app with a username
- [x] see all available posts
- [x] create new posts
- [x] edit/delete my posts
- [x] like and unlike my or other posts
- [x] create new comments on my or other posts
- [x] edit/delete my comments on posts
- [x] like and unlike my or other comments

As a user I can't
- [ ] delete or edit posts of other users
- [ ] delete or edit comments of other users
- [x] delete or edit posts of other users
- [x] delete or edit comments of other users

### Desiderable
As a user I can
- [ ] see new posts from other users without refreshing the "List of posts" screen
- [ ] see new comments from other users without refreshing the "Post Details" screen
- [x] see new posts from other users without refreshing the "List of posts" screen
- [x] see new comments from other users without refreshing the "Post Details" screen
- [ ] see new likes from other users without refresing the "Post Details"

### Nive to have
As a user I can
- [ ] search content in the posts
- [x] search content in the posts

## Data structure
This is only an example of a possible data structure that can be used
### User
- [ ] username
- [x] username

### Posts
- [ ] username of the author
- [ ] title
- [ ] content
- [ ] createdAt
- [x] username of the author
- [x] title
- [x] content
- [x] createdAt

### Comments
- [ ] parentPost
- [ ] username of the author
- [ ] title
- [ ] content
- [ ] createdAt
- [x] parentPost
- [x] username of the author
- [x] title
- [x] content
- [x] createdAt

### Likes
- [ ] parentPost or parentComment
- [ ] username of the author
- [ ] createdAt
- [x] parentPost or parentComment
- [x] username of the author
- [x] createdAt

## Tools that you have to use
### Must have
Expand All @@ -74,7 +82,6 @@ This is only an example of a possible data structure that can be used

### Desiderable
- Express
- Knex (with migrations)
- PostgreSQL

### Nice to have
Expand Down
Binary file added blog-api/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions blog-api/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": ["@babel/preset-env", "@babel/typescript"],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
[
"@babel/plugin-transform-runtime",
{
"regenerator": true
}
]
]
}
2 changes: 2 additions & 0 deletions blog-api/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WEB_PORT= 8080
JWT_SECRET= 848F9F5C2AF795C35E34F80A8B5515FC94854F12C5B3AAE4AD7F60E9DB4ADBF1
1 change: 1 addition & 0 deletions blog-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Empty file added blog-api/Icon
Empty file.
3 changes: 3 additions & 0 deletions blog-api/database.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_DB=database
21 changes: 21 additions & 0 deletions blog-api/dist/controllers/appointment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions blog-api/dist/controllers/auth.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions blog-api/dist/middleware/isAdmin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading