0% found this document useful (0 votes)
6 views

Full Stack

fitness and traker application project with source code

Uploaded by

Pranali Balwante
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Full Stack

fitness and traker application project with source code

Uploaded by

Pranali Balwante
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

What is Full-Stack Development?

Full-Stack Development refers to the practice of


working on both the front-end and back-end
aspects of a web application. It involves handling
client-side (front-end) technologies such as HTML,
CSS, and JavaScript, as well as server-side (back-
end) technologies like databases, server
frameworks, and APIs. Full-Stack Developers are
proficient in multiple programming languages
and frameworks, allowing them to handle various
layers of the application stack.
Who is a Full-Stack Developer?

In the dynamic world of software development, a full-stack developer plays a


crucial role. A full-stack developer is an IT professional who possesses a diverse
skill set and expertise in both front-end and back-end development. Full-stack
developers possess expertise in front-end technologies, enabling them to create
visually captivating user interfaces that are responsive, interactive, and user-
friendly. Collaborating closely with designers, they transform visual concepts
into practical and captivating web interfaces that enhance the user experience.

Full-stack developers can carry out server-side development work if they are
proficient in back-end programming languages like Node.js, Python, or Ruby.

In addition, Full-stack engineers possess comprehensive knowledge of database


management systems such as MySQL, MongoDB, or PostgreSQL. They are
proficient in creating complex queries, constructing and implementing efficient
database architectures, and ensuring precise data storage and retrieval.
Fitness and Workout Tracking Application

The Fitness and Workout Tracking Application is a comprehensive software


development project aimed at assisting users in monitoring and organizing their
fitness endeavors. It assists users in establishing goals and tracking progress.
This application offers a robust platform that empowers individuals to cultivate a
healthy lifestyle, enhance their fitness levels, and sustain motivation throughout
their fitness journey.

Working:

The Fitness and Workout Tracking Application operates as a mobile or web-


based platform with a frontend and backend architecture. The front end
provides an intuitive user interface to log workouts, track progress, and access
fitness-related resources. The backend handles data storage, analysis, and
personalized recommendations.

Salient Key Features:

 Workout Logging and Tracking: Users can log diverse workout types,
encompassing cardio, strength training, and flexibility exercises, within the
application. They can record the duration, intensity, and specific exercises
undertaken. The application furnishes a comprehensive workout history,
enabling users to monitor their progress and development over time.
 Goal Setting and Progress Monitoring: Users can set fitness goals, like
muscle gain, weight loss, or completing a specific distance or time for a run.
The application tracks users’ progress toward their goals and provides visual
representations, such as charts or graphs, to showcase achievements and
motivate further improvement.
 Personalized Fitness Plans: The platform provides customized fitness plans
tailored to users’ objectives, fitness levels, and preferences. These plans
encompass workout routines, meal suggestions, and guidance on exercises
or activities to address specific areas of improvement.
 Workout Reminders and Notifications: The application allows users to set
reminders for their workouts, ensuring they stay consistent and committed
to their fitness routine. Users can receive notifications for upcoming
workouts, goal milestones, or fitness-related tips and articles.
 Community and Social Features: The platform incorporates social
functionalities, enabling users to connect with friends, participate in fitness
challenges, and share their achievements. These features foster a sense of
community, stimulate healthy competition, and establish a user-support
network.

Technology Used:

The Fitness and Workout Tracking Application utilizes a combination of frontend


and backend technologies to deliver a robust and user-friendly fitness platform.
Some of the key technologies employed are:

Frontend:

 React Native (for mobile applications) or React.js (for web applications)


 Redux
 CSS framework

Backend:

 Node.js
 Express.js
 MongoDB or MySQL
 Mongoose (for MongoDB) or Sequelize (for MySQL)
APIs and Integrations:

 Fitness tracking APIs (such as Google Fit or Apple HealthKit)


 Push notification APIs

App.js
import React from 'react';

import { Provider } from 'react-redux';

import { createStore } from 'redux';

import { SafeAreaView, StyleSheet } from 'react-native';

