-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Languages/frameworks/libraries/services/APIs:
- Languages: React.js, Node.js, HTML, CSS
- Database: MySQL2
- Frontend Framework/Library: react.js, React Router
- Backend Framework/Library: Node.js, Express, MySQL2, Cors
- API/Services: Fetch api
- Other Common Libraries/Tools: Dotenv, Nodemon, Bcrypt.js
What package/build manager will you use: npm
List what each person will work on:
Frontend and backend - Everyone
This will be further determined as the project progess
We will deploy using a traditional web hosting service, such as DigitalOcean or Vercel (for the frontend). The backend (Node.js and SQL) will be hosted on DigitalOcean or another VPS service, while the frontend (React) will be deployed using Vercel for easier continuous deployment.
2. Are you using Virtual Machines (vmware, vbox, etc) or Containers (docker) for development or deployment? Explain.
For now, we are not using virtual machines or containers. The development environment will be set up locally using Node.js and SQL, running directly on each team member's computer. Each developer will use npm commands to start the backend and frontend.
ShapeShift is a SPA because we plan to load single HTML page that it’s content is updated as our user interacts with it. For ShapeShift we will have a basic outline of HTML page that includes a navigation bar, a logo, etc. that depending on the user interaction of the navigation bar and other buttons the content will update.
4. List of URLs you will implement. Explain any search arguments in English. Link (actual hyperlink) each URL to the page it shows in your Detailed Design milestone.
- shapeshift.com/
-
shapeshift.com/login
- GET render login page
- POST getting user from data
-
shapeshift.com/signup
- GET render sign up page
- POST add user to data
-
shapeshift.com/dashboard=id
- GET display dashboard according to user id
-
shapeshift.com/broswer
- GET render browse page
-
shapeshift.com/workout-plan=id
- GET display workout according to plan id
- POST add workout plan to user if they choose to with the subscribe button
-
shapeshift.com/dashboard=id/my-training
- GET render the ‘my training page’ according to user id
-
shapeshift.com/dashboard=id/profile
- GET render user profile
-
shapeshift.com/dashboard=id/trainer-profile
- GET render trainer profile
-
shapeshift.com/dashboard=id/program-content
- GET display the trainer’s plans
-
shapeshift.com/dashboard=id/program-analysis
- GET display the trainer’s plan analysis
-
shapeshift.com/dashboard=id/create-program
- GET renders create page
- POST the new workout created
5. If implementing a REST API, document it. List all methods, parameters, and give English description of what they do.
We won’t be using a REST API
6. The Views of your app. Embed the images from your Design Milestone. Typically, a webpage includes multiple views. For example, this webpage has a Header, Menu, and Content views (at least).












7. The Database schema: set of tables/documents with list of attributes and their types. Describe each table and attribute in English.
- Users - all the users of the web app
- userID - a user ID to identify which user is logged in
- VARCHAR(255) PRIMARY KEY
- Name - the user’s name
- VARCHAR(30)
- Email - the user’s email
- VARCHAR(255) NOT NULL
- Password - a password for the account (might try to hash it)
- VARCHAR(255) NOT NULL
- Birthday - the user’s birthday
- VARCHAR(10)
- Trainer - weather or not the user is a trainer
- BOOLEAN NOT NULL DEFAULT 0
- userID - a user ID to identify which user is logged in
- workoutPlanEnrolled - the relationship between the ‘Users’ and WorkoutPlans
- user_id - user id from the Users database
- INT
- workout_course_plan_id - plan id from WorkoutPlans database
- INT
- progress - where the user is at in the plan
- INT DEFAULT 0
- Other things in the schema
- PRIMARY KEY (user_id, workout_course_plan_id),
- FOREIGN KEY (user_id) REFERENCES users(userID),
- FOREIGN KEY (workout_course_plan_id) REFERENCES WorkoutPlans(planID)
- user_id - user id from the Users database
- WorkoutPlans - all the workout plans available
- planID - the workout plan id to identify which plan it is
- VARCHAR(255) PRIMARY KEY
- authorID - the id of the user that created this plan
- VARCHAR(255) FOREIGN KEY (authorID) REFERENCES users(userID)
- Title - the name of the plan
- VARCHAR(30) NOT NULL
- Description - a little blurb to describe the plan
- TEXT
- Level - the intensity of the plan
- ENUM('Beginner', 'Intermediate', 'Advanced') NOT NULL
- Type - what kind of workout is it
- VARCHAR(30)
- Location - where the workout can be done
- ENUM('At-homer', 'Gym') NOT NULL
- Schedule - the entire workout plan
- JSON (more flexible then a table). Will include week, day number, workout time, equipment, and video URL
- planID - the workout plan id to identify which plan it is
USERS:
- (not a trainer) INSERT INTO Users (userID, Name, Email, Password, Birthday, Trainer) VALUES ('someUserID', 'Emma Doe', 'emmadoe@example.com', 'hashedPassword', '2002-02-02', 0);
- (is a trainer) INSERT INTO Users (userID, Name, Email, Password, Birthday, Trainer) VALUES ('someUserID', 'JaneDoe', 'janedoe@example.com', 'hashedPassword', '2001-01-01', 1);
- SELECT userID, Name, Email, Birthday, Trainer FROM Users WHERE userID = ‘someUserID’;
- (query for login authentication only) SELECT Password FROM Users WHERE userID = 'someUserID';
WORKOUTPLAN ENROLLED:
- INSERT INTO workoutPlanEnrolled (userID, workout_course_plan_id, progress) VALUES ('someUserID', 'somePlanID', 0);
- SELECT wp.planID, wp.Title, wp.Description, wp.Level, wp.Type, wpe.progress FROM WorkoutPlans wp JOIN workoutPlanEnrolled wpe ON wp.planID = wpe.workout_course_plan_id WHERE wpe.user_id = 'someUserID';
WORKOUT PLANS:
- INSERT INTO WorkoutPlans (planID, authorID, Title, Description, Level, Type, Location, Schedule) VALUES ('plan123', 'author123', 'Beginner Abs Plan', 'A workout plan designed for beginners to build core and ab strength.', 'Beginner', 'Abs', 'Gym', '{"Week": 1, "Day": "Monday", "Workout time": "10:00 AM", "Equipment": "None", "Video": "link_to_video"}');
Selecting a workout plan that a user is enrolled in requires joining the WorkoutPlanEnrolled table with the WorkoutPlans table.