Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing page and new ui suggestion #19

Open
wants to merge 36 commits into
base: feature/mainpage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7fb79d3
added unit tests for auth part
Jan 13, 2023
fb45ae2
Merge pull request #6 from pratik9333/feature/unit-tests
pratik9333 Jan 13, 2023
f250310
added more tests for auth
Jan 14, 2023
bbf4cf1
Merge pull request #8 from pratik9333/feature/unit-tests
pratik9333 Jan 14, 2023
266da16
added tests for user part
Jan 15, 2023
fc8ce97
removed codechef coding profile feature and added more unit tests for…
Jan 15, 2023
1692bdb
Merge pull request #9 from pratik9333/feature/unit-tests
pratik9333 Jan 15, 2023
7013977
added unit tests for profile updation, changed to supertest for http …
Jan 16, 2023
ffaad82
now using token of seeded user for authorization in tests
Jan 17, 2023
e434172
added mock function for all coding profiles
Jan 17, 2023
1e6075e
now has seperate db for test & written test for adding coding profiles
Jan 18, 2023
692ea26
refactored code of mocking server to seperate file
Jan 18, 2023
46e0088
code clean and seperate function to get user token
Jan 18, 2023
87471d8
added unit tests for sending friend req
Jan 19, 2023
5865358
Merge pull request #10 from pratik9333/feature/unit-tests
pratik9333 Jan 19, 2023
bc31b1e
basic unit tests for friend feature added
Jan 20, 2023
1c0f63e
Merge pull request #11 from pratik9333/feature/unit-tests
pratik9333 Jan 20, 2023
639eb1d
added some extra edge test cases for friend feature
Jan 21, 2023
33bb689
added basic unit tests for voting feature
Jan 21, 2023
57f7b46
addition of unitest friend feature, todo for rating feature
Jan 21, 2023
b9a3cfc
Merge pull request #12 from pratik9333/feature/unit-tests
pratik9333 Jan 21, 2023
02dbb07
containerized nodeapp and mongodb
Jan 23, 2023
f97e4c2
Merge pull request #14 from pratik9333/feature/setupdocker
pratik9333 Jan 23, 2023
95451a2
added mongo-express image in dockercompose file
Jan 23, 2023
bc18a0c
updated readme
Jan 24, 2023
2560c2c
Update README.md
pratik9333 Jan 24, 2023
c777e40
Update README.md
pratik9333 Jan 24, 2023
bc44bb6
removed env variables and updated readme
Jan 25, 2023
27b4840
readme update
Jan 25, 2023
18a9129
replaced cheeriofrom Puppeteer to scrape codechef profile data
Jan 26, 2023
1eb7f31
removed script.js function
Jan 26, 2023
9917e49
Merge pull request #18 from pratik9333/feature/scrap-codechef-profile
pratik9333 Jan 26, 2023
574384e
updated .env instructions part in readme file
Jan 26, 2023
aeba9a4
landing page + redux + tailwind
Varunmnx Jan 26, 2023
2b280c0
merge conflict resolved
Varunmnx Jan 26, 2023
e4ed377
solving merge conflict
Varunmnx Jan 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
.env
.vercel
frontend
frontend
docker/local.env
docker/test.env
172 changes: 118 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,159 @@
# Social Coders Network
<p align="center">
<img width="400" height="560" src="https://res.cloudinary.com/dqdnwfv3r/image/upload/v1674562207/Social_Coding-3-2_vxzvjs.jpg">
</p>

The social coders network helps to connect and share coding background and experience with programmers from all around the world.
Unleash the power of global coding community with Social Coding Network - where coders connect, learn and grow together! Collaborate, Innovate, and Succeed!

- Users can log in and add their add upto four coding profiles such as leetcode, codechef, codeforces and github.
- The scrapper will scrap coding websites and will show the coding background and experience of the user.
- It has peer review feed feature, where other can rate/vote the candidate profile based on their coding experience.
- The rating algorithm rates user based on the coding experience of user (such as no of problems solved, github commits, pull req, etc) and peer votes.
- You can add new friends/refer to see your profile and can start conversation for collaboration, sharing experience etc.
- A leaderboard where everyone can see the global users as well as their friends with their overall rating(based on peer review and coding exp).
```js
const express = require("express");
const app = express();

app.get("/", function (req, res) {
res.send("Welcome to our social coding experience api!");
});

## Install
app.listen(3000);
```

Some basic Git commands are:
## Content

```
$ git clone [email protected]:pratik9333/Social-Coding-Experience.git
$ cd Social-Coding-Experience
```
- [Motivation](#Motivation)
- [Features](#Features)
- [Built With](#Built-With)
- [Prerequisites](#Prerequisites)
- [Getting Started](#Getting-Started)
- [API Documentation](#API-Documentation)
- [Contributing](#Contributing)
- [Usefull Links](#Usefull-Links)
- [Running Tests](#Running-Tests)

## Motivation

## Setup
Social Coding Network is a platform built to connect coders from around the world, fostering a community where they can learn from and collaborate with one another. With the ever-evolving technology industry, staying current with the latest coding languages, techniques, and tools can be challenging. This platform aims to bridge that gap by providing a space for coders to share their knowledge and experiences, helping others to improve their coding skills and advance their careers. With Social Coding Network, coders can connect, learn, and grow together, and become part of a global community of like-minded individuals.

- Setup Node.js and editor on your PC
## Features

- [Download node.js](https://nodejs.org/en/download)
- [Setup Editor](https://docs.flutter.dev/get-started/editor?tab=vscode)
- Showcase your coding expertise with our website scraper that automatically fetches your profile data from top coding websites.
- Get recognized by the community with our peer review feature.
- Climb the ranks with our rating algorithm that takes into account your coding experience and community feedback.
- Connect and collaborate with coders from around the world by adding friends and refer each other by sharing profiles.
- See where you stand on the global leaderboard and compare yourself against top coders and your friends.

```
Create .env file that include:
## Built With

* CLOUD_NAME, API_KEY, APP_KEY => cloudinary configuration.
* COOKIE_EXPIRES, JWT_SECRET, JWT_EXPIRES, PORT => basic configuration
* API_SECRET => github action auth secret.
* DB_URL => mongodb atlas configuration
```
- [NodeJS](https://nodejs.org/en/) - Node.js is an open-source, cross-platform, back-end JavaScript runtime environment.
- [MongoDB NoSQL](https://www.mongodb.com) - MongoDB is an open source NoSQL database management program.
- [Docker](https://www.docker.com) - Docker is a software platform that allows you to build, test, and deploy applications quickly.
- [Express.js](https://expressjs.com)- Fast, unopinionated, minimalist web framework for Node.js.
- [Mocha](https://mochajs.org) - Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser.
- [Chai](https://chaijs.com) - Chai is a BDD / TDD assertion library for node and the browser.

## Prerequisites

## Install dependencies
- [NodeJS](https://nodejs.org/en/) version 16+
- [Docker](https://www.docker.com)
- [MongoDB Compass](https://www.mongodb.com/products/compass)

```
$ npm install
## Getting Started

### .env file

To run this project, create a local.env, test.env in docker and .env in root directory with following env variables

```javascript
NODE_ENV=development
CLOUD_NAME=<your-cloudacc-cloudname>
API_KEY=<your-cloudacc-apikey>
APP_KEY=hevhbdjvbewufhewhvbew
API_SECRET=<your-cloudacc-apisecret>
DATABASE_LOCAL_DB=mongodb://mongo:27017<your-db-name>
DATABASE_TEST_DB=mongodb://mongo:27017/<your-db-name>
COOKIE_EXPIRES=3
JWT_SECRET = socialcodingapp
JWT_EXPIRES = 3d
```

Include your cloudinary credentails after creating account from https://cloudinary.com.

## Start development
<p>Lastly, replace below .env variable values of .env file in root dir </p>

```javascript
DATABASE_LOCAL_DB=mongodb://mongo:27017<your-db-name>
DATABASE_TEST_DB=mongodb://mongo:27017/<your-db-name>
```
$ npm run dev

<h3>Open terminal and use the following commands to start nodejs and mongodb server</h3>

```bash
cd docker
docker-compose up -d --build
```

## Run build for production
<h3>Access Backend api's at</h3>

```http
http://localhost:80/
```
$ npm start

<h3>Access MongoDB server at</h3>

```http
http://localhost:8081/
```

## API Documentation

To understand how to use the api, access to links down below. API collections has been published through postman so that you see and run by simply clicking `run in postman` button at topmost right of page.

<<<<<<< HEAD
1. Auth

- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbWgEZ

2. User

## Languages & tools
- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbX1G4

- [Node](https://nodejs.org/en/)
3. Friends

- [Express](https://expressjs.com/)
- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbWgPJ#intro

- [Mongoose](https://mongoosejs.com/)
4. Rate
=======
### To Authenticate user

- [Atlas](https://www.mongodb.com/atlas/database)
- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbWgEZ

- [Cloudinary](https://cloudinary.com)
### User specific

- [React](https://reactjs.org/)
- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbX1G4

- [Webpack](https://webpack.js.org/)
### Add Friends

- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbWgPJ#intro

### Code Formatter
### Rate Users
>>>>>>> 574384e7ba6e9270516d84067514a029f54ef30e

- Add a `.vscode` directory
- Create a file `settings.json` inside `.vscode`
- Install Prettier - Code formatter in VSCode
- Add the following snippet:
- Navigate this link https://documenter.getpostman.com/view/16001457/2s8ZDbX1G3

```json
## Contributing

{
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.arrowParens": "avoid",
"prettier.jsxSingleQuote": true,
"prettier.trailingComma": "none",
"javascript.preferences.quoteStyle": "single",
}
The Social Coding Network project welcomes all constructive contributions. We are currently creating screens with hardcoded data. We intend to keep the repository `always open`. Feel free to contribute in many forms from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues, and more!

## Usefull Links

- [Deployed api's link](https://social-coding-experience.vercel.app)

## Running Tests

<<<<<<< HEAD
To run the test suite, first install the dependencies, create .env file and copy contents from docker/test.env file then run `npm test`:
=======
To run the test suite, first install the dependencies, then run `npm test`:
>>>>>>> 574384e7ba6e9270516d84067514a029f54ef30e

```console
$ npm install
$ npm test
```
Loading