Skip to content

Commit

Permalink
inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrad77 committed Jul 23, 2020
1 parent e6c701a commit 5e68740
Show file tree
Hide file tree
Showing 58 changed files with 24,964 additions and 0 deletions.
113 changes: 113 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
############################
# OS X
############################

.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*


############################
# Linux
############################

*~


############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp


############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid


############################
# Logs and databases
############################

.tmp
*.log
*.sql
*.sqlite
*.sqlite3


############################
# Misc.
############################

*#
ssl
.idea
nbproject
public/uploads/*
!public/uploads/.gitkeep

############################
# Node.js
############################

lib-cov
lcov.info
pids
logs
results
node_modules
.node_history


############################
# Tests
############################

testApp
coverage

############################
# Strapi
############################

.env
exports
.cache
build
16 changes: 16 additions & 0 deletions backend/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HOST=0.0.0.0
PORT=1337
3 changes: 3 additions & 0 deletions backend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.cache
build
**/node_modules/**
27 changes: 27 additions & 0 deletions backend/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"es6": true,
"node": true,
"browser": false
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": false
},
"sourceType": "module"
},
"globals": {
"strapi": true
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}
3 changes: 3 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Strapi application

A quick description of your strapi application
Empty file added backend/api/.gitkeep
Empty file.
52 changes: 52 additions & 0 deletions backend/api/article/config/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/articles",
"handler": "article.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/articles/count",
"handler": "article.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/articles/:id",
"handler": "article.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/articles",
"handler": "article.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/articles/:id",
"handler": "article.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/articles/:id",
"handler": "article.delete",
"config": {
"policies": []
}
}
]
}
8 changes: 8 additions & 0 deletions backend/api/article/controllers/article.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};
8 changes: 8 additions & 0 deletions backend/api/article/models/article.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};
39 changes: 39 additions & 0 deletions backend/api/article/models/article.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"kind": "collectionType",
"collectionName": "articles",
"info": {
"name": "Article"
},
"options": {
"increments": true,
"timestamps": true
},
"attributes": {
"title": {
"type": "string",
"required": true
},
"content": {
"type": "richtext",
"required": true,
"minLength": 15
},
"image": {
"model": "file",
"via": "related",
"allowedTypes": [
"images"
],
"plugin": "upload",
"required": false
},
"published_at": {
"type": "date",
"required": true
},
"category": {
"model": "category",
"via": "articles"
}
}
}
8 changes: 8 additions & 0 deletions backend/api/article/services/article.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {};
52 changes: 52 additions & 0 deletions backend/api/category/config/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/categories",
"handler": "category.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/categories/count",
"handler": "category.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/categories/:id",
"handler": "category.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/categories",
"handler": "category.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/categories/:id",
"handler": "category.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/categories/:id",
"handler": "category.delete",
"config": {
"policies": []
}
}
]
}
8 changes: 8 additions & 0 deletions backend/api/category/controllers/category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};
8 changes: 8 additions & 0 deletions backend/api/category/models/category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};
22 changes: 22 additions & 0 deletions backend/api/category/models/category.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"kind": "collectionType",
"collectionName": "categories",
"info": {
"name": "category"
},
"options": {
"increments": true,
"timestamps": true
},
"attributes": {
"name": {
"type": "string",
"required": true,
"unique": true
},
"articles": {
"via": "category",
"collection": "article"
}
}
}
8 changes: 8 additions & 0 deletions backend/api/category/services/category.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {};
Loading

0 comments on commit 5e68740

Please sign in to comment.