Giter VIP home page Giter VIP logo

m-e-platform's Introduction

It's a platform for YDRC (Youth Development Resources Center) in Hebron, Palestine. Which have many activities init, each activity have many students init and related to one program and one objective. So the app is made to handle these relations.

Problem statemanet:

YDRC manager is using excel sheets to track students, activities, programs, and objectives. So it's very hard to handle them because:

  1. The student may be duplicated, so he has to search for the user before add him as a new row to the excel sheet.
  2. The manager reuse the excel sheet created to create new one that shows the number of students on each activity, objective, or program.

Solution:

Web application, that handle all of students, activities, programs, and objectives relations. So students will be added one time and then set it's relation to many activities. Also when create the new activity, will relate it to program and objective. That means when we show activity page, the students in it will be appeard.

Function requirements:

The application is made for manager of the YDRC on this sprint, so he can:

  1. Add new students.
  2. Create new activity and relate it's objective and program.
  3. Create new program.
  4. Objectives will be added by database manager.
  5. View all of activities, programs and students lists.
  6. View one activity page which shows the students of it.
  7. View one program page, which shows activities init with number of stuents in each activity.
  8. On activity page, he/she is able to add/relate new students to the activity.

Key technologies:

Files structure:

For React App:

  |__ public
  |     |__ index.html
  |    
  |__ src
  |     |__ app.js
  |     |__ index.js
  |     |__ components
  |             |__ Header
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Form
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Button
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Table
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ AddButton
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__  AddAutoButton
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Pages
  |                    |__ CreateActivity 
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  ViewActivities
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  ActivityInformation
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  CreateStudent
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__   ViewStudents
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__   CreateProgram
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__   View Programs
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  Login page
  |                                |__ index.js
  |                                |__ index.css
  |         
  |__ .eslintrc
  |__ .babelrc
  |__ .gitignore
  |__ package.json
  |__ package-lock.json

For Express Server

  |__ src
  |     |__ mongoose.config.js
  |     |__ router.js
  |     |__ server.js
  |     |__ app.js
  |     |__ controllers
  |     |       |__ user.controller.js
  |     |       |__ program.controllers.js
  |     |       |__ objective.controllers.js
  |     |       |__ auth.controllers.js
  |     |       |__ activity.controllers.js
  |     |
  |     |__ middlewares
  |     |       |__ checkAuth.middleware.js
  |     |
  |     |__ validations
  |     |       |__ checkUser.validation.js
  |     |       |__ checkProgram.validation.js
  |     |       |__ checkActivity.validation.js
  |     |       |__ checkObjective.validation.js
  |     |
  |     |__ models 
  |             |__ User.model.js
  |             |__ Program.model.js
  |             |__ Activity.model.js
  |             |__ Objective.model.js
  |             |__ ActivitiesUser.model.js
  |             
  |__ .eslintrc
  |__ .gitignore
  |__ package.json
  |__ package-lock.json

m-e-platform's People

Contributors

amanshawar avatar fidaahersh avatar jema28 avatar m4v15 avatar mhmdtshref avatar razantayyem avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

razantayyem

m-e-platform's Issues

end-points

  • Home Page : '/'

  • Home Page : '/'

  • Home Page : '/'

  • Home Page : '/'

end-points

FRONT-END:

  • login Page : '/login'

When you open website

  • Home Page : '/'

When you login, you can see Header and Last of activities, programs, and students

  • activities Page : '/activities'

When you click on activities in Header, you can see all activities

  • addActivity Page : '/addActivity'

When you click on add activity button will redirect to addActivity page in programs, you can see a form

  • ActivityDetails Page : '/activityDetails/:id'

When you click on a activity in table will redirect to activityDetails Page, you can see details of this activity

  • programs: '/programs'

When you click on programs in Header, you can see all programs

  • addProgram Page : '/addProgram'

When you click on add program button will redirect to addProgram page in programs, you can see a form

  • programDetails Page : '/programDetails/:id'

When you click on a program in table will redirect to programDetails Page, you can see details of this program

  • users Page : '/users'

When you click on users in Header, you can see all users

  • addUser Page : '/addUser'

When you click on add user button will redirect to addUser page in programs, you can see a form

  • pageNotFound Page : '/pageNotFound'

When there is not any end-points from above

BACK-END:

  • login Page :POST '/login'

  • activities Page :GET '/activities'

  • activities Page :GET '/programs'

  • activities Page :GET '/users'

  • activities Page :GET '/objectives'

  • addActivity Page :POST '/addActivity'

When you click on Add button , After fill form it will stored to DB, and redirect to activities page

  • activities Page :POST '/addStudentToActivity'

When you click on Add button , After fill form it will stored to DB, and redirect to activities page

  • addProgram Page :POST '/addProgram'

When you click on Add button , After fill form it will stored to DB, and redirect to programs page

  • addUser Page :POST '/addUser'

When you click on Add button , After fill form it will stored to DB, and redirect to users page

Table no-rows-found and loading

  • Add noDataText and loading property to react-table Table component.
  • Pass noDataText and loading from our container Table component.
  • Each time we call the table, we need to add the properties noDataText and loading.

Database

Database

Database schema:

m e schema 2

Database queries:

  • get user by username and password:
    Need to check if the user exists in database users table, to check if he is authenticated (on login route).

  • Get activities:
    Need to return all activities from activities table on the database.

  • Add new activity
    Need to create new activity and set it into activities table of the database.

  • Add student to activity.
    Needs to create a new row on the activities_users table, to relate the user to the training.

  • Create new program
    Needs to create (insert) a new program into programs table of the database.

  • Add new user
    Needs to create new user into users table of the database.

  • Get programs
    Need to get list of programs from 'programs` table of the database.

  • Get activity by id
    Need to get activity details using its id.

  • Get program by id
    Need to view program details using its id

  • Get activities by program id
    Need to get list of activities that related to the program

  • Get activities by objective id
    Need to get list of activities that related to the objective.

  • Get students by activity id.
    Need to get all students related to activity id.

Validation for adding new activity

  • Create new file on src/validation/.
  • Create a function inside that have req, res, next parameters.
  • Check for the request body if it's valid or not.
  • if yes, run the next() function passed with parameters.
  • if not, send {success: false, err: 'Invalid inputs'}

Add table to one activity page

  • Add <StyledPage> to the ActivityInformation component.
  • Add <Table> component inside the styled page component.
  • Create an endpoint that get the student users from the database.
  • Handle the response and form the columns and data properties.
  • Add properties to the table component.
  • Also noDataText and loading properties will be required.

Tech stack

Front-end tech:

  • React
  • react-router-dom
  • react-table
  • styled-components
  • formik

Back-end tech:

  • ExpressJS
  • Mongoose (MongoDB).

Add new program fixed

  • Create add program page /addProgram in React Router

  • Create end point for addProgram Page

  • Add Header from Header component

  • Add program form using Form component.

  • Add Button.

add new user

Create add program page /addUser in React Router

Create end point for addUser Page

Add Header from Header component

Add User form using Form component.

Add Button.

Connect progamme with its details page

I want to connect each programme with its details so when the user press on programme name on programmes table will be redirected to new endpoint which has th details

Program information

  • Create initial ProgramInformation component.

  • Create initial ProgramDetails component

  • Use props to pass the program details.

  • Pass program details props from ProgramInformation to ProgramDetails.

  • Use props to create ProgramDetails component.

React Components

Shared components

  • Nav bar

  • Form

  • Button

  • Table

  • Add Button

Create activity page

  • Create Activity

  • Form (shared)

  • Button (shared)

create activity

View activities list

  • View Activities

  • Table (shared)

  • Add Button (shared)

activities-view

Activity information page

  • Activity information

  • Add students table

  • Add Button (shared)

activity page

Add student page

  • Create Student

  • Form (shared)

  • Button (shared)

create user

Students list page

  • View Students

  • Table (shared)

  • Add Button (shared)

users-page

Create program page

  • Create Program

  • Form (shared)

  • Button (shared)

create programme

Programs list page

  • View Programs

  • Table (shared)

  • Add Button.

programms-view

Login

  • Login page

  • Form (shared)

  • Button (shared)
    login

