├── Procfile ├── .gitignore ├── frontend ├── public │ ├── robots.txt │ ├── manifest.json │ └── index.html ├── src │ ├── styles │ │ ├── YoutubeVideo.css │ │ ├── LandingImage.css │ │ ├── WriteUp.css │ │ ├── NavBar.css │ │ ├── Footer.css │ │ ├── Donation.css │ │ └── Header.css │ ├── index.js │ ├── index.css │ ├── components │ │ ├── YoutubeVideo.js │ │ ├── LandingImage.js │ │ ├── NavBar.js │ │ ├── Header.js │ │ ├── WriteUp.js │ │ ├── Footer.js │ │ └── Donation.js │ └── App.js ├── .gitignore ├── package.json ├── .eslintcache └── README.md ├── README.md ├── routes └── paystackRouters.js ├── package.json ├── server.js └── controllers └── paystackControllers.js /Procfile: -------------------------------------------------------------------------------- 1 | web: node server.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | 3 | .env -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /frontend/src/styles/YoutubeVideo.css: -------------------------------------------------------------------------------- 1 | .youtube__container { 2 | margin: 20px auto; 3 | max-width: 95%; 4 | } 5 | -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "theme_color": "#000000", 7 | "background_color": "#ffffff" 8 | } 9 | -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import "./index.css"; 4 | import App from "./App"; 5 | 6 | ReactDOM.render( 7 | 8 | 9 | , 10 | document.getElementById("root") 11 | ); 12 | -------------------------------------------------------------------------------- /frontend/src/styles/LandingImage.css: -------------------------------------------------------------------------------- 1 | .landingPage__container > * { 2 | height: 50vh; 3 | width: 100%; 4 | object-fit: cover; 5 | margin-top: 30px; 6 | } 7 | 8 | @media only screen and (max-width: 600px) { 9 | .landingPage__container > * { 10 | height: 70vh; 11 | width: 100%; 12 | object-fit: cover; 13 | margin-top: 20px; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Charity-Donation 2 | This Is A Charity Website (DONATION) built for an NGO with the MERN stack which consumes PAYSTACK payment gateway API to receive real time money 3 | 4 | #Installing And Running 5 | -git clone 6 | 7 | #In The Root Directory 8 | npm install and run npm start 9 | 10 | #cd frontend 11 | npm install and run npm start 12 | 13 | This makes you all dependencies the backend and frontend server 14 | 15 | 16 | -------------------------------------------------------------------------------- /routes/paystackRouters.js: -------------------------------------------------------------------------------- 1 | import express from "express"; 2 | import { 3 | INITIALIZE_A_TRANSACTION, 4 | VERIFY_A_TRANSACTION, 5 | } from "../controllers/paystackControllers.js"; 6 | const paystackRouters = express.Router(); 7 | 8 | // Route To Initialize Transaction 9 | paystackRouters.post("/initialize-transaction", INITIALIZE_A_TRANSACTION); 10 | 11 | // Route To Verify A Transaction 12 | paystackRouters.get("/verify-transaction", VERIFY_A_TRANSACTION); 13 | 14 | export default paystackRouters; 15 | -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | Adike Charity Home 11 | 12 | 13 | 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /frontend/src/styles/WriteUp.css: -------------------------------------------------------------------------------- 1 | .writeup__container { 2 | max-width: 95%; 3 | margin: 10px auto; 4 | } 5 | 6 | .writeup__container h1 { 7 | font-weight: lighter; 8 | margin-bottom: 20px; 9 | } 10 | 11 | .writeup__container p { 12 | font-weight: 50; 13 | font-size: 1rem; 14 | } 15 | 16 | .writeup__container p a { 17 | color: #f17424; 18 | } 19 | 20 | .writeup__donate__button { 21 | margin-top: 20px; 22 | } 23 | 24 | .writeup__donate__button a { 25 | background: #f17424; 26 | padding: 10px 24px; 27 | color: #ffffff; 28 | font-weight: 700; 29 | } 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "type": "module", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "start": "node server.js", 10 | "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm run build --prefix frontend" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "axios": "^0.21.1", 16 | "dotenv": "^8.2.0", 17 | "express": "^4.17.1", 18 | "mongoose": "^5.11.13" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /frontend/src/index.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@500;700&display=swap"); 2 | @import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300&display=swap"); 3 | 4 | * { 5 | margin: 0; 6 | padding: 0; 7 | box-sizing: border-box; 8 | transition: 0.2s; 9 | } 10 | 11 | h1 { 12 | font-family: "Roboto", sans-serif; 13 | } 14 | 15 | p { 16 | font-family: "Noto Sans JP", sans-serif; 17 | } 18 | 19 | .main__container { 20 | max-width: 90%; 21 | margin: 0 auto; 22 | } 23 | 24 | a { 25 | text-decoration: none; 26 | } 27 | 28 | iframe { 29 | width: 100%; 30 | } 31 | -------------------------------------------------------------------------------- /frontend/src/styles/NavBar.css: -------------------------------------------------------------------------------- 1 | .main__container .nav__links { 2 | z-index: 1; 3 | } 4 | 5 | .nav__links { 6 | list-style: none; 7 | font-size: 1.6rem; 8 | } 9 | 10 | .main__container .nav__links { 11 | background-color: #ccc; 12 | padding: 0 20px; 13 | width: 100%; 14 | 15 | text-align: center; 16 | color: #ffffff; 17 | font-weight: 500; 18 | padding: 10px; 19 | } 20 | 21 | .nav__links li { 22 | margin-top: 20px; 23 | } 24 | 25 | .nav__links li a { 26 | color: #ffffff; 27 | } 28 | 29 | .links__donate__btn { 30 | background-color: #f17424; 31 | color: #ffffff; 32 | padding: 8px 18px; 33 | border: none; 34 | border-radius: 33px; 35 | } 36 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | import dotenv from "dotenv"; 2 | dotenv.config(); 3 | import express from "express"; 4 | import paystackRouters from "./routes/paystackRouters.js"; 5 | import path from "path"; 6 | 7 | const app = express(); 8 | const port = process.env.PORT || 8080; 9 | 10 | app.use(express.json()); 11 | 12 | app.use("/api/payment", paystackRouters); 13 | 14 | const __dirname = path.resolve(); 15 | 16 | app.use(express.static(path.join(__dirname + "/frontend/build"))); 17 | 18 | app.get("*", (req, res) => { 19 | res.sendFile(path.join(__dirname, "frontend", "build", "index.html")); 20 | }); 21 | 22 | app.listen(port, () => console.log(`App is running on port ${port}`)); 23 | -------------------------------------------------------------------------------- /frontend/src/components/YoutubeVideo.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "../styles/YoutubeVideo.css"; 3 | 4 | const YoutubeVideo = () => { 5 | return ( 6 |
7 |
8 | 17 |
18 |
19 | ); 20 | }; 21 | 22 | export default YoutubeVideo; 23 | -------------------------------------------------------------------------------- /frontend/src/styles/Footer.css: -------------------------------------------------------------------------------- 1 | .footer__features ul { 2 | list-style: none; 3 | } 4 | 5 | .footer__features ul li { 6 | margin-top: 5px; 7 | } 8 | footer { 9 | display: flex; 10 | justify-content: space-between; 11 | align-items: center; 12 | background-color: #eff1f7; 13 | color: #333; 14 | padding: 3% 10px; 15 | margin: 0 auto; 16 | } 17 | 18 | .footer__socials > * { 19 | color: #333; 20 | margin-left: 7px; 21 | } 22 | 23 | @media only screen and (max-width: 600px) { 24 | footer { 25 | display: flex; 26 | flex-direction: column; 27 | justify-content: center; 28 | align-items: center; 29 | } 30 | 31 | .footer__items { 32 | margin-top: 20px; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/src/components/LandingImage.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "../styles/LandingImage.css"; 3 | 4 | const LandingImage = () => { 5 | return ( 6 |
7 |
8 | 12 |
13 |
14 | ); 15 | }; 16 | export default LandingImage; 17 | -------------------------------------------------------------------------------- /frontend/src/components/NavBar.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { NavLink } from "react-router-dom"; 3 | import "../styles/NavBar.css"; 4 | 5 | const NavBar = () => { 6 | return ( 7 | 26 | ); 27 | }; 28 | 29 | export default NavBar; 30 | -------------------------------------------------------------------------------- /frontend/src/styles/Donation.css: -------------------------------------------------------------------------------- 1 | form { 2 | width: 100%; 3 | margin-top: 15px; 4 | } 5 | 6 | input[type="text"], 7 | input[type="email"], 8 | input[type="Number"] { 9 | width: 100%; 10 | padding: 12px 26px; 11 | margin-top: 5px; 12 | } 13 | 14 | .form__group { 15 | margin-bottom: 20px; 16 | } 17 | 18 | .form__group button { 19 | padding: 10px 15px; 20 | min-width: 30%; 21 | cursor: pointer; 22 | border: 1px solid #f17424; 23 | font-weight: 500; 24 | background: none; 25 | color: #f17424; 26 | display: flex; 27 | align-items: center; 28 | } 29 | 30 | .form__group button > * { 31 | margin-right: 5px; 32 | } 33 | 34 | .form__group button:hover { 35 | background-color: #f17424; 36 | color: #ffffff; 37 | } 38 | 39 | .form__group label { 40 | font-weight: 650; 41 | } 42 | 43 | .warning { 44 | color: red; 45 | margin-bottom: 3px; 46 | text-align: center; 47 | } 48 | -------------------------------------------------------------------------------- /frontend/src/styles/Header.css: -------------------------------------------------------------------------------- 1 | .header__container { 2 | display: flex; 3 | align-items: center; 4 | justify-content: space-between; 5 | margin-top: 10px; 6 | } 7 | 8 | .header__nav { 9 | display: flex; 10 | } 11 | 12 | .header__nav > * { 13 | margin: 0 20px; 14 | padding: 8px 26px; 15 | font-weight: 500; 16 | color: #333; 17 | } 18 | 19 | .header__nav > *:hover { 20 | border-bottom: 2px solid #f17424; 21 | } 22 | 23 | .logo a { 24 | color: black; 25 | } 26 | .donate__btn { 27 | background-color: #f17424; 28 | color: #ffffff; 29 | border-radius: 10px; 30 | } 31 | 32 | .donate__btn:hover { 33 | color: #f17424; 34 | background-color: #fff; 35 | border: 1px solid #f17424; 36 | } 37 | 38 | .menu__bar { 39 | display: none; 40 | } 41 | 42 | @media only screen and (max-width: 600px) { 43 | .header__nav { 44 | display: none; 45 | } 46 | 47 | .menu__bar { 48 | display: block; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /frontend/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { BrowserRouter, Route, Switch } from "react-router-dom"; 3 | import Donation from "./components/Donation"; 4 | import Footer from "./components/Footer"; 5 | import Header from "./components/Header"; 6 | import LandingImage from "./components/LandingImage"; 7 | import NavBar from "./components/NavBar"; 8 | import WriteUp from "./components/WriteUp"; 9 | import YoutubeVideo from "./components/YoutubeVideo"; 10 | 11 | const App = () => { 12 | const [showNav, setShowNav] = useState(false); 13 | 14 | const toggleNav = () => { 15 | showNav ? setShowNav(false) : setShowNav(true); 16 | }; 17 | 18 | return ( 19 | 20 |
21 | {showNav && } 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |