All Projects → OperationCode → resources_api

OperationCode / resources_api

Licence: MIT license
Flask API for programming and cyber security learning resources

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to resources api

operationcode-pybot
Operation Code's Official Slackbot
Stars: ✭ 29 (-53.97%)
Mutual labels:  hacktoberfest2017, hacktoberfest2018, hacktoberfest2019, hacktoberfest2020
noobtoberfest
Game-coding challenge for everyone who wants to contribute to an open-source project for Hacktoberfest 2020 🎮
Stars: ✭ 32 (-49.21%)
Mutual labels:  hacktoberfest2019, hacktoberfest2020
cpalgorithms
Algorithms and Techniques for competitive programming
Stars: ✭ 16 (-74.6%)
Mutual labels:  hacktoberfest2019, hacktoberfest2020
IOSD-UIETKUK-HacktoberFest-Meetup-2019
This repository for IOSD HacktoberFest 2020
Stars: ✭ 17 (-73.02%)
Mutual labels:  hacktoberfest2019, hacktoberfest2020
Idea-ReVue
Social Ideation application to manage Ideas. Developed with Vue, Firebase & Vuetify
Stars: ✭ 15 (-76.19%)
Mutual labels:  hacktoberfest2019, hacktoberfest2020
Hactoberfest-2021
Make your first PR! ~ A beginner friendly repository made specifically for open source beginners. Add your profile, a blog or any program under any language (it can be anything from a hello-world program to a complex data structure algorithm) or update the existing one. Just make sure to add the file under the correct directory. Happy hacking!
Stars: ✭ 134 (+112.7%)
Mutual labels:  hacktoberfest2018, hacktoberfest2020
svelte-interview-questions
Concepts and Questions related to Svelte - Part of official Svelte resources list
Stars: ✭ 18 (-71.43%)
Mutual labels:  resources, hacktoberfest2020
laravel-thumbnails
Laravel Package for making thumbnails instantly
Stars: ✭ 51 (-19.05%)
Mutual labels:  hacktoberfest2020
Pharmacy-Mangment-System
👨‍💻 🏥 MEAN stack Pharmacy Management system.
Stars: ✭ 229 (+263.49%)
Mutual labels:  hacktoberfest2020
I-Do-Code
A workspace to sharpen you favourite programming language basics
Stars: ✭ 19 (-69.84%)
Mutual labels:  hacktoberfest2018
DockerENT
The only open-source tool to analyze vulnerabilities and configuration issues with running docker container(s) and docker networks.
Stars: ✭ 124 (+96.83%)
Mutual labels:  hacktoberfest2020
Data-Structures-and-algorithms
This repository would be a documentation of my journey towards learning Data structures and algorithms. Please ⭐ this repo if you liked the effort 😄
Stars: ✭ 22 (-65.08%)
Mutual labels:  hacktoberfest2020
embd-go
embd-go is an embeddable command-line tool for embedding data files in Go source code, specially crafted for easy use with `go generate`.
Stars: ✭ 24 (-61.9%)
Mutual labels:  resources
Plasma-Donor-App
An open-source app that helps in connecting patients and plasma donors. This is a beginner-friendly repository that helps you learn the basics of android development, git, and GitHub. Happy Hacktober!
Stars: ✭ 58 (-7.94%)
Mutual labels:  hacktoberfest2020
ADLES
Automated Deployment of Lab Environments System (ADLES)
Stars: ✭ 28 (-55.56%)
Mutual labels:  hacktoberfest2020
ray-tracer
My ongoing effort to learn how to make Ray Tracers
Stars: ✭ 14 (-77.78%)
Mutual labels:  hacktoberfest2020
Awesome-Workstations
A curated list of Awesome WFH computer and desk setups!
Stars: ✭ 35 (-44.44%)
Mutual labels:  resources
awesome-agtech
A curated list of technology companies, resources, and tools in the agricultural field.
Stars: ✭ 43 (-31.75%)
Mutual labels:  resources
Cheatsheets
Quick reference material for techies
Stars: ✭ 66 (+4.76%)
Mutual labels:  resources
awesome-coder-resources
编程路上加油站!------【持续更新中...欢迎star,欢迎常回来看看......】【内容:编程/学习/阅读资源,开源项目,面试题,网站,书,博客,教程等等】
Stars: ✭ 54 (-14.29%)
Mutual labels:  resources

Operation Code Learning Resources API

Vision

This project provides an API for storing and retrieving learning resources that might be helpful to members of Operation Code. Ideally, this project will provide the backend for various interfaces for working with the data. The front end can be found at https://operationcode.org/resources.

Getting Started

