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

Better code structure #166

Open
wildan3105 opened this issue Oct 3, 2020 · 2 comments · Fixed by #167
Open

Better code structure #166

wildan3105 opened this issue Oct 3, 2020 · 2 comments · Fixed by #167

Comments

@wildan3105
Copy link
Owner

wildan3105 commented Oct 3, 2020

Current behavior:
Currently, because the repo is full-stack which means frontend and backend are stored in the same repo, the folder structure is a bit messy. So we need to re-structure the folder & files based on the best practice while still not breaking any functionality. Also, in the future, I prefer to move from template engine to a js frontend framework like react. So we need to make this to be future proof or at least make it easy towards that goal.

Expected behavior:
Proposed solution:

├── public --> only store static files (image, json file, localization)
│   ├── css
│   └── image
│   └── json
│   └── js (this to make it backward compatible for public utils)
├── src --> store "full-stack" files but differentiate it on the child folder
│   ├── index.js -> boot file
│   ├── api -> backend-related files
│   ├── ├── app.js
│   └── ├── controller.js
│   └── ├── routes.js
│   └── ├── service.js
│   ├── pages -> frontend, template engine files
│   └── ├── layouts
│   └── ├── partials
│   └── ├── index.handlebars
│   ├── utils --> store all utilization file
│   ├── ├── emoji_generator.js
│   ├── ├── language_colors_generator.js
├── config --> store all configuration files
│   ├── api_url.js
│   ├── error_messages.js
│   ├── statements.js
├── tests --> store all unit tests
└── .github/
└── .editorconfig
└── .eslintrc.json
└── .gitignore
└── .travis.yml
└── CODE_OF_CONDUCT.md
└── CONTRIBUTING.md
└── gulpfile.js
└── LICENSE
└── package-lock.json
└── package.json
└── README.md
└── screenshot.png

Please help to suggest something 😃

@wildan3105
Copy link
Owner Author

@wildan3105
Copy link
Owner Author

PHASE 1 is done

PHASE 2 goals:

  • move all github API calls to src/api/service.js
  • improve logic in src/api/controller.js, especially data manipulation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant