Chimera is a platform that allows people to raise money for events ranging from life events such as celebrations and graduations to challenging circumstances like accidents and illnesses.. It is a fullstack React App made with a Redux state manager and a backend using Python, Flask, SQL-Alchemy, and PostgresSQL and any other technologies.
Table of Contents |
---|
1. Features |
2. Installation |
3. Technical Implementation Details |
4. Future Features |
5. Contact |
6. Special Thanks |
Chimera feed displays all projects and situations people need aid for. Discover and search for new projects to help build
Be able to view specific projects and its details
Add a new Projects to the database
On a specific project page, if you own the project, you are able to update your project details or delete the project.
You can give to support to project by hitting the support button, specifying an amount and leaving an optional comment.
Donations and comments will populate in the backers & donations section in the project page
In the backers & donations section, one can hit either the trash can icon to delete support or edit to update the comment posted.
To build/run project locally, please follow these steps:
- Clone this repository
git clone https://github.com/Simonvargas/chimera.git
- Install Pipfile dependencies and create the virtual environment
pipenv install
- Install npm dependencies for the
/react-app
cd react-app
npm install
-
In the
/
root directory, create a.env
based on the.env.example
with proper settings -
Setup your PostgreSQL user, password and database and ensure it matches your
.env
file -
Before running any flask commands, confirm you are in the pipenv virtual env. If not, run the command:
pipenv shell
- In the root folder, create the database by running in the terminal:
flask db create
- In the root folder, migrate tables to the database by running in the terminal:
flask db migrate
- In the root folder, seed the database by running in the terminal:
flask seed all
- Start the flask backend in the
/
root directory
flask run
- Start the frontend in the
/react-app
directory
npm start
Put is working by information being sent over through our store and updating our tables with the associated ID that has been sent over.
@project_routes.route('/edit/<int:id>', methods=['PUT'])
@login_required
def update_project(id):
res = Project.query.get(id)
form = ProjectForm()
res.user_id = form.data['user_id']
res.category_id = form.data['category_id']
res.name = form.data['name']
res.image = form.data['image']
res.details = form.data['details']
res.funding_goal = form.data['funding_goal']
db.session.commit()
return res.to_dict())
The donation post also updates the project funding amount which will automatically update the progress bar to reflect the change in the added amount
async function post(e){
e.preventDefault()
const updateAmount = Number(project.funding_raised) + Number(amount)
const updateBackers = Number(project.backers + 1)
const data = []
if (amount < 1 || amount.toString()[0] == 0) {
data.push('Your donation must be at least 1 one dollar')
}
if (hostId === project.user_id) {
data.push('You cannot donate to your own cause')
}
setErrors(data)
if (data.length === 0) {
await dispatch(backingActions.createBacking(hostId, id, amount, comment))
await dispatch(projectActions.editProjectFunding(updateAmount, updateBackers, id))
if (toggle) {
setToggle(false)
} else {
setToggle(true)
}
setShowForm2(false)
}
}
-
Search - search through a search bar will be implemented in order to provide a more user friendly experience
-
Second Feature - A like feature will be added to each project.