import { RootReducer } from './src/reducers';

import { WorkoutList } from './src/components/WorkoutList';

import { AddWorkout } from './src/components/AddWorkout';

const store = createStore(RootReducer);

const App = () => {

return (

<Provider store={store}>

<SafeAreaView style={styles.container}>

<WorkoutList />

<AddWorkout />

</SafeAreaView>

</Provider>

);

};

const styles = StyleSheet.create({

container: {

flex: 1,

padding: 20,

},

});
export default App;

src/reducers/index.js
import { combineReducers } from 'redux';

import { workoutReducer } from './workoutReducer';

export const RootReducer = combineReducers({

workouts: workoutReducer,

});

src/reducers/workoutReducer.js

javascript

Copy code

const initialState = [];

export const workoutReducer = (state = initialState, action) => {

switch (action.type) {

case 'ADD_WORKOUT':

return [...state, action.payload];

default:

return state;

};

src/actions/index.js

export const addWorkout = (workout) =>


({ type: 'ADD_WORKOUT', payload: workout, });

src/components/WorkoutList.js

import React from 'react';

import { useSelector } from 'react-redux';

import { View, Text, StyleSheet } from 'react-native';

export const WorkoutList = () => {

const workouts = useSelector((state) => state.workouts);

return (

<View style={styles.list}>

{workouts.map((workout, index) => (

<Text key={index} style={styles.workout}>

{workout.name} - {workout.duration} mins

</Text>

))}

</View>

);

};

const styles = StyleSheet.create({

list: {

flex: 1,

marginTop: 20,

},

workout: {

padding: 10,

borderBottomWidth: 1,

borderBottomColor: '#ccc',
},

});

src/components/AddWorkout.js

import React, { useState } from 'react';

import { useDispatch } from 'react-redux';

import { addWorkout } from '../actions';

import { View, TextInput, Button, StyleSheet } from 'react-native';

export const AddWorkout = () => {

const [name, setName] = useState('');

const [duration, setDuration] = useState('');

const dispatch = useDispatch();

const handleAddWorkout = () => {

dispatch(addWorkout({ name, duration }));

setName('');

setDuration('');

};

return (

<View style={styles.form}>

<TextInput

style={styles.input}

placeholder="Workout Name"

value={name}

onChangeText={setName}

/>

<TextInput

style={styles.input}
placeholder="Duration (mins)"

value={duration}

onChangeText={setDuration}

/>

<Button title="Add Workout" onPress={handleAddWorkout} />

</View>

);

};

const styles = StyleSheet.create({

form: {

padding: 20,

backgroundColor: '#fff',

borderRadius: 10,

shadowColor: '#000',

shadowOpacity: 0.2,

shadowRadius: 5,

shadowOffset: { width: 0, height: 2 },

},

input: {

marginBottom: 10,

padding: 10,

borderWidth: 1,

borderColor: '#ccc',

borderRadius: 5,

},

});

2. Backend: Node.js with Express.js

const express = require('express');


const mongoose = require('mongoose');

const cors = require('cors');

const app = express();

const PORT = 5000;

app.use(cors());

app.use(express.json());

mongoose.connect('mongodb://localhost:27017/workoutDB', { useNewUrlParser: true,


useUnifiedTopology: true })

.then(() => console.log('MongoDB connected'))

.catch((err) => console.error(err));

const workoutSchema = new mongoose.Schema({

name: String,

duration: Number,

});

const Workout = mongoose.model('Workout', workoutSchema);

app.get('/workouts', async (req, res) => {

const workouts = await Workout.find();

res.json(workouts);

});

app.post('/workouts', async (req, res) => {

const newWorkout = new Workout(req.body);

await newWorkout.save();

res.json(newWorkout);

});
app.listen(PORT, () => {

console.log(`Server running on port ${PORT}`);

});

3. MongoDB Setup

Make sure MongoDB is installed and running. Use the following command to start
MongoDB

Mongod

Running the Application

1. Frontend

cd frontend

npm install

npm start

2. Backend

cd backend

npm install

node server.js

You might also like