├── frontend ├── .gitignore ├── screenshots │ ├── MAT.png │ ├── LOGIN.png │ ├── ALUNOS.png │ ├── MAT CAD.png │ ├── PLANOS.png │ ├── ALUNO CAD.png │ ├── HELPORDER.png │ └── help order msg.png ├── src │ ├── assets │ │ ├── icon.png │ │ ├── img.png │ │ ├── logo.png │ │ ├── banner.png │ │ ├── bgauth.jpg │ │ ├── logoauth.png │ │ ├── background.jpg │ │ ├── background.png │ │ └── searchicon.png │ ├── services │ │ ├── history.js │ │ └── api.js │ ├── index.js │ ├── store │ │ ├── modules │ │ │ ├── rootReducer.js │ │ │ ├── order │ │ │ │ ├── actions.js │ │ │ │ └── sagas.js │ │ │ ├── registration │ │ │ │ ├── actions.js │ │ │ │ ├── reducer.js │ │ │ │ └── sagas.js │ │ │ ├── rootSaga.js │ │ │ ├── student │ │ │ │ ├── reducer.js │ │ │ │ ├── actions.js │ │ │ │ └── sagas.js │ │ │ ├── plan │ │ │ │ ├── actions.js │ │ │ │ └── sagas.js │ │ │ └── auth │ │ │ │ ├── actions.js │ │ │ │ ├── reducer.js │ │ │ │ └── sagas.js │ │ ├── persistReduce.js │ │ ├── createStore.js │ │ └── index.js │ ├── Pages │ │ ├── _layouts │ │ │ ├── default │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ └── auth │ │ │ │ ├── index.js │ │ │ │ └── styles.js │ │ ├── SignIn │ │ │ └── index.js │ │ ├── HelpOrders │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── Plans │ │ │ ├── styles.js │ │ │ └── index.js │ │ ├── Registrations │ │ │ ├── styles.js │ │ │ └── index.js │ │ └── Students │ │ │ ├── styles.js │ │ │ └── index.js │ ├── components │ │ ├── Footer │ │ │ ├── index.js │ │ │ └── styles.js │ │ ├── Modals │ │ │ ├── Order │ │ │ │ ├── Delete │ │ │ │ │ ├── index.js │ │ │ │ │ └── styles.js │ │ │ │ └── Register │ │ │ │ │ ├── index.js │ │ │ │ │ └── styles.js │ │ │ ├── Registration │ │ │ │ ├── Delete │ │ │ │ │ ├── index.js │ │ │ │ │ └── styles.js │ │ │ │ └── Register │ │ │ │ │ ├── styles.js │ │ │ │ │ └── index.js │ │ │ ├── Plan │ │ │ │ ├── Delete │ │ │ │ │ ├── index.js │ │ │ │ │ └── styles.js │ │ │ │ ├── Register │ │ │ │ │ ├── index.js │ │ │ │ │ └── styles.js │ │ │ │ └── Update │ │ │ │ │ ├── index.js │ │ │ │ │ └── styles.js │ │ │ └── Student │ │ │ │ ├── Delete │ │ │ │ ├── index.js │ │ │ │ └── styles.js │ │ │ │ ├── Update │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ │ │ └── Register │ │ │ │ ├── styles.js │ │ │ │ └── index.js │ │ └── Header │ │ │ ├── index.js │ │ │ └── styles.js │ ├── config │ │ └── ReactotronConfig.js │ ├── util │ │ └── util.js │ ├── Routes │ │ ├── index.js │ │ └── route.js │ ├── styles │ │ └── global.js │ └── App.js ├── .prettierrc ├── .editorconfig ├── public │ └── index.html ├── .eslintrc.js └── package.json ├── backend ├── .gitignore ├── src │ ├── app │ │ ├── views │ │ │ └── emails │ │ │ │ ├── answer.hbs │ │ │ │ ├── partials │ │ │ │ └── footer.hbs │ │ │ │ ├── welcome.hbs │ │ │ │ └── layouts │ │ │ │ └── default.hbs │ │ ├── models │ │ │ ├── Checkin.js │ │ │ ├── Plan.js │ │ │ ├── Student.js │ │ │ ├── Order.js │ │ │ ├── User.js │ │ │ └── Registration.js │ │ ├── jobs │ │ │ ├── AnswerMail.js │ │ │ └── RegistrationMail.js │ │ ├── Controllers │ │ │ ├── SessionController.js │ │ │ ├── StudentOrderController.js │ │ │ ├── UserController.js │ │ │ ├── CheckinController.js │ │ │ ├── GymOrderController.js │ │ │ ├── PlanController.js │ │ │ ├── StudentController.js │ │ │ └── RegistrationController.js │ │ └── middlewares │ │ │ └── auth.js │ ├── server.js │ ├── queue.js │ ├── tmp │ │ ├── util │ │ │ └── logo.png │ │ └── uploads │ │ │ └── 38c4274d9d8a1e72.jfif │ ├── config │ │ ├── auth.js │ │ ├── redis.js │ │ ├── mail.js │ │ └── database.js │ ├── database │ │ ├── migrations │ │ │ ├── 20200502210540-deleted-column.js │ │ │ ├── 20200506191453-add-file-column.js │ │ │ ├── 20200506191150-files.js │ │ │ ├── 20191214164118-checkins.js │ │ │ ├── __20200226223724-students.js │ │ │ ├── __20191212015127-plans.js │ │ │ ├── 20200217004451-create-user.js │ │ │ ├── 20191214182657-helporders.js │ │ │ └── 20191212232840-registrations.js │ │ ├── seeds │ │ │ └── 20200228011713-create-plan.js │ │ └── index.js │ ├── lib │ │ ├── Queue.js │ │ └── Mail.js │ ├── app.js │ └── routes.js ├── nodemon.json ├── .prettierrc ├── tmp │ └── uploads │ │ ├── 02ce80b6e0c501f7fce3.jpg │ │ ├── 07ef7e3ee04e066de24e.jpg │ │ ├── 1382d1b6782f3a8edfbf.jpg │ │ ├── 7d9d7551e5f7e37564dd.jpg │ │ ├── abe1f3e999f0bc71f421.jpg │ │ ├── 5c621684aae4e788d0586617305d2e72.jpg │ │ ├── 7d21ed04c7cf796ffbebe1e48a9d318d.jpg │ │ ├── 8370ad7a3a1c1906fd251ad5666a0dbd.jpg │ │ ├── 9f8cb2523aa18d2dae5e7a61b6ee802c.jpg │ │ ├── b9f663761a12dd82d3787efc5249992a.jpg │ │ ├── c8b58c7670be8bb3a4bfa000a1104aa0.jpg │ │ ├── d8686cd23fcdf13e55664812a012197d.jpg │ │ └── f97dc2889d4d0e7bec4fc0538215870b.jpg ├── .sequelizerc ├── .eslintrc.js └── package.json ├── screenshots ├── MAT.png ├── ALUNOS.png ├── LOGIN.png ├── MAT CAD.png ├── PLANOS.png ├── ALUNO CAD.png ├── HELPORDER.png └── help order msg.png └── README.md /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | .editorconfig 4 | 5 | -------------------------------------------------------------------------------- /backend/src/app/views/emails/answer.hbs: -------------------------------------------------------------------------------- 1 | 2 |