Sometimes these installs can be tricky. If you get stuck ask for help in the Slack #oc-python-projects channel!

  1. If you are not a member of Operation Code, please sign up at https://operationcode.org/join

    • Provide your email, name, zip code, and a password of your choosing.
    • You will need this email and password later when creating your API key.
    • Look for a Slack invite email and join the Slack organization, and then the #oc-python-projects channel.
  2. Install Git.

    • Choose your OS from the website and follow the prompts. This installs Git and the Bash Terminal on your machine.
    • Windows users: use the Git Bash Terminal for any of the commands in the remainder of this README. The Bash Primer
    • Extra: Git Documentation for more information on Git.
  3. Fork & Clone

  4. Install Docker and ensure it is running

  5. Install Make if you're on Windows. OSX already has it installed. Linux will tell you how to install it (i.e., sudo apt-get install make)

  6. Run make setup

  7. Run make all and then navigate to http://localhost:5000/

This should open the Operation Code Resources API webpage which has the documentation for the API. You can go through it to know about all available endpoints and understand how to use them.

If you encounter any errors, please open an issue or contact us on slack in #oc-python-projects.

Authentication

Routes that modify the database (e.g., POST and PUT) are authenticated routes. You need to include a header in your request with your API key. To generate an API key:

  1. Send a POST to http://localhost:5000/api/v1/apikey with the following JSON payload:

    {
      "email": "[email protected]",
      "password": "yoursupersecretpassword"
    }

    The email and password specified should be your login credentials for the Operation Code website. If you are not a member of Operation Code, please sign up at https://operationcode.org/join

    Example curl command:

    curl -X POST \
      http://localhost:5000/api/v1/apikey \
      -H 'Content-Type: application/json' \
      -d '{
            "email": "[email protected]",
            "password": "yoursupersecretpassword"
          }'
  2. The response will have the following structure (but will contain your email and apikey):

    {
        "apiVersion": "1.0",
        "data": {
            "apikey": "yourapikey",
            "email": "[email protected]"
        },
        "status": "ok"
    }
    • It may be helpful to save this apikey in a secure place like a password manager.
    • Do not hard-code your apikey in your own scripts. Always use an environment variable
    • You can always re-issue the POST to recover your apikey.
    • To rotate your apikey (getting a new apikey and making your old key invalid), issue an empty POST request to /api/v1/apikey/rotate with your apikey included in a header x-apikey: yourapikey:
      curl -X POST \
        http://localhost:5000/api/v1/apikey/rotate \
        -H 'x-apikey: 0a14f702da134390ae43f3639686fe26'
  3. When you create a request to an authenticated route, you must include a header x-apikey: yourapikey

    Example curl request to an authenticated route:

    curl -X POST \
      http://localhost:5000/api/v1/resources \
      -H 'Content-Type: application/json' \
      -H 'x-apikey: 0a14f702da134390ae43f3639686fe26' \
      -d '{
            "category": "Regular Expressions",
            "languages": ["Regex"],
            "name": "Regex101",
            "notes": "Regular Expression tester",
            "paid": false,
            "url": "https://regex101.com/"
    }'

Development Notes

If you make changes to the models.py or other schemas, you need to run a migration and upgrade again:

make migrate

Before committing, please lint your code:

make lint

And make sure the tests pass:

make test

There are many more make commands available you may find useful.

History

This project began when I (Aaron Suarez) started to learn software development. I did a little searching for learning resources and started a list of resources I wanted to come back to when I had some time. Shortly after this, I joined Operation Code and encountered several more learning resources that members were sharing. Soon enough, my list had grown to about 40 links. At some point, someone asked "Hey, does anyone have any learning resources?" and I said "I have a list of about 40 links that I can DM to you if you like."

Immediately, I received several requests from others asking for this list. I started to share it around via DMs, and someone suggested that I put it up on GitHub. I also got a lot of feedback about how it would be nice if there was more metadata, like a way to categorize the resources, organize them by language, and maybe even have some notes or a description (assuming the title isn't obvious). Meanwhile, the list continued to grow rapidly.

Someone got the bright idea to put it on the OC website, so I started working on a PR to incorporate it into OC, which at the time used Rails and YAML files to serve up list-like content. However, a redesign of the site was in progress, so my PR was never merged. Eventually I got out of the military and began doing software development full time. I kept maintaining the list as a little side project and sharing it around, but it hasn't made it onto the OC website. However, the resources.yml file is accessible via Slack with a slash command, so if you type /repeat resources in a public channel, the bot will link you to that file.

Eventually, the idea to use the data for multiple purposes was proposed. One really cool idea was for a Slack bot to ping relevant channels with random resources on a regular basis so that people could find awesome resources that had been shared without having to find them by searching the slack history. So it was decided that a full featured API would be important in order to really serve the needs of the OC community. This repo contains the source for the aforementioned API.

It took a lot of time and collaborative effort to put together the data and to build the API, and the work is not done yet! Please help us out, and feel free to use the learning resources to gain the knowledge required to contribute.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].