owned this note
owned this note
Published
Linked with GitHub
# Gym
## Descreption
The application is a community and store for the gym. Via the system user can view available classes in the gym, join classes, and use the store to order items from the gym.
## React-App
### Pages
#### Admin
- home
- user
- products
- classes
- orders
- announcement
- subscription
#### Client
- Home page
- Store
- Sign up
- Sign in
- Anouncments
- Profile
- profile setting
- Class page
- single prouct page
### components
#### Admin
- sidebar
- adminnav
- search input
- table
- form
- edit remove dev
- card product order
- statistic
#### Client
- Header
- Footer
- Trainers list
- Trainer card
- Products list
- Product card
- Categories list
- Category card
- Signup form
- input
- primary button
- secondary button
- alert
- Sign in form
- classes table in proifle page
- class card in classes table
- products list in profile page
- product card in profile page
- profile info
- user info setting
- trainer info
- classes list
- class card
- class shcedule
- single product page compoent
- review compoent
## User story
### admin
<!-- 1. Admin can view subscriptions
2. Admin can view orders
3. Admin Approve or reject subscriptions
4. Admin can Approve or reject or mark as complete on products
5. Admin can CRUD product listing
6. Admin can CRUD Subscriptions / classes
7. Admin can promote / demote users to trainers
8. Admin can view Analytics ( ex: profit, revenue, users activity ) -->
1. The admin has a dashboard where he can manage the website
2. in the dashboard, there is a side bar where he can navigete to the following section: Home, Classes, Users, Orderes, products, subscriptions, create products, crate trainers, and crate calss
3. in the home page, the admin can view the website analytics and statistics
4. in the users page, the admin can view, remove, and pend users
5. in the products page, the user can add products
6.
### user
1. User can sign up using his email, he has to enter his info such as wight, age, gender, .. etc. He has to fill all fields corrctly
2. uer can sign in with his email and password
3. after signing in, he will be redirected to the home page
4. in the navbar, the user can niviage to the store, classes, chat, announcements, or out tames page. Also, when he click on his picture, a drop down list will appear from which he can log out or to go to his profile
5. also, he can find information about the trainers in the home page
6. When the user navigate to the clasess page, he can move between caless from a side bar, in the page, he will see information about the instructor, the scedule, and the class discription. He can also join the class.
7. When the user navigate to the announcements page, he can see the announcments that the admon wrote and like/comment them. also, he can view the comments made by other users
8. when the user click on store, he will be derected to the store page. in this page, he will see the products
9. the user can filter the products by category, also he can click on them to see more details
10. after he click on the item, he will be redirected to the single product page, in this page, he can see more details, order the product, and review it.
11. when the user go to his profile from the drop down menur in the navbar, he will go to the prfile page
12. in the profile page, he will see his picture, email, and name. hi can cick on clasess button to see the calsses he is enrolled in, also he can click on products to see the products he orderred
13. the user can click on profile info to go to anotehr page will all his information
14. in the profile info page, he can edit or delte his info
16. Users can subscribe to classes
17. Users can order products
18. Users can cancel orders
19. Users can withdraw from classes
### Trainer
1. limited access to dashboard ( ex: Trainer can view data but can't update or delete )
API endpoints
DB analysis => Schema {
properties,
ref
}
API endpoints :
0. main router
```
- router.use('/products',productRouter)
- router.use('/categories',categoryRouter)
- router.use('/orders', orderRouter)
- router.use('/announcements', announcementRouter)
- router.use('/subscriptions', subscriptionRouter)
- router.use('/comments', commentRouter)
- router.use('/rates', rateRouter)
- router.use('/classes', classeRouter)
-router.use('/users',userRouter)
```
1. users => Heleena
```
- userRouter.post('/',createUser)
- userRouter.get('/',getUsers)
- userRouter.get('/:id',getUserById)
- userRouter.get('/role/:role',getUserByRole)
- userRouter.put('/:id',updateUser)
- userRouter.delete('/:id',deleteUser)
```
2. Products => Abeer
```
- productRouter.post('/',createProduct)
- productRouter.get('/',getProduct)
- productRouter.get('/:id',getProductById)
- prouctRouter.put('/:id',updateProduct)
- productRouter.delete('/:id',deleteProduct)
- productRouter.get('/?category=category',getProductByCategory)
```
3. categories =>Abeer
```js
- categoryRouter.post('/',createCategory)
- categoryRouter.get('/', getCategory)
- categoryRouter.put('/:id',updateCategory)
- categoryRouter.delete('/:id',deleteCategory)
```
4. classes => Ahmed
```js
- classeRouter.post('/',newClass)
- classeRouter.get('/',classList)
- classeRouter.get('/:id',oneClass)
- classeRouter.put('/:id',classEdit)
- classeRouter.delete('/:id', classDeletion)
```
5. orders =>
```
- orderRouter.post('/:productid/:id', createOrder)//userId from auth
- orderRouter.get('/', getOrders)
- orderRouter.get('/:userId', getOrder)
- orderRouter.put('/:id', updateOrder) //userId from auth
- orderRouter.delete('/:id', removeOrder)
```
6. announcements => Abeer
```
- announcementRouter.post('/:roleId', createAnnouncement)
- announcementRouter.get('/',getAnnouncements);
- announcementRouter.put('/:id',updateAnnouncement)
- announcementRouter.delete('/:id',deleteAnnouncement)
- announcementRouter.get('/:id',getAnnouncementById);
```
7. rates =>
```
- router.post('/:productid', createRate)
- router.get('/', getRates)
- router.get('/:productid', getRate)
- router.put('/:id/:productid', updateRate)
- router.delete('/:id', removeRate)
```
8. subscriptions =>
```
- router.post('/:classId', createSubscription)
- router.get('/', getSubscriptions)
- router.get('/:classId', getSubscription)
- router.put('/:classId', updateSubscription)
- router.delete('/:classId', removeSubscription)
```
9. comments =>
- router.post('/:announcementid', createComment)
- router.get('/', getComments)
- router.get('/:id', getComment)
- router.put('/:id', updateComment)
- router.delete('/:id', removeComment)
Notes to be fixed:-
- Description should be added to the product schema.
- Custom error interface