Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rawand-faraidun committed Oct 14, 2021
2 parents cbb45be + f5dd922 commit f68d843
Show file tree
Hide file tree
Showing 105 changed files with 29,791 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#AN EXAMPLE OF WHAT .env CONTAINS

DATABASE_URL= DATABASE CONNECTION STRING
125 changes: 125 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# CSS files
*.css
*.css.map

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/
build/Release

# VSCODE configurations
.vscode/

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Rawand Faraidun

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# [Math with Science](https://www.mathwithscience.com/)
Math with Science is an open-source MERN project that contains math and science problem solvers and the goal is to help anyone struggling with any math problems.

<br />

![Math with Science brand logo](https://i.ibb.co/g6b0z0B/math-with-science-brand-01.jpg)

## installation

Getting a local copy of the project.
```git
git clone https://github.com/rawand-faraidun/mathwithscience.git
```

## Usage

**Note**: before running the project, pay attention to these points:

* Watch `.env.example` file in and make a `.env` file based on it.

* Run `client-prebuild` and `server-prebuild` scripts, or read `README.md` file in [`server`](https://github.com/rawand-faraidun/mathwithscience/tree/main/server#readme) and [`client`](https://github.com/rawand-faraidun/mathwithscience/tree/main/client#readme) folders to know more about the project's function.

### The project can be run these ways:

1. Use server to serve the static front-end *(this is how the website works)*, this can be done using `start` script.
```npm
npm start
```

2. Use React development and server seperatly using `dev` script, by default the server runs on port **5000** and react development runs on port **3000**.
```npm
npm run dev
```

3. Use `server` script to run the server, `client` script to run the client, or cd into them and start them there.

run server:
```npm
npm run server
```

run client:
```npm
npm run client
```

## Contribution
Contributions are always welcome.
**any contribution is being reviewed and tested before acceptng it**.

In general, we are looking for these kind of contributions:

* Adding new features *(example: new calculators, new branches(new branches must have atlease one calculator), new languages)*.

* Improving excisting features *(example: improvements in the functionality, improvment in rendering elements, simplifing the functionality)*.

* fixing comments *all components are written only by me and I expect mistakes in their comments*.

* If you want to contribute but not sure about it, or if they fit in these points, don't worry about it because they are only just what we are looking for in this moment, but we appreciate any imporovment.

Don't know how to contribute? read these articles:
https://www.dataschool.io/how-to-contribute-on-github/
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/

<br />

## LICENSE : MIT
https://github.com/rawand-faraidun/mathwithscience/blob/main/LICENSE
45 changes: 45 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# [Math with Science](https://www.mathwithscience.com/) - Client
Client side (Back-end) of math with science website.

The client side *(front-end)* is made with [React.js](http://reactjs.org) and connected with the server via RestAPI

## Getting Started
run `prebuild` script to install the dependencies, and compile SCSS files.
```npm
npm run prebuild
```

Or install dependencies with:
```npm
npm install
```

**NOTE**: the front-end components are designed with [SCSS](https://sass-lang.com/), using a SASS, SCSS compiler for your code editor is recomended, or use `compile-scss` script after every changes to save them into CSS files.
```npm
npm run compile-scss
```

## [public](https://github.com/rawand-faraidun/mathwithscience/tree/main/client/public) folder
Contains partial designs (`partials.scss`), website images, and fonts *(at the moment it only contains kurdish font as the english ones are added via google fonts in `partials.scss`)*.

## [src](https://github.com/rawand-faraidun/mathwithscience/tree/main/client/src) folder
Contains all components and datas for the front-end.

### [src/components/DATA](https://github.com/rawand-faraidun/mathwithscience/tree/main/client/src/components/DATA) folder
Contains data for all collections and calculators and their components.

* [`Calculators-Data.js`](https://github.com/rawand-faraidun/mathwithscience/blob/main/client/src/components/DATA/Calculators-Data.js),
[`Collections-Data.js`](https://github.com/rawand-faraidun/mathwithscience/blob/main/client/src/components/DATA/Collections-Data.js)
files are Database-like files, they contains datas for collections and calculators.

* [`Calculators.js`](https://github.com/rawand-faraidun/mathwithscience/blob/main/client/src/components/DATA/Calculators.js),
[`Collections.js`](https://github.com/rawand-faraidun/mathwithscience/blob/main/client/src/components/DATA/Collections.js)
are providing the datas with `find`, `findOne`, and `findIn` function that are taking conditions Object.

* [calculators-components](https://github.com/rawand-faraidun/mathwithscience/tree/main/client/src/components/DATA/calculators-components) folder
contains all calculators components

## [gulpfile.js](https://github.com/rawand-faraidun/mathwithscience/blob/main/client/gulpfile.js) file
Contains gulp script(s)
* **compile-scss**: compiles all scss files from client folder to css files expect the ones inside *node_modules* folder.
can be run with `npm run compile-scss` or `gulp scss`
43 changes: 43 additions & 0 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
var gulp = require('gulp')
var sass = require('gulp-sass')(require('node-sass'))
var autoprefixer = require('autoprefixer')
var postcss = require('gulp-postcss')



// scss src and compiling path
var paths = {
styles: {
src: './!(node_modules)/**/*.scss',
dest: './'
}
}


/**
* compiling scss
*/
function scss() {
return gulp.src(paths.styles.src)
.pipe(sass().on('error', sass.logError))
.pipe(sass({ outputStyle: 'compressed' }))
.pipe(postcss([autoprefixer()]))
.pipe(gulp.dest(paths.styles.dest))
}

exports.scss = scss




/**
* watching scss
*/
// function watch() {

// gulp.watch(paths.styles.src, scss)

// scss()
// }

// exports.watch = watch
Loading

0 comments on commit f68d843

Please sign in to comment.