Add user to activity

  • Add initial form to activity information page.
  • Create new express route that get user name and response with list of search for the user, each user should have id, name and date of birth.
  • Handle the response and create list of fields.
  • Show the list on the suggested list of the inputs
  • connect the suggested inputs with the user name id, and if admin choose one, update the value of user id on the state.
  • Create new end point to add student to some activity )using activity and user ids.
  • Make a request that save the new user and handle it's result.

File Structures

For React App:

  |__ public
  |     |__ index.html
  |    
  |__ src
  |     |__ app.js
  |     |__ index.js
  |     |__ components
  |             |__ Header
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Form
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Button
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Table
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ AddButton
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__  AddAutoButton
  |             |      |__ index.js
  |             |      |__ index.css
  |             |
  |             |__ Pages
  |                    |__ CreateActivity 
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  ViewActivities
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  ActivityInformation
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  CreateStudent
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__   ViewStudents
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__   CreateProgram
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__   View Programs
  |                    |           |__ index.js
  |                    |           |__ index.css
  |                    |
  |                    |__  Login page
  |                                |__ index.js
  |                                |__ index.css
  |         
  |__ .eslintrc
  |__ .babelrc
  |__ .gitignore
  |__ package.json
  |__ package-lock.json

For Express Server

  |__ src
  |     |__ mongoose.config.js
  |     |__ router.js
  |     |__ server.js
  |     |__ app.js
  |     |__ controllers
  |     |       |__ user.controller.js
  |     |       |__ program.controllers.js
  |     |       |__ objective.controllers.js
  |     |       |__ auth.controllers.js
  |     |       |__ activity.controllers.js
  |     |
  |     |__ middlewares
  |     |       |__ checkAuth.middleware.js
  |     |
  |     |__ validations
  |     |       |__ checkUser.validation.js
  |     |       |__ checkProgram.validation.js
  |     |       |__ checkActivity.validation.js
  |     |       |__ checkObjective.validation.js
  |     |
  |     |__ models 
  |             |__ User.model.js
  |             |__ Program.model.js
  |             |__ Activity.model.js
  |             |__ Objective.model.js
  |             |__ ActivitiesUser.model.js
  |             
  |__ .eslintrc
  |__ .gitignore
  |__ package.json
  |__ package-lock.json

User Stories

  • As the manager of YDRC, I want to be able to see details of one activity in the YDRC.

  • As a YDRC manager, I want to be able to see all YDRC programs list.

  • As a YDRC manager, I want to be able to see the YDRC activities list.

  • As a YDRC manager, I want to be able to see a list of users that are part of the YDRC community.

  • As the manager of YDRC, I want to be able to see details of one program in the YDRC.

  • As the manager of YDRC, I want to be able to add a new program in the YDRC.

  • As the manager I want to be able to add a new activity related to program in the YDRC.

  • As the manager I want to be able to add a new person to the YDRC platform and pick their type (student/manager).

  • As the manager I want to be able to put a student in an activity in the YDRC.

  • As the manager of YDRC, I want to be able to download an excel version of my contact list.

  • As the manager of YDRC, I want to be able to upload an excel version of my contact list.

  • As the manager of YDRC,I want to be able to log out.

  • As the manager, I want to be able to browse YDRC objectives and programs under it.

  • As a YDRC manager, I want to be able to log in using a premade username and password.

  • As a YDRC manager, I want to be able to see statistics for all programs in the YDRC.

  • As the manager of YDRC,I want a secure site to store user data.

  • As the manager of YDRC,I want to be able to upload attendances as pdfs as a backup to refer to later.

  • As the manager I want to see a home page with the latest statistics on activities and contacts.

  • As the manager I want to be able to send alerts/messages to user list.

Site hosting

  • Host the site on Heroku & make sure it works well.

Add activity bug

When add new activity:

  • Place is not village or city, he can type anything he want.
  • Default values is not taken, it's taken just if we change it's value one time at least.

View programs fixed

  • View programs

  • Create view programs page /ViewProgram in React Router

  • Create end point for viewProgtam Page

  • Add Header from Header component

  • Add program table using Table component.

  • Add new program Button.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.