{{answer}}

3 | -------------------------------------------------------------------------------- /backend/src/app/views/emails/partials/footer.hbs: -------------------------------------------------------------------------------- 1 |
2 | Wolfzz 3 | -------------------------------------------------------------------------------- /backend/src/server.js: -------------------------------------------------------------------------------- 1 | import app from './app'; 2 | 3 | app.listen(3333); 4 | -------------------------------------------------------------------------------- /backend/nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "execMap": { 3 | "js": "sucrase-node" 4 | } 5 | } -------------------------------------------------------------------------------- /backend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5" 4 | } 5 | -------------------------------------------------------------------------------- /backend/src/queue.js: -------------------------------------------------------------------------------- 1 | import Queue from './lib/Queue'; 2 | 3 | Queue.processQueue(); 4 | -------------------------------------------------------------------------------- /screenshots/MAT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/MAT.png -------------------------------------------------------------------------------- /screenshots/ALUNOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/ALUNOS.png -------------------------------------------------------------------------------- /screenshots/LOGIN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/LOGIN.png -------------------------------------------------------------------------------- /screenshots/MAT CAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/MAT CAD.png -------------------------------------------------------------------------------- /screenshots/PLANOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/PLANOS.png -------------------------------------------------------------------------------- /screenshots/ALUNO CAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/ALUNO CAD.png -------------------------------------------------------------------------------- /screenshots/HELPORDER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/HELPORDER.png -------------------------------------------------------------------------------- /frontend/screenshots/MAT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/MAT.png -------------------------------------------------------------------------------- /frontend/src/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/icon.png -------------------------------------------------------------------------------- /frontend/src/assets/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/img.png -------------------------------------------------------------------------------- /frontend/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/logo.png -------------------------------------------------------------------------------- /backend/src/tmp/util/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/src/tmp/util/logo.png -------------------------------------------------------------------------------- /frontend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false, 4 | "trailingComma": "es5", 5 | } 6 | -------------------------------------------------------------------------------- /frontend/screenshots/LOGIN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/LOGIN.png -------------------------------------------------------------------------------- /frontend/src/assets/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/banner.png -------------------------------------------------------------------------------- /frontend/src/assets/bgauth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/bgauth.jpg -------------------------------------------------------------------------------- /screenshots/help order msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/screenshots/help order msg.png -------------------------------------------------------------------------------- /frontend/screenshots/ALUNOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/ALUNOS.png -------------------------------------------------------------------------------- /frontend/screenshots/MAT CAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/MAT CAD.png -------------------------------------------------------------------------------- /frontend/screenshots/PLANOS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/PLANOS.png -------------------------------------------------------------------------------- /frontend/src/assets/logoauth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/logoauth.png -------------------------------------------------------------------------------- /frontend/screenshots/ALUNO CAD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/ALUNO CAD.png -------------------------------------------------------------------------------- /frontend/screenshots/HELPORDER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/HELPORDER.png -------------------------------------------------------------------------------- /frontend/src/assets/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/background.jpg -------------------------------------------------------------------------------- /frontend/src/assets/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/background.png -------------------------------------------------------------------------------- /frontend/src/assets/searchicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/src/assets/searchicon.png -------------------------------------------------------------------------------- /frontend/screenshots/help order msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/frontend/screenshots/help order msg.png -------------------------------------------------------------------------------- /backend/src/tmp/uploads/38c4274d9d8a1e72.jfif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/src/tmp/uploads/38c4274d9d8a1e72.jfif -------------------------------------------------------------------------------- /backend/tmp/uploads/02ce80b6e0c501f7fce3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/02ce80b6e0c501f7fce3.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/07ef7e3ee04e066de24e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/07ef7e3ee04e066de24e.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/1382d1b6782f3a8edfbf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/1382d1b6782f3a8edfbf.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/7d9d7551e5f7e37564dd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/7d9d7551e5f7e37564dd.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/abe1f3e999f0bc71f421.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/abe1f3e999f0bc71f421.jpg -------------------------------------------------------------------------------- /backend/src/config/auth.js: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | 3 | export default { 4 | secret: process.env.AUTH_SECRET, 5 | expiresIn: '7d', 6 | }; 7 | -------------------------------------------------------------------------------- /backend/src/config/redis.js: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | 3 | export default { 4 | host: process.env.REDIS_HOST, 5 | port: process.env.REDIS_PORT, 6 | }; 7 | -------------------------------------------------------------------------------- /frontend/src/services/history.js: -------------------------------------------------------------------------------- 1 | import { createBrowserHistory } from 'history' 2 | 3 | const history = createBrowserHistory() 4 | 5 | export default history 6 | -------------------------------------------------------------------------------- /backend/tmp/uploads/5c621684aae4e788d0586617305d2e72.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/5c621684aae4e788d0586617305d2e72.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/7d21ed04c7cf796ffbebe1e48a9d318d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/7d21ed04c7cf796ffbebe1e48a9d318d.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/8370ad7a3a1c1906fd251ad5666a0dbd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/8370ad7a3a1c1906fd251ad5666a0dbd.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/9f8cb2523aa18d2dae5e7a61b6ee802c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/9f8cb2523aa18d2dae5e7a61b6ee802c.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/b9f663761a12dd82d3787efc5249992a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/b9f663761a12dd82d3787efc5249992a.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/c8b58c7670be8bb3a4bfa000a1104aa0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/c8b58c7670be8bb3a4bfa000a1104aa0.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/d8686cd23fcdf13e55664812a012197d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/d8686cd23fcdf13e55664812a012197d.jpg -------------------------------------------------------------------------------- /backend/tmp/uploads/f97dc2889d4d0e7bec4fc0538215870b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorCruzz/WOLFZZ/HEAD/backend/tmp/uploads/f97dc2889d4d0e7bec4fc0538215870b.jpg -------------------------------------------------------------------------------- /frontend/src/services/api.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | const api = axios.create({ 4 | baseURL: 'http://localhost:3333', 5 | }) 6 | 7 | export default api 8 | -------------------------------------------------------------------------------- /frontend/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import App from './App' 4 | 5 | ReactDOM.render(, document.getElementById('root')) 6 | -------------------------------------------------------------------------------- /frontend/src/store/modules/rootReducer.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | 3 | import auth from './auth/reducer' 4 | import student from './student/reducer' 5 | import registration from './registration/reducer' 6 | 7 | export default combineReducers({ auth, student, registration }) 8 | -------------------------------------------------------------------------------- /frontend/src/Pages/_layouts/default/styles.js: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components' 2 | 3 | import background from '../../../assets/background.png' 4 | 5 | export const Wrapper = styled.div` 6 | background: url(${background}) no-repeat; 7 | background-size: cover; 8 | height: 100%; 9 | width: 100%; 10 | ` 11 | -------------------------------------------------------------------------------- /frontend/src/store/modules/order/actions.js: -------------------------------------------------------------------------------- 1 | export function orderAnswer(data) { 2 | return { 3 | type: '@order/SEND_REPLY', 4 | payload: { data }, 5 | } 6 | } 7 | 8 | export const orderDelete = ({ id }) => { 9 | return { 10 | type: '@order/ORDER_DELETE', 11 | payload: { id }, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/config/mail.js: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | 3 | export default { 4 | host: process.env.MAIL_HOST, 5 | port: process.env.MAIL_PORT, 6 | secure: false, 7 | auth: { user: process.env.MAIL_USER, pass: process.env.MAIL_PASS }, 8 | default: { 9 | from: 'Equipe wolfzz { 3 | return queryInterface.addColumn('plans', 'deleted', { 4 | type: Sequelize.BOOLEAN, 5 | allowNull: false, 6 | defaultValue: false, 7 | }); 8 | }, 9 | 10 | down: () => {}, 11 | }; 12 | -------------------------------------------------------------------------------- /frontend/src/components/Footer/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Container } from './styles' 3 | 4 | import logo from '../../assets/logo.png' 5 | 6 | export default function Footer() { 7 | return ( 8 | 9 |
10 | logo 11 |
12 |
13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /backend/.sequelizerc: -------------------------------------------------------------------------------- 1 | const { resolve } = require('path') 2 | 3 | 4 | module.exports = { 5 | config: resolve(__dirname, 'src', 'config', 'database.js'), 6 | 'models-path': resolve(__dirname, 'src', 'app', 'models'), 7 | 'migrations-path': resolve(__dirname, 'src', 'database', 'migrations'), 8 | 'seeders-path': resolve(__dirname, 'src', 'database', 'seeds') 9 | } 10 | -------------------------------------------------------------------------------- /backend/src/config/database.js: -------------------------------------------------------------------------------- 1 | require('dotenv/config'); 2 | 3 | module.exports = { 4 | dialect: 'postgres', 5 | host: process.env.DB_HOST, 6 | username: process.env.DB_USER, 7 | password: process.env.DB_PASS, 8 | database: process.env.DB_NAME, 9 | define: { 10 | timestamps: true, 11 | underscored: true, 12 | underscoredAll: true, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /frontend/src/store/modules/registration/actions.js: -------------------------------------------------------------------------------- 1 | export const RegisterStore = ({ student_id, plan_id }) => { 2 | return { 3 | type: '@registration/STORE_REGISTER', 4 | payload: { student_id, plan_id }, 5 | } 6 | } 7 | 8 | export const DeleteRegistration = ({ id }) => { 9 | return { 10 | type: '@registration/DELETE_REGISTER', 11 | payload: { id }, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/app/views/emails/welcome.hbs: -------------------------------------------------------------------------------- 1 |
2 | Wolfzz 3 |

Olá {{ student }}, sejá bem vindo

4 |

5 | Dados da Matricula
6 | Plano: {{ plan }}
7 | Preço: R$ {{ price }}
8 | Validade até: {{ validate }} 9 |

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /frontend/src/store/persistReduce.js: -------------------------------------------------------------------------------- 1 | import storage from 'redux-persist/lib/storage' 2 | import { persistReducer } from 'redux-persist' 3 | 4 | export default reducers => { 5 | const persistedReducer = persistReducer( 6 | { 7 | key: 'wolfzzgym', 8 | storage, 9 | whitelist: ['auth'], 10 | }, 11 | reducers 12 | ) 13 | 14 | return persistedReducer 15 | } 16 | -------------------------------------------------------------------------------- /frontend/src/store/createStore.js: -------------------------------------------------------------------------------- 1 | import { createStore, compose, applyMiddleware } from 'redux' 2 | 3 | export default (reducers, middlewares) => { 4 | const enhancer = 5 | process.env.NODE_ENV === 'development' 6 | ? compose(console.tron.createEnhancer(), applyMiddleware(...middlewares)) 7 | : applyMiddleware(...middlewares) 8 | return createStore(reducers, enhancer) 9 | } 10 | -------------------------------------------------------------------------------- /backend/src/database/migrations/20200506191453-add-file-column.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | up: (queryInterface, Sequelize) => { 5 | return queryInterface.addColumn('students', 'file', 6 | { 7 | type: Sequelize.INTEGER, 8 | references: { model: 'files', key: 'id'}, 9 | onDelete: 'CASCADE' 10 | }); 11 | }, 12 | 13 | down: () => {} 14 | }; 15 | -------------------------------------------------------------------------------- /frontend/src/Pages/_layouts/auth/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import { Wrapper, Content } from './styles' 4 | 5 | export default function AuthLayout({ children }) { 6 | return ( 7 | 8 | {children} 9 | 10 | ) 11 | } 12 | 13 | AuthLayout.propTypes = { 14 | children: PropTypes.element.isRequired, 15 | } 16 | -------------------------------------------------------------------------------- /frontend/src/store/modules/rootSaga.js: -------------------------------------------------------------------------------- 1 | import { all } from 'redux-saga/effects' 2 | 3 | import auth from './auth/sagas' 4 | import student from './student/sagas' 5 | import plan from './plan/sagas' 6 | import order from './order/sagas' 7 | import registration from './registration/sagas' 8 | 9 | export default function* rootSaga() { 10 | return yield all([auth, student, plan, order, registration]) 11 | } 12 | -------------------------------------------------------------------------------- /frontend/src/store/modules/student/reducer.js: -------------------------------------------------------------------------------- 1 | import produce from 'immer' 2 | 3 | const INITIAL_STATE = { 4 | close: false, 5 | } 6 | 7 | export default function student(state = INITIAL_STATE, action) { 8 | return produce(state, draft => { 9 | switch (action.type) { 10 | case '@student/SIGNUP_SUCCESS': { 11 | draft.close = true 12 | break 13 | } 14 | default: 15 | } 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/app/models/Checkin.js: -------------------------------------------------------------------------------- 1 | import { Model } from 'sequelize'; 2 | 3 | class Checkin extends Model { 4 | static init(sequelize) { 5 | super.init( 6 | {}, 7 | { 8 | sequelize, 9 | } 10 | ); 11 | return Checkin; 12 | } 13 | 14 | static associate(models) { 15 | this.belongsTo(models.Student, { foreignKey: 'student_id', as: 'student' }); 16 | } 17 | } 18 | export default Checkin; 19 | -------------------------------------------------------------------------------- /frontend/src/config/ReactotronConfig.js: -------------------------------------------------------------------------------- 1 | import Reactotron from 'reactotron-react-js' 2 | import { reactotronRedux } from 'reactotron-redux' 3 | import reactotronSaga from 'reactotron-redux-saga' 4 | 5 | if (process.env.NODE_ENV === 'development') { 6 | const tron = Reactotron.configure() 7 | .use(reactotronRedux()) 8 | .use(reactotronSaga()) 9 | .connect() 10 | 11 | tron.clear() 12 | 13 | console.tron = tron 14 | } 15 | -------------------------------------------------------------------------------- /frontend/src/util/util.js: -------------------------------------------------------------------------------- 1 | export const PriceFormat = value => { 2 | const Currency = value.toLocaleString('pt-BR', { 3 | style: 'currency', 4 | currency: 'BRL', 5 | }) 6 | 7 | return Currency 8 | } 9 | 10 | export const Truncate = (value, size) => { 11 | const truncateValue = value.substr(0, size) 12 | 13 | if (truncateValue.length !== size) { 14 | return truncateValue 15 | } 16 | 17 | return `${truncateValue}...` 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/app/models/Plan.js: -------------------------------------------------------------------------------- 1 | import Sequelize, { Model } from 'sequelize'; 2 | 3 | class Plan extends Model { 4 | static init(sequelize) { 5 | super.init( 6 | { 7 | title: Sequelize.STRING, 8 | price: Sequelize.FLOAT, 9 | duration: Sequelize.INTEGER, 10 | deleted: Sequelize.BOOLEAN, 11 | }, 12 | { 13 | sequelize, 14 | } 15 | ); 16 | return Plan; 17 | } 18 | } 19 | export default Plan; 20 | -------------------------------------------------------------------------------- /frontend/src/components/Footer/styles.js: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components' 2 | 3 | export const Container = styled.footer` 4 | padding: 10px; 5 | height: 70px; 6 | background: rgba(7, 7, 7, 0.35); 7 | bottom: 0; 8 | position: absolute; 9 | width: 100%; 10 | display: flex; 11 | align-items: center; 12 | justify-content: center; 13 | border-top: 1px solid #777; 14 | 15 | div { 16 | img { 17 | height: 25px; 18 | } 19 | } 20 | ` 21 | -------------------------------------------------------------------------------- /backend/src/app/jobs/AnswerMail.js: -------------------------------------------------------------------------------- 1 | import Mail from '../../lib/Mail'; 2 | 3 | class AnswerMail { 4 | get key() { 5 | return 'AnswerMail'; 6 | } 7 | 8 | async handle({ data }) { 9 | const { answer, email } = data; 10 | Mail.sendMail({ 11 | to: email, 12 | subject: 'WOLFZZ GYM - RESPOSTA', 13 | template: 'answer', 14 | context: { 15 | answer, 16 | }, 17 | }); 18 | } 19 | } 20 | export default new AnswerMail(); 21 | -------------------------------------------------------------------------------- /backend/src/app/models/Student.js: -------------------------------------------------------------------------------- 1 | import Sequelize, { Model } from 'sequelize'; 2 | 3 | class Student extends Model { 4 | static init(sequelize) { 5 | super.init( 6 | { 7 | name: Sequelize.STRING, 8 | email: Sequelize.STRING, 9 | age: Sequelize.STRING, 10 | height: Sequelize.STRING, 11 | weight: Sequelize.STRING, 12 | }, 13 | { 14 | sequelize, 15 | } 16 | ); 17 | return Student; 18 | } 19 | } 20 | export default Student; 21 | -------------------------------------------------------------------------------- /backend/src/app/Controllers/SessionController.js: -------------------------------------------------------------------------------- 1 | import Student from '../models/Student'; 2 | 3 | class SessionController { 4 | async store(req, res) { 5 | const { id } = req.body; 6 | 7 | const student = await Student.findOne({ 8 | where: { id }, 9 | }); 10 | 11 | if (!student) { 12 | return res.status(400).json({ error: 'ID inválido' }); 13 | } 14 | 15 | return res.json({ 16 | student, 17 | }); 18 | } 19 | } 20 | 21 | export default new SessionController(); 22 | -------------------------------------------------------------------------------- /frontend/src/store/modules/registration/reducer.js: -------------------------------------------------------------------------------- 1 | import produce from 'immer' 2 | 3 | const INITIAL_VALUE = { 4 | download: false, 5 | close: false, 6 | } 7 | 8 | export default function registration(state = INITIAL_VALUE, action) { 9 | return produce(state, draft => { 10 | switch (action.type) { 11 | case '@registration/STORE_REGISTER_SUCCESS': { 12 | draft.download = true 13 | draft.close = true 14 | break 15 | } 16 | default: 17 | } 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/app/views/emails/layouts/default.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Wolfzz 6 | 7 | 19 | 20 |
21 | {{{ body }}} 22 | {{> footer}} 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /frontend/src/store/modules/plan/actions.js: -------------------------------------------------------------------------------- 1 | export function registerPlan({ title, price, duration }) { 2 | return { 3 | type: '@plan/REGISTER_PLAN', 4 | payload: { title, price, duration }, 5 | } 6 | } 7 | 8 | export function deletePlan({ id }) { 9 | return { 10 | type: '@plan/DELETE_PLAN', 11 | payload: { id }, 12 | } 13 | } 14 | 15 | export function updatePlan({ id, title, price, duration }) { 16 | return { 17 | type: '@plan/UPDATE_PLAN', 18 | payload: { id, title, price, duration }, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /backend/src/app/models/Order.js: -------------------------------------------------------------------------------- 1 | import Sequelize, { Model } from 'sequelize'; 2 | 3 | class Order extends Model { 4 | static init(sequelize) { 5 | super.init( 6 | { 7 | question: Sequelize.STRING, 8 | answer: Sequelize.STRING, 9 | answer_at: Sequelize.DATE, 10 | }, 11 | { sequelize } 12 | ); 13 | return Order; 14 | } 15 | 16 | static associate(models) { 17 | this.belongsTo(models.Student, { foreignKey: 'student_id', as: 'student' }); 18 | } 19 | } 20 | export default Order; 21 | -------------------------------------------------------------------------------- /frontend/src/Pages/_layouts/default/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | import { Wrapper } from './styles' 5 | import Header from '../../../components/Header' 6 | import Footer from '../../../components/Footer' 7 | 8 | export default function DefaultLayout({ children }) { 9 | return ( 10 | 11 |
12 | {children} 